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

Former Member
0 Likes
954

i have an itab of 10 records. i want to delete from 1st row to 4th row.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
925

Hi,

Use the following code:

DELETE itab FROM idx1 TO idx2.

7 REPLIES 7
Read only

Former Member
0 Likes
925

Loop at itab.

if sy-tabix < 4.

delete itab index sy-tabix.

clear itab.

endif.

endloop.

Please reward if solved.

Amit.

Edited by: Jony on Apr 29, 2008 7:35 AM

Read only

asik_shameem
Active Contributor
0 Likes
925

DELETE itab FROM 1 TO 4.

Read only

Former Member
0 Likes
926

Hi,

Use the following code:

DELETE itab FROM idx1 TO idx2.

Read only

Former Member
0 Likes
925

hi

DELETE itab FROM 1 TO 4.

this will delete the first 4 records.

regards,

madhu

Read only

Former Member
0 Likes
925

DELETE ITAB 1 TO 4.

Please assign points if helpful.

Read only

Former Member
0 Likes
925

HI Christy,

To delete more than one line using the index, use the following statement:

DELETE <itab> [FROM <n1>] [TO <n 2>] [WHERE <condition>].

Here, you must specify at least one of the additions. The WHERE addition has the same effect as when you delete entries from any table. As well as the WHERE clause, you can specify the lines that you want to delete by their index using FROM and TO. The system deletes all of the lines of <itab> whose index lies between <n 1 > and <n 2 >. If you do not specify a FROM addition, the system deletes lines from the first line onwards. If you do not specify a TO addition, the system deletes lines up to the last line.

If at least one line is deleted, the system sets SY-SUBRC to 0, otherwise to 4.

Eg: Delete itab from 1 to 4.

Pls reward if useful.

Thanks,

Sirisha.

Read only

Former Member
0 Likes
925

Hi christy george,

Delete itab where fieldname = ' ' and.......

or

Delete itab from <number1> to <number2> where condition..

Rewards if useful,

Regards,

S.Suresh.