2006 Oct 18 7:40 AM
Hi any body plz send me the code for combining two internal tables( ITAB_vbap and ITAB_vbkd) and filling the final data to final one internal table(ITAB_final)
2006 Oct 18 7:46 AM
Sort itab_vbap by vbeln posnr.
sort itab_vbkd by vbeln posnr.
Loop at itab_vbap into wa_vbap.
read table itab_vbkd into wa_vbkd with key vbeln = wa_vbap-vbeln posnr = wa_vbap-posnr binary search.
if sy-subrc = 0.
move corresponding wa_vbap to wa_final.
move corresponding wa_vbkd to wa_final.
append wa_final to itab_final.
endif.
endloop.
For move corresponding statement the name of the fields should match in both the work areas.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
Hi any body plz send me the code for combining two internal tables( ITAB_vbap and ITAB_vbkd) and filling the final data to final one internal table(ITAB_final)
2006 Oct 18 7:46 AM
Sort itab_vbap by vbeln posnr.
sort itab_vbkd by vbeln posnr.
Loop at itab_vbap into wa_vbap.
read table itab_vbkd into wa_vbkd with key vbeln = wa_vbap-vbeln posnr = wa_vbap-posnr binary search.
if sy-subrc = 0.
move corresponding wa_vbap to wa_final.
move corresponding wa_vbkd to wa_final.
append wa_final to itab_final.
endif.
endloop.
For move corresponding statement the name of the fields should match in both the work areas.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
2006 Oct 18 7:55 AM
2006 Oct 18 7:51 AM
Hi,
Loop at itab1 into wa1.
read table itab2 into wa2 with key f1 = wa1-f1
f2 = wa1-fa2.
if sy-subrc eq 0.
move-corresponding wa1 to wa3.
move-corresponding wa2 to wa3.
append wa3 to itab3.
endif.
endloop.
Regards,
Laxmi.
2006 Oct 18 7:56 AM
2006 Oct 18 8:03 AM
HI,
If tables are of the same type, try this
INSERT LINES OF itab1 INTO TABLE itab3.
INSERT LINES OF itab2 INTO TABLE itab3.Regards,
Joris Bots
2006 Oct 18 7:55 AM
Hi,
loop at itab_vbap into wa_vbap.
move-corresponding wa_vbap to wa_final.
loop at itab_vbkd into wa_vbkd where vbeln = wa_vbap and posnr = wa_posnr.
move-corresponding wa_vbkd to wa_final.
append wa_final to itab_final.
endloop.
endloop.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |