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

internal table delete

Former Member
0 Likes
843

hi All,

I am having an internal table itab without a header line but with an work area,

begin of itab occurs 100,

Now when i use condition delete itab where logexp.

all the contents in itab that match the logexp are deleted but not the one that is contained in the current work area.

so i still have one record that meets the logexp and not deleted.

will using

delete itab[] where logexp.

help??

thanks and regards,

Gaurav

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
806

Hi

Use Clear <workarea name>.

Regards

Haritha.

7 REPLIES 7
Read only

Former Member
0 Likes
806

Hi Gaurav ,

The decleration begin of itab occurs 100 , automatically adds a header line to your internal table , but any way this should not be happening , pleasee check again if the value is actaully matching the one in internal table.

Regards

Arun

Read only

Former Member
0 Likes
806

Hi Gaurav

when you delete the internal table only the entries in the internal table will be cleared

The work area is being referenced separate from the internal table

To clear the work area all you have to do is the statement CLEAR

e.g

CLEAR: wa_itab.

Read only

Former Member
0 Likes
807

Hi

Use Clear <workarea name>.

Regards

Haritha.

Read only

Former Member
0 Likes
806

use <b>clear</b> before the start of the loop .

also after the deletion is over when u meet the logical condition.

regards,

vijay

Read only

Former Member
0 Likes
806

Hi Gaurav,

the statement you are using will clear the content of internal table only. Your work area's content will not be erased. You need to clear it manually using another statement. This is a standard case with SAP ABAP.

Regards,

Jignesh

Read only

Former Member
0 Likes
806

so how do clear the work area of an internal table with header line?

shud i use clear itab before using the condition?

Read only

0 Likes
806

Hi Gaurav,

Clear itab will clears the internal table header...

and

Clear itab[] will clears the internal table.

Regards,

Satya.