2007 Dec 03 5:27 AM
Hi please consider the foll pseudo code:
Loop at itab1.
Validations on itab1.
If true.
Move certain fields of itab1 to itab2.
*Then how do I insert these records at the END of itab2?
**Will simply "INSERT itab2" work?
endif.
Endloop.
2007 Dec 03 5:29 AM
1. INSERT [wa INTO|INITIAL LINE INTO] itab [INDEX idx].
2. INSERT [wa INTO|INITIAL LINE INTO] TABLE itab.
3. INSERT LINES OF itab1 [FROM idx1] [TO idx2]
INTO itab2 [INDEX idx3].
4. INSERT LINES OF itab1 [FROM idx1] [TO idx2]
INTO TABLE itab2.
http://help.sap.com/saphelp_46c/helpdata/en/34/8e72c56df74873e10000009b38f9b8/content.htm
simply insert itab.
else.
wa .
insert itab from wa.
null
2007 Dec 03 5:31 AM
hi,
if u want to put the records at the end of the itab,
use append stmt.
or else if u want to put the records in the specified position
use insert stmt.
<b><i>Reward points if useful</i></b>
Chandra
2007 Dec 03 5:36 AM
2007 Dec 03 5:38 AM
HI
if use workarea then you can do like this
APPEND WA_OUTPUT TO IT_OUTPUT.
clear WA_OUTPUT.
<b>Reward if usefull</b>
2007 Dec 03 5:43 AM
Hi Anand,
Try this
If Itab1 is with header line
Loop at itab1.
if <condition>.
append itab1 to itab2.
endif.
endloop.
( Or )
*if itab1 is with out header line
data fs_itab1 like line of itab1.
Loop at itab1 into fs_itab1.
if <condition>.
append fs_itab1 to itab2.
endif.
endloop.
Reward if Help,
Mahi.
2007 Dec 03 6:08 AM
Hi
Loop at itab1.
Validations on itab1.
If true.
APPEND ITAB1 TO ITAB2.
endif.
Endloop.
Hope this Helps.
Praveen