‎2007 Apr 02 4:27 AM
hi
after the collect statement, may i know what is the best practice to initialise(clear) the field that not intended for the collect. i have 6 fields which are type DEC. the internal table is like a structure where the numeric fields are type DEC.
I only want 4 out of 6 fields to accumulate the value whereas another 2 i do not want as these 2 fields not large enough to store the accumulated value and also these 2 are not meant to accumulate value.
I cannot make the 2 fields to character field as i use itab like table occurs 0.
i just want comment what method i can use after the collect statement to initialise (clear) the other 2 fields.
thanks
‎2007 Apr 02 5:59 AM
Hi,
What I thin u can do is that in the loop where u r collecting the internal table, prior to that clear the both fields which are not required to be collected.
e.g. CLEAR : ITAB-B, ITAB-C.
COLLECT ITAB.
In this case the ITAB-B and C fields will always contain initial value.
Hope it helps.
Regards,
Himanshu
‎2007 Apr 02 5:59 AM
Hi,
What I thin u can do is that in the loop where u r collecting the internal table, prior to that clear the both fields which are not required to be collected.
e.g. CLEAR : ITAB-B, ITAB-C.
COLLECT ITAB.
In this case the ITAB-B and C fields will always contain initial value.
Hope it helps.
Regards,
Himanshu
‎2007 Apr 02 6:10 AM
Hi..,
suppose A,B,C,D,E,F are the fields and u dont want E and F to get accumulated ...
just before the collect statement clear those two fields..
<b>clear : wa_itab-E, wa_itab-F.
collect wa_itab to itab.</b>
reward all helpful answers..
sai ramesh
‎2007 Apr 02 6:13 AM
Hi..
loop at itab.
collect itab into itab.
clear: itab-5, itab-6.
modify itab index sy-tabix from itab transporting itab-5 itab-6.
endloop.
try this,...
Message was edited by:
Rammohan Nagam