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

regarding delete statement.

Former Member
0 Likes
628

Hi guys,

could anybody help me in this.

There are 5 records in this internal table. (1,2,3,4,5)

loop at itab.

check itab-number = '3'.

delete table itab.

write: itab-number.

endloop.

Here the out put is: 3.

what 'DELETE' statement will do here.

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
609

Hi,

Note that itab is a table with Headerline. and itab means headerline and itab[] is the table.

In your case DELETE statements has removed that row or record from the table.

But it is still there in the Headerline <b>itab</b> so it gets displayed with WRITE.

But the table will not have that record.

Check by executing this code.

LOOP AT ITAB.

WRITE: itab-number.

ENDLOOP.

<b>You can use CLEAR ITAB. after DELETE statement to clear the headerline.</b>

Regards,

Sesh

4 REPLIES 4
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
610

Hi,

Note that itab is a table with Headerline. and itab means headerline and itab[] is the table.

In your case DELETE statements has removed that row or record from the table.

But it is still there in the Headerline <b>itab</b> so it gets displayed with WRITE.

But the table will not have that record.

Check by executing this code.

LOOP AT ITAB.

WRITE: itab-number.

ENDLOOP.

<b>You can use CLEAR ITAB. after DELETE statement to clear the headerline.</b>

Regards,

Sesh

Read only

0 Likes
609

thnk u very much sesh

Read only

former_member196299
Active Contributor
0 Likes
609

hi Venkat ,

The delete stmt will delete the record , but in your case u r displaying the work area values , so u r getting the out put as 3 .

Regards,

Ranjita

Read only

Former Member
0 Likes
609

loop at itab.

check itab-number = '3'.

delete itab. " Modified

write: itab-number.

endloop.

This will serve your purpose . This will delete the third line of your internal table .

Earlier you were deleting the table and displaying the entries of Work area