Application Development and Automation 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: 
Read only

delete colom

Former Member
0 Likes
826

Hi,

How we can delete some colum from one internal table based on some selection criteria.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
798

7 REPLIES 7
Read only

Former Member
0 Likes
799

Read only

Former Member
0 Likes
798

Hi,

In ABAP editor, type delete select that one and press F1. In pop up window, drop down the detele internal table option.

Thanks,

Sendil

Read only

Former Member
0 Likes
798

Hi Sandeep,

If <condition ne some condition> or

anything in your condition.....

Itab-Field(desired) = ' '.

or intialize the field Clear itab-f1.

Endif.

Mohinder

Read only

Former Member
0 Likes
798

hiiii

i think it is not possible to delete column from internal table.

also refer to following link

also refer

regards

twinkal

Read only

Former Member
0 Likes
798

Hi Sandeep.

I would like to suggest a couple of references,

[SDN - Reference for Deleting duplicate column values|;

Hope that's usefull.

Good Luck & Regards.

Harsh Dave

Read only

Former Member
0 Likes
798

Hi, Plz get idea from this examples

It_data has 5 fields F1 to F5.

It_final has 4 fields F1 to F4.

iflag = 0.

Loop at it_data.

IF it_data-F5 NE ' '.

iflag = 1.

Endif.

Endloop.

IF iflag = 0.

Loop at it_data.

Move-Corresponding it_data to it_final.

Append it_final.

Clear it_final.

Endloop.

Endif.

rgds

rajesh

Read only

Former Member
0 Likes
798

Hi,

yes you can.

You don't even have to know the name of the internal table or the structure of the internal table youre using. By analysing the internal table using CL_ABAP_STRUCTDESCR you get a list of the fields. If you have a parameter/select-option for the fields to be removed you just create a new temporary structure using the CREATE Method. and assign this object by REF TO DATA to a field symbol when creating the structure description you can the skip the columns you do not want to have in the new structure. Afterwards you can just use the new structure as desired.

An alternative approach would be the use of the ALV Grid Framework if you just want to output the data skipping specific columns. Just loop at the field-catalogue and set the relevant fields to TECH or NO_OUT. Then theese column can either not be shown in the ALV-list at all (TECH) or are part off the hidden columns that can be used to define the layout list (NO_OUT). The Hidden columns can be defined in the layout itself as well, the TECH-flag can only be set in the program.

Hope it helps.

Tom