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

remove entries

Former Member
0 Likes
731

Hello Abap Gurus!

Pls help me to do the following:

Any internal table has many entries of messages

with various Error types like S Success, E Error, W Warning, I Info, A Abort

and various Id s and Numbers.

The goal is to delete all entries where match with

Type EQ 'E' and Id EQ 'BA' and Number EQ '162'

How does this solution look with Abap ?

Thx

ertas

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
681

hi,

something like:

LOOP AT itab WHERE e EQ 'E' ABD Id EQ 'BA' AND Number EQ '162'.

DELETE itab.

ENDLOOP.

hope this helps

ec

6 REPLIES 6
Read only

Former Member
0 Likes
681

perhaps you are talking about the messages recieved in internal after BDC.

if yes then try and use this

loop at IT_MSG_TAB.

if <ur condition>

move-corresponding in wa_msg_tab to wa_copy.

append wa_copy to it_copy.

endif.

endloop.

delete it_msg_tab from IT_copy.

regards,

kushagra

Read only

JozsefSzikszai
Active Contributor
0 Likes
682

hi,

something like:

LOOP AT itab WHERE e EQ 'E' ABD Id EQ 'BA' AND Number EQ '162'.

DELETE itab.

ENDLOOP.

hope this helps

ec

Read only

Former Member
0 Likes
681

try this:

Delete from GT_MSG

WHERE Type EQ 'E'

and Id EQ 'BA'

and Number EQ '162'.

hope this will help..

Read only

Former Member
0 Likes
681

Eric do you delete all entries or only those lines

where are affected ?

Regards

sas

Read only

0 Likes
681

I did the coding: LOOP AT ... WHERE ... Important here is the WHERE condition, which means the lines which are not suitable for the condition, won't be processed. This case there is a delete statement inside the LOOP, that means, only those lines will be deleted, which get through the LOOP condition.

On the other hand, if I would like to delete all lines of an internal table, I would simply code CLEAR itab[]

Read only

Former Member
0 Likes
681

Dear Eric and the other helpers thank you very much

for helping.

Regards

ertas