‎2007 Jul 03 7:38 AM
Hi,
I have 10 records in internal table, first 5 records is for one vendor and remaining 5 records for another vendor.
1. How can i store first 5 records in one internal table?
2. How can i store records from 6-10 in another internal table?
‎2007 Jul 03 7:41 AM
Hi Udaya,
loop at itab.
if itab-vendor = 'A'.
append itab1
else
append itab2.
endif.
clear: itab,
endloop.
Reward if useful!
‎2007 Jul 03 7:44 AM
Hi,
SORT ITAB by LIFNR.
LOOP AT ITAB.
AT NEW LIFNR.
MOVE ITAB to ITAB1.
ENDAT.
MOVE ITAB to ITAB2. " This will work from 6 to 10 records
ENDLOOP.Regards
Sudheer
‎2007 Jul 03 7:45 AM
Hi,
loop at itab.
If itab-vendor = 'B'.
append itab1.
elseif itab-vendor = 'D'.
append itab2.
endif.
endloop.
Regrads,
Priyanka.
‎2007 Jul 03 7:47 AM
loop at itab.
if sy-tabix le 5.
move itab data to itab1.
append itab1.
else.
move itab data to itab2.
append itab2.
endif.
endloop.
Reward points if useful,
Aleem.
‎2007 Jul 03 7:53 AM
data: itab1 type standrad table of mara,
itab2 type standrad table of mara,
itab3 type standrad table of mara,
itab4 type standrad table of mara,
itab5 type standrad table of mara,
itab6 type standrad table of mara,
itab7 type standrad table of mara,
itab8 type standrad table of mara.
data: variable type n.
l_table type string.
field-symbol: <fs_any> type table of any.
loop at itab.
on change of vendor_num.
variable = variable + 1.
concatenate itab variable into l_table.
assign (l_table) to <fs_any>.
<fs_any> = itab.
append <fs_any> .
endon.
endloop.
i think this will dynamically move the contents to different internal tables.
however you need to define those internal table in type statement.
just try it...hope it works.
Reward points if helpful
‎2007 Jul 03 10:45 AM