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 statement behaving strange

Former Member
0 Likes
878

I have a doubt.

I am using a DELETE itab from itab statement in between my LOOP-ENDLOOP .

Now, if I declare my itab with the syntax :-

Data: BEGIN of itab occurs 0,

...

END of itab.

Then the above DELETE statement works fine but

when I declare my itab as:

DATA: itab type / like standard table of say MARA with header line.

then the program gives me a dump at the DELETE statement.

Can anyone please tell me the difference and the reason for it.

Thank you

6 REPLIES 6
Read only

Former Member
0 Likes
629

use

DELETE <b>TABLE</b> itab WITH TABLE KEY k1 = v1 ... kn = vn.

or

DELETE TABLE itab [FROM wa].

Read only

0 Likes
629

Hi Chandrasekhar.

Thanks for your response.

I got the point but when we declare an internal table with the statement

DATA: Begin of itab

...

End of itab...

It means that the internal table is a standard internal table only...Isnt it?and if I am not wrong then the system will automatically consider data objects of type C , as its key fields .

Thanks

Read only

0 Likes
629

Hi Chandrasekhar.

Thanks for your response.

I got the point but when we declare an internal table with the statement

DATA: Begin of itab occurs 0,

...

End of itab...

It means that the internal table is a standard internal table only...Isnt it?and if I am not wrong then the system will automatically consider data objects of type C , as its key fields .

Thanks

Read only

Former Member
0 Likes
629

hi soni ,

since the itab structure and the mara structure is diff .

so this problem ..

regards,

vijay

Read only

0 Likes
629

Hi Vijay..

Assume that both the structures are same.

Thanks

Read only

Former Member
0 Likes
629

We can't really help without knowing some of the details of the dump. Could you post them please?

Rpb