2007 Jul 19 8:50 AM
Hi,
I have 4 records in my internal table and i want to append row
after second row when condition will match.
please guide me.
thanks in advancs
regards
SND
2007 Jul 19 8:57 AM
2007 Jul 19 8:58 AM
2007 Jul 19 8:59 AM
You can use statement:
INSERT <line> INTO <itab> [INDEX <idx>].
IF <condition>.
INSERT <line> INTO <itab> INDEX 2.
ENDIF.
2007 Jul 19 8:59 AM
Hi,
U can append records in between .U can only Insert records.
For that use,
if <cond>.
insert <itab> index 2.
endif.
Regards,
Padmam.
2007 Jul 19 9:01 AM
Hi,
Please check this :
DATA : BEGIN OF itab OCCURS 0,
num(2) TYPE p DECIMALS 2,
END OF itab.
DATA : count TYPE i.
itab-num = 1.
APPEND itab.
itab-num = 2.
APPEND itab.
itab-num = 3.
APPEND itab.
itab-num = 4.
APPEND itab.
DESCRIBE TABLE itab LINES count.
IF count = 4.
itab-num = '2.5'.
INSERT itab INDEX 3.
ENDIF.
-SatyaPriya
2007 Jul 19 9:03 AM
hi,
using key word INDEX u can insert a record in aspecified position as
if internal table is with header line.
INSERT <internaltable> index SY_INDEX [or index no if u know where to insert]
with out header line.
INSERT <internaltable> FROM <workarea> index SY_INDEX [or index no if u know where to insert]
if condition is true.
insert itab index 2.
endif.
if helpful reward some points.
with regards,
Suresh.A