‎2008 Feb 06 6:37 PM
There are 2 Internal Table
Table Row
A B C D
Table 1
A1 B1 C1 D1
A2 B2 C2 D2
A3 B3 C3 D3
Table 2
K1 K2 K3 D1
F1 F2 F3 D1
G1 G2 G3 D1
M1 M2 M3 D2
H1 H2 H3 D2
P1 P2 P3 D3
Output
I am comparing only row D between two tables the output should be as follows
A1 B1 C1 D1 K1 K2 K3 D1
A1 B1 C1 D1 F1 F2 F3 D1
A1 B1 C1 D1 G1 G2 G3 D1
A2 B2 C2 D2 M1 M2 M3 D2
A2 B2 C2 D2 H1 H2 H3 D2
A3 B3 C3 D3 P1 P2 P3 D3
How to write the table join query. Table1 should be the primary table.
Thanks
‎2008 Feb 06 6:41 PM
loop at table1 into wa_table1.
lopp at table2 into wa_table2 where d = wa_table1-d.
move-corresponding wa_table2 to wa_final.
move-corresponding wa_table1 to wa_final.
append wa_final into itab_final.
endloop.
endloop.
select ....
from table1 as a
join table2 as b
on a~d = b~d.
‎2008 Feb 06 6:41 PM
loop at table1 into wa_table1.
lopp at table2 into wa_table2 where d = wa_table1-d.
move-corresponding wa_table2 to wa_final.
move-corresponding wa_table1 to wa_final.
append wa_final into itab_final.
endloop.
endloop.
select ....
from table1 as a
join table2 as b
on a~d = b~d.
‎2008 Feb 06 6:54 PM
‎2008 Feb 06 6:43 PM
SELECT * FROM TABLE 1 INNER JOIN TABLE 2 ON TABLE1-D = TABLE2-D
‎2008 Feb 06 6:47 PM
Sorry ! I will try your code
Thanks
Edited by: Senthilramkumar on Feb 6, 2008 7:49 PM