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 internal table.

Former Member
0 Likes
671

have code like this

data : itab type table of c_trket.

data : wa type c_trket.

In itab there are 7 records.

number name

1 abc-1

2 abc-2

3 abc-3

4 abc-4

5 test

6 disp

7 mod

I have to delete records from itab where name ne 'test' or name ne 'disp' or name ne 'mod'.

I am using command

delete itab where name ne 'test' or name ne 'disp' or name ne 'mod'.

giving me an error : c_trket is not an internal table with workarea.

How I can delete these records from itab ?

Study SAP

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
640

Make sure to use AND and not OR.

delete itab where name ne 'test' and name ne 'disp' and name ne 'mod'.

Regards,

Rich Heilman

Edited by: Rich Heilman on Jan 22, 2009 10:35 AM

have code like this

data : itab type table of c_trket.

data : wa type c_trket.

In itab there are 7 records.

number name

1 abc-1

2 abc-2

3 abc-3

4 abc-4

5 test

6 disp

7 mod

I have to delete records from itab where name ne 'test' or name ne 'disp' or name ne 'mod'.

I am using command

delete itab where name ne 'test' or name ne 'disp' or name ne 'mod'.

giving me an error : c_trket is not an internal table with workarea.

How I can delete these records from itab ?

Study SAP

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
641

Make sure to use AND and not OR.

delete itab where name ne 'test' and name ne 'disp' and name ne 'mod'.

Regards,

Rich Heilman

Edited by: Rich Heilman on Jan 22, 2009 10:35 AM

Read only

0 Likes
640

if not using or operator in delete command :

using like :

delete itab where name eq 'disp'.

delete itab where name eq 'mod'.

the error is same,

how i can solve the problem ?

Study SAP

Read only

0 Likes
640

POst the relevant code including the DATA statements for ITAB and its type,

Regards,

Rich Heilman