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

inner join

Former Member
0 Likes
762

hi experts,

could u plz give me the code for writing inner join on three tables.

regards,

siri.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
718

Hi,

Copy paste this code in SE38. Give where condition.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR,

ERSDA LIKE MARA-ERSDA,

MAKTX LIKE MAKT-MAKTX,

WERKS LIKE MARC-WERKS,

END OF ITAB.

select AMATNR AERSDA BMAKTX CWERKS INTO TABLE ITAB FROM MARA AS A INNER JOIN MAKT AS B ON AMATNR = BMATNR INNER JOIN MARC AS C ON AMATNR = CMATNR

WHERE A~MATNR = <PARAMETER>.

Reward points if useful.

Regards,

Senthil

6 REPLIES 6
Read only

Former Member
0 Likes
718

Here is the sample

select af1 bf2 c~f3

into table itab

from table1 as a inner join table2 as b on af1 = bf1

inner join table3 as c on af1 = cf1

where a~f1 = parameter.

Regards

Anurag

Read only

0 Likes
718

MY PROB SOLVED

THANKX aNURAG

SIRI

Read only

0 Likes
718

U r welcome..Sireesha.

Please mark the question as resolved with a blue star...!!

Cheers !!

Read only

Former Member
0 Likes
719

Hi,

Copy paste this code in SE38. Give where condition.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR,

ERSDA LIKE MARA-ERSDA,

MAKTX LIKE MAKT-MAKTX,

WERKS LIKE MARC-WERKS,

END OF ITAB.

select AMATNR AERSDA BMAKTX CWERKS INTO TABLE ITAB FROM MARA AS A INNER JOIN MAKT AS B ON AMATNR = BMATNR INNER JOIN MARC AS C ON AMATNR = CMATNR

WHERE A~MATNR = <PARAMETER>.

Reward points if useful.

Regards,

Senthil

Read only

Former Member
0 Likes
718

pls find the following sample code

select tab1field into corresponding fields of table itab from tab1 inner join tab2 on tab1field1 = tab2field2 inner join tab3 on tab1field1 = tab3~field1.

Thanks & Regards

Read only

Former Member
0 Likes
718

hi

select tab1~fld1

tab2~fld2

tab3~fld3

tab3~fld4

into table itab

from tab1 inner join tab2 on tab1fld1 = tab2fld1

inner join tab3 on tab1fld1 = tab3fld1

where tab1~fld in p_fld1.

hope this helps,

do reward if it helps,

priya.