‎2007 Oct 31 2:07 PM
I have one internal table Matnr,WERKS, bdzei . ie material, S.org, req pointer.
i have anothoer internal table with bdzei, qty. i want to merge the two internal table into one according to there material no and its qty.
can any one plz help its urgent
point will be sure
Mohana
‎2007 Oct 31 2:13 PM
Hi Mohana,
declare an internal table it_final with fields Matnr,WERKS, bdzei, qty.
loop at itab1 into wa1.
wa_final-matnr = wa1-matnr.
wa_final-werks = wa1-werks.
wa_final-bezei = wa1-bezei.
read table itab2 into wa2 with key bezei = wa1-bezei.
if sy-subrc = 0.
move wa2-qty to wa_final-qty.
endif.
append wa_final to it_final.
clear wa_final.
endloop.<b>Reward points for helpful answers</b>
Satish
‎2007 Oct 31 2:13 PM
Hi Mohana,
declare an internal table it_final with fields Matnr,WERKS, bdzei, qty.
loop at itab1 into wa1.
wa_final-matnr = wa1-matnr.
wa_final-werks = wa1-werks.
wa_final-bezei = wa1-bezei.
read table itab2 into wa2 with key bezei = wa1-bezei.
if sy-subrc = 0.
move wa2-qty to wa_final-qty.
endif.
append wa_final to it_final.
clear wa_final.
endloop.<b>Reward points for helpful answers</b>
Satish
‎2007 Oct 31 2:14 PM
Hi,
Here is sample code -
SORT IT_MATNR BY MATNR.
SORT IT_QTY NY BDZEI.
LOOP AT IT_MATNR.
READ TABLE IT_QTY WITH KEY BDZEI = IT_MATNR-BDZEI.
IF SY-SUBRC EQ 0.
IT_MATNR=QTY = IT_QTY-QTY.
MODIFY IT_MATNR INDEX SY-TABIX TRANSPORTING QTY.
ENDIF.
ENDLOOP.
Hope this helps.
ashish