‎2007 Jul 09 8:27 AM
pls help its is very argent
is it possible modify internal table with 2nd internal table
ihave two iternal table andboth have same structure .
1st itab has one partner1 .
2nd itab has 3 records (partner2 name)for the same partner1 now i want to merge both the itabs.
so i want all partner2 for a particular partner1 in itab1
for a one partner1 there can be more than one partner2
‎2007 Jul 09 11:08 AM
Yes it is.
LOOP AT it1.
READ TABLE it2 WITH KEY ? = it1-?.
IF sy-subrc = 0.
MOVE it2-? TO it1-?.
MODIFY it1.
ENDIF.
ENDLOOP.
or
SORT : itab1 by common column,
itab2 by common column.
LOOP AT ITAB1.
READ TABLE ITAB2 WITH common column = ITAB1-KEY binary search.
If sy-subrc eq 0.
Move itab2-addres to itab1-address.
append itab1.
clear itab1.
endif.
‎2007 Jul 09 11:08 AM
Yes it is.
LOOP AT it1.
READ TABLE it2 WITH KEY ? = it1-?.
IF sy-subrc = 0.
MOVE it2-? TO it1-?.
MODIFY it1.
ENDIF.
ENDLOOP.
or
SORT : itab1 by common column,
itab2 by common column.
LOOP AT ITAB1.
READ TABLE ITAB2 WITH common column = ITAB1-KEY binary search.
If sy-subrc eq 0.
Move itab2-addres to itab1-address.
append itab1.
clear itab1.
endif.
‎2007 Jul 09 1:27 PM