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 data from itab

Former Member
0 Likes
751

i have itab , and i want to delete the first column how i do it?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
724

If you want to clear the contents, then it can be done.

loop at itab.

clear itab-field1.

modify itab.

endloop.

but it is not possible to delete it.

What you can do is move all the contents of itab to itab2 which has all the fields exept the first colum.

loop at itab.

move-corresponding itab to itab2.

append itab2.

endloop.

delete table itab.

Regards,

Ravi

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
724

You can not delete the column, but you can delete the data in the column.

Loop at itab.
clear itab-field1.
modify itab.
endloop.

Regards,

Rich Heilman

Read only

0 Likes
724

rich

i learn that modify is not good for performance?????

Read only

0 Likes
724

How else do you intend on modifing the records?

Regards,

Rich Heilman

Read only

suresh_datti
Active Contributor
0 Likes
724

Column? if it is row

delete itab index 1.

Regards,

Suresh Datti

Read only

rahulkavuri
Active Contributor
0 Likes
724
Loop at int_table.

clear itab-VBELN.
modify int_table.

endloop.
Read only

Former Member
0 Likes
725

If you want to clear the contents, then it can be done.

loop at itab.

clear itab-field1.

modify itab.

endloop.

but it is not possible to delete it.

What you can do is move all the contents of itab to itab2 which has all the fields exept the first colum.

loop at itab.

move-corresponding itab to itab2.

append itab2.

endloop.

delete table itab.

Regards,

Ravi

Read only

Former Member
0 Likes
724

2 problems?

1.i work with WA.

2.it delete the mandt but i have 3 space at the beging

Read only

0 Likes
724

You can delete the data, but the column will still be there, showing the space. If you don't want that column in your internal table, then remove it from the internal table structure.

You mentioned that you are using WA. Here is some sample.

Loop at itab into wa.
  clear wa-field1.
   modify itab from wa.
endloop.

Regards,

Rich Heilman

Read only

former_member184495
Active Contributor
0 Likes
724

hi,

as our friend Suresh said,

if its the first record that you want to delete...

*----

delete itab index 1.

loop at itab.

<display recors>

endloop.

*----

cheers,

Aditya.