Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

deleting a column from an internal table

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Instead of Append Itab use

Collect <wa> into <Itab>

Regards,

Naresh.

7 REPLIES 7

Former Member
0 Kudos

Hi Vennila,

Did you try COLLECT statement ?

Do F1 on this key - Collect in se38 and read more.

Hope it helps.

Manish

Former Member
0 Kudos

Hi,

your problem can easily be solve by COLLECT statement

0 Kudos

i will try with COLLECT statement.

Former Member
0 Kudos

Hi,

Instead of Append Itab use

Collect <wa> into <Itab>

Regards,

Naresh.

Former Member
0 Kudos

hai naresh,

when i remove the append statement and use collect statement i got the answer. thank you for your timely help.

Former Member
0 Kudos

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.