‎2007 Feb 14 12:56 PM
Hello All,
I want to combine two internal tables,
First one is,
Data: it_ltap_vb like LTAP_VB occurs 0 with header line.
Second one is,
Data: Begin of it_picksave occurs 0,
lgnum like ltap-lgnum,
strat like zparapic-strat,
kunnr like likp-kunnr,
adrnr like vbpa-adrnr,
End of it_picksave.
Will you please let me know how to combine these two tables?
Thanks in Advance,
Ranjan
‎2007 Feb 14 1:40 PM
Hi,
Create Internal table this way,
data : begin of it_tab occurs 0,
lgnum like ltap-lgnum,
strat like zparapic-strat,
kunnr like likp-kunnr,
adrnr like vbpa-adrnr.
include structure LTAP_VB.
data : end of it_itab.
‎2007 Feb 14 12:58 PM
Means, I want to create an internal table with the combination of the above two tables.
‎2007 Feb 14 1:00 PM
Hi ,
Do this way:
loop at it_ltap_vb.
read table it_picksave with key lgnum = it_ltap_vb-lgnum.
if sy-subrc = 0.
move-corresponding it_picksave to it_final.
move-corresponding it_ltap_vb to it_final.
append it_final.
endif.
endloop.
Note: it_final must have the fields from it_ltap_vband it_picksave.
Regards,
Ravi
‎2007 Feb 14 1:03 PM
DATA: BEGIN OF itab,
struct LIKE ltap_vb,
lgnum LIKE ltap-lgnum,
kunnr LIKE likp-kunnr,
adrnr LIKE vbpa-adrnr,
END OF itab.
sort table it_picksave by lgnum.
Loop at it_ltap_vb into wa_ltap_vb.
read table it_picksave into wa_picksave with key lgnum = wa_ltap_vb-lgnum.
if sy-subrc = 0.
*use move corresponding to move data.
*append into final table
endif.
Endloop.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
‎2007 Feb 14 1:05 PM
Hi,
Create a Internal table with all the fields which you want in the final internal table ..
loop at it_ltap_vb.
read table it_picksave with key lgnum = it_ltap_vb-lgnum.
if sy-subrc = 0.
Move : it_ltap_vb-field1 TO newitab-field1
it_ltap_vb-field2 TO newitab-field2.
it_picksave-field1 to newitab-field3
--- --- --
--- --- --
append newtab.
endif.
endloop.Regards
Sudheer
‎2007 Feb 14 1:20 PM
Hi,
U combine in this way,
data : begin of it_bb occurs 0,
fieldname like tablename-fieldname.
include structure vbap.
data: end of it_bb.
thanks
‎2007 Feb 14 1:24 PM
In ltap_vb structure there are many fields. I want to include this structure instead of keeping all the fields in the third internal table.
Please let me know how to add all the fields of both internal tables and I needs to create new internal table.
‎2007 Feb 14 1:40 PM
Hi,
Create Internal table this way,
data : begin of it_tab occurs 0,
lgnum like ltap-lgnum,
strat like zparapic-strat,
kunnr like likp-kunnr,
adrnr like vbpa-adrnr.
include structure LTAP_VB.
data : end of it_itab.