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

Table joins??

Former Member
0 Likes
426

Hello Everyone,

Wat is the code for the table join using <u>for all entries</u> statement?how do v join 6 tables using using the above statement...?

Thanking u in anticipation.

Regards,

Sirisha.

Hello Everyone,

Wat is the code for the table join using <u>for all entries</u> statement?how do v join 6 tables using using the above statement...?

Thanking u in anticipation.

Regards,

Sirisha.

2 REPLIES 2
Read only

Former Member
0 Likes
399

Please check the same code.

select af1 bf1 cf1 df1 ef1 gf1

into table itab

for all entries in ixyz

from a inner join b on af1 = Bf1....etc

Regards

Anurag

Read only

Former Member
0 Likes
399

Hi Sirisha,

You can use the join and for all entries as shown below in the example.

check not t_materials2[] is initial.
sort t_materials2 ascending by matnr werks.
 
SELECT b~matnr b~mtvfp b~werks
       b~dismm b~beskz b~plifz b~disgr
       c~pstat c~mtart c~brgew c~normt z~mtpos
    INTO CORRESPONDING FIELDS OF TABLE t_materials
        FROM marc AS b 
           INNER JOIN mara AS c 
              ON a~matnr = c~matnr
           INNER JOIN mvke AS z
              ON a~matnr = b~matnr 
                 FOR ALL ENTRIES IN t_materials2
                    WHERE b~matnr EQ t_materials2-matnr
                    AND b~werks EQ t_materials2-werks
                    AND b~stawn IN s_stawn
                    AND b~disgr IN s_disgr
                    AND b~mmsta EQ '03'
                    AND c~mtart IN s_mtart
                    AND z~vkorg EQ p_vkorg
                    AND z~vtweg EQ p_vtweg
                    AND z~mtpos IN s_mtpos.

Cheers

VJ