‎2008 Apr 03 9:22 AM
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
‎2008 Apr 03 9:28 AM
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
‎2008 Apr 03 9:26 AM
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
‎2008 Apr 03 9:28 AM
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
‎2008 Apr 03 9:33 AM
try this:
Delete from GT_MSG
WHERE Type EQ 'E'
and Id EQ 'BA'
and Number EQ '162'.
hope this will help..
‎2008 Apr 03 10:30 AM
Eric do you delete all entries or only those lines
where are affected ?
Regards
sas
‎2008 Apr 03 10:35 AM
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[]
‎2008 Apr 03 10:50 AM
Dear Eric and the other helpers thank you very much
for helping.
Regards
ertas