Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Select Query

Former Member
0 Kudos

Hi All,

I have a requirement on report to get the 4 fields from one dffkop table like 'program', 'product', 'business area', 'policy' and 1 field from TFKTVOT i.e. 'text'.

But this one filed should come inbetween of 4 fields and also this text field should validate with another field 'main' which is in table zfield.

Could you please provide me any query in this case...

Regards

Rama Krishna G

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

first you write a select query for your 4 field

from dffkop

and then choose a common field in both dffkop TFKTVOT

then write a select using for all entries and in this select use sub quires( ad exsists....)

but you must have common fields in both tfktvot and zfield.

Regards,

R K.

5 REPLIES 5

Former Member
0 Kudos

Hi,

first you write a select query for your 4 field

from dffkop

and then choose a common field in both dffkop TFKTVOT

then write a select using for all entries and in this select use sub quires( ad exsists....)

but you must have common fields in both tfktvot and zfield.

Regards,

R K.

Former Member
0 Kudos

Hi,

SELECT A~program A~product A~businessarea A~policy B~text
   FROM dffkop AS A
   INNER JOIN TFKTVOT AS B
   ON A~(field) = B~(field)
   INNER JOIN zfield AS C
   ON B~text = c~main
INTO TABLE ITAB
WHERE ...

Former Member
0 Kudos

Hi,

1. define 3 internal tables with type of dffkop another of TFKTVOT type, and 3rd table as final table with all the fields to be displayed in output.

2. Now write 2 selects on above 2 tables and get the rq data.

3. LOOP the first table and READ the 2nd table with the reference field of table 1.

4. append all into final table and display it.

Regards,

Pavan

Former Member
0 Kudos

Hi,

Use TYPES to declare these fields.....

TYPES: Begin of t_table,

program type dffkop-program,

product type dffkop-product,

business type dffkop-business,

main type zfield-main.

End of t_table.

data: i_table type standard table of t_table, -


> internal table

wa_table like line of i_tBle. -


> Work Area

Thanks And Regards

Suraj S Nair

Edited by: Suraj Nair on Apr 10, 2009 11:23 AM

Former Member
0 Kudos

what are the keys between tables TFKTVOT and ztable.

Based on that populate an internal table with keys and compare main.

now you need to know what are the keys that you should check for between these tables and dffkop.

Declare your internal table in the sequence you want it to be.

Use into corresponding fields in select query to select these four fields.

Final text can be populated from the intenal table created earlier..

Regards,

Lalit Mohan Gupta.