09-01-2008 12:14 PM
Hai friends,
The following is my requirement
i have 3 materials with quantity in an internal table it_tab1.
MATNR Qty
a 10
b 20
b 30
c 5
d 10
i want as below
a 10
b 50
c 5
d 10
when i click a radio button the result should move to an excel sheet. i have done the calculation and moved to local variable.
now i want the local variable to be deleted from the internal table. how can i delete a column from an internal table.
09-01-2008 12:54 PM
Hi,
Instead of Append Itab use
Collect <wa> into <Itab>
Regards,
Naresh.
09-01-2008 12:18 PM
Hi Vennila,
Did you try COLLECT statement ?
Do F1 on this key - Collect in se38 and read more.
Hope it helps.
Manish
09-01-2008 12:20 PM
09-01-2008 12:23 PM
09-01-2008 12:25 PM
Check with this link for your suntax
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb36d5358411d1829f0000e829fbfe/content.htm
09-01-2008 12:54 PM
Hi,
Instead of Append Itab use
Collect <wa> into <Itab>
Regards,
Naresh.
09-02-2008 6:46 AM
hai naresh,
when i remove the append statement and use collect statement i got the answer. thank you for your timely help.
09-10-2008 6:45 AM
TWO WAYS:
1. COLLECT
2. TYPES: BEGIN OF TY_MATRIAL,
MATNR TYPE MARA.,
SUBTOTAL TYPE I,
END OF TY_MATRIAL.
DATA: IT_MATNR TYPE TABLE OF TY_MATRIAL,
IW_MATNR TYPE TY_MATRIAL,
IT_SUBTOTAL TYPE TABLE OF TY_MATRIAL,
IW_SUBTOTAL TYPE TABLE OF TY_MATRIAL.
SORT IT_MATNR BY MATNR.
LOOP AT IT_MATNR INTO IW_MATNR.
IW_SUBTOTAL-MATNR = IW_MATNR-MATNR.
IW_SUBTOTAL-SUBTOTAL = IW_SUBTOTAL-SUBTOTAL + IW_MATNR-SUBTOTAL.
AT END OF MATNR.
APPEND IW_SUBTOTAL TO IT_SUBTOAL.
CLEAR IW_SUBTOTAL.
ENDAT.ENDLOOP.