Application Development and Automation 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: 
Read only

sql query....help equired

Former Member
0 Likes
536

Hi Gurus,

I have three tables like TableA TableB Tablec.

TbaleA TableB TableC

KUNNR<----


>KUNNR

BARCODE<----


>BARCODE

VBELN

Here my question is if you entered the BARCODE in the selection screen,if that BARCODE is Matches to the TableB BARCODE,Then related (One BARCODE have more than 3sales orders )all salers orders detils and remaing table fields we need to populte in output screen.

could u please provide the query for the above.

please let me know if my question is not clear

Thanks in advance.

Srinivas

Edited by: Srinivas on Oct 27, 2008 5:22 PM

3 REPLIES 3
Read only

Former Member
0 Likes
510

Could you provide little more details of the fields in the 3 tables & are there any common fields and will you need to validate only with BARCODE.

Read only

0 Likes
510

in tableA------->kunnr name1

tableB----


>kunnr barcode vbeln

tableC----


>barcode

Edited by: Srinivas on Oct 27, 2008 7:45 PM

Read only

0 Likes
510

tableA------->kunnr name1

tableB----


>kunnr barcode vbeln

select-options: s_barcode like barcode.

data:begin of t_output occurs 0,

barcode

vbeln

kunnr

name1

end of t_output.

select barcode vbeln kunnr name1

into table t_output

from tableB

inner join tableA on tableAkunnr = tableBkunnr

where barcode in s_barcode.

This will retrieve all the entries matching with barcode & corresponding kunnr details.