‎2008 Aug 07 10:47 AM
Hi,
How we can delete some colum from one internal table based on some selection criteria.
‎2008 Aug 07 10:49 AM
‎2008 Aug 07 10:49 AM
‎2008 Aug 07 10:52 AM
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
‎2008 Aug 07 10:55 AM
Hi Sandeep,
If <condition ne some condition> or
anything in your condition.....
Itab-Field(desired) = ' '.
or intialize the field Clear itab-f1.
Endif.
Mohinder
‎2008 Aug 07 11:02 AM
‎2008 Aug 07 11:12 AM
‎2008 Aug 07 11:26 AM
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
‎2008 Sep 24 8:45 AM
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