‎2010 Aug 16 8:41 AM
Hi Experts:
In my ABAP program,
In the loop of internal table,when match some condition,the system give error message, or go on.
Now,if the internal table has ten records, three records match some condition,the others need
process going on.
But in my program,if finds error record,giving error message,can't process other records.
I want it can not only show error message,but also process other records.
Pls give me some advice,tks!
‎2010 Aug 16 9:20 AM
Hello Stephen
As Thien said message with type E terminates your program,
You can use DISPLAY LIKE addition on your message command like this :
>MESSAGE ID '00' TYPE 'S' NUMBER '398' DISPLAY LIKE 'E'.
By this way your message will be displayed as en error in RED color
but will not terminate your program.
Or you can use an application log to display messages for loop steps
by using functions BAL_LOG_CREATE , BAL_LOG_MSG_ADD , BAL_DSP_LOG_DISPLAY.
I hope it helps.
‎2010 Aug 16 8:47 AM
Hi Stephen,
Did you give message type 'E' for displaying error? if yes, it can terminate your program at that line.
So, create a variable like flag to check error:
Loop at itab.
if found_error.
flag = 'X'
continue.
endif.
endloop.
* at exit loop
if flag = 'X'.
message to user.
endif.
hope it helps,
regards
‎2010 Aug 16 9:20 AM
Hello Stephen
As Thien said message with type E terminates your program,
You can use DISPLAY LIKE addition on your message command like this :
>MESSAGE ID '00' TYPE 'S' NUMBER '398' DISPLAY LIKE 'E'.
By this way your message will be displayed as en error in RED color
but will not terminate your program.
Or you can use an application log to display messages for loop steps
by using functions BAL_LOG_CREATE , BAL_LOG_MSG_ADD , BAL_DSP_LOG_DISPLAY.
I hope it helps.
‎2010 Aug 17 4:26 AM
Hello Bulent:
'Diaplay Like' addtion on the message command can't work in R/3,but it works fine in IDES ECC6.0.
because of the systerm version,the message statement has difference in ABAP?
Thanks for your replay.
‎2010 Aug 17 4:33 AM
‎2010 Aug 17 7:48 AM
Hi Stephen,
Press F1 button on MESSAGE command in your editor and display help for this command
if you don't see addition the DISPLAY LIKE in help window as an option
it means that your version doesn't support.
You'r welcome .
‎2010 Aug 16 9:50 AM
Hi,
Message type E is error type and it will terminate your program.
So either we can declare the message type E as information message or status or we can add a varaible flag which can be set on error.
So that it would not terminate the program.
Example :
Loop at inttable1.
if condition for error
flag = 'X'.
continue.
endif.
endloop.
Outside the loop.
if flag = 'X'.
message in other internal table with details.
endif.
Hope this helps.
Thanks,