2008 Mar 25 11:48 AM
Hi Experts,
I have an internal table which contains ten fields.
After few processing i want to delete few columns from the internal table which contains the data.
How can i do that?
Please reply it ASAP.
Thanks in advance
2008 Mar 25 11:53 AM
hi
You cannot delete the columns.. declare another internal table with the final structure you want say ITAB2.
LOOP AT ITAB.
MOVE CORRESPONDING FIELDS OF ITAB TO ITAB2.
APPEND ITAB2.
ENDLOOP.
2008 Mar 25 11:52 AM
Well, you can NOT delete a column of an internal table, all you can do is to delete the data in that column.
loop at itab into wa.
wa-desired_column = space.
modify itab from wa.
endloop.
2008 Mar 25 11:53 AM
hi
You cannot delete the columns.. declare another internal table with the final structure you want say ITAB2.
LOOP AT ITAB.
MOVE CORRESPONDING FIELDS OF ITAB TO ITAB2.
APPEND ITAB2.
ENDLOOP.
2008 Mar 25 11:54 AM
Hi,
loop at itab1.
read table itab2 with key field2 = itab1-field1.
if sy-subrc = 0.
delete itab1 index sy-tabix.
endif.
endloop.
HTH
Regards,
Dhruv Shah