11-11-2006 6:50 PM
Hi all,
Once again I need a help!!! here I go with my problem: I have one internal table with 3 records and I have another internal table with data related first internal table wich I need to fill it:
Table 1
F1 F2 F3 F4 F5
01 A C X
02 A B X
03 B C
Table2
F1 F2 F3 F4
01 A C 5
01 A C 10
02 B C 5
Result Table (Table 1)
F1 F2 F3 F4 F5
01 A C 5 X
- - - 10 X
02 A B 5 X
03 B C
I tried to
Loop at TABLE1.
Read TABLE 2 with key F1 = TABLE1-F1.
if sy-subrc = 0.
TABLE1-F4 = TABLE2-F4.
MODIFY TABLE1 FROM TABLE1
TRANSPORTING F4
WHERE F1 = TABLE1-F1.
endif.
Endloop.
But only modify first record of TABLE1 and I need to append the records of TABLE2.
Thanks in advance with any help !!!
Regards
Tokio
11-12-2006 1:36 PM
Hi,
in result table
- - - 10 X
is hard to explain. - - - 10 - would be resonable, or better 01 A C 15 X?.
Better define your result table separately. Loop at table 1, read table 2 with key. If found, move-corresponding table 1 ro result table header line, fill empty collumns in table1 from table 2, then append combined line to result table. The delete row in table 2.
When done, loop at table 2 and move-corresponding table 2 ro result table header line, append it.
Something like that.
Regards,
Clemens
11-12-2006 1:36 PM
Hi,
in result table
- - - 10 X
is hard to explain. - - - 10 - would be resonable, or better 01 A C 15 X?.
Better define your result table separately. Loop at table 1, read table 2 with key. If found, move-corresponding table 1 ro result table header line, fill empty collumns in table1 from table 2, then append combined line to result table. The delete row in table 2.
When done, loop at table 2 and move-corresponding table 2 ro result table header line, append it.
Something like that.
Regards,
Clemens
11-14-2006 7:55 PM