09-14-2010 9:14 AM
Hi all.
Have a internal table as follows:
TYPES:BEGIN OF gty_kopfitab,
MATNR TYPE mara-MATNR,
maktx TYPE makt-maktx,
MTART TYPE mara-MTART,
loekz TYPE stko-loekz,
datuv TYPE stko-datuv,
compMatnr type mara-MATNR,
compmaktx type makt-maktx,
warengruppe type mara-matkl,
ERSKZ type stpo-erskz,
posnr type stpo-posnr,
menge type stpo-menge,
ME type stpo-meins,
END OF gty_kopfitab.
types: tt_kopfitab TYPE TABLE OF gty_kopfitab.
data gt_kopfitab type tt_kopfitab WITH HEADER LINE.
After I have filled the "gt_kopfitab" I have to insert some new lines at a particular position in the internal table.
For Eg.- If the internal table has an entry as follows, I have to insert some more lines after the following line OR "MATNR" in the internal table.
MATNR maktx MTART POSNR CompMatNr
2100030931 EPS/PDF/Liz. Col.C WVF 0010 2100027625
How could I do that.
Thanks
K
09-14-2010 9:18 AM
09-14-2010 9:18 AM
09-14-2010 9:28 AM
Tried something as follows,but not working
kopfindex = SY-TABIX.
INSERT wa_kopfitab into TABLE gt_kopfitab index kopfindex.
Edited by: Kohinoor72 on Sep 14, 2010 10:28 AM
09-14-2010 9:33 AM
Hi,
Just hit F1 on the INSERT statement & you will get the help.
Regards
Abhii
09-14-2010 10:05 AM
Hi,
Try to add one counter in your internal table structure. Just give 10,20,30 etc for each records in your internal table.
For ex, your requirement is you need to add the record at the 5th position, just read the 4th record and and increment the counter by 1. So your counter variable will have 41, add this in your work area and insert it in your internal table.Finally sort your internal table with counter ascending. Now you can see your new record will be in the 5th place as per your requirement.
09-14-2010 12:49 PM