‎2007 Oct 05 8:14 AM
Hi All,
i'm using a standard BAPI to post documents. i'm calling the BAPI in loop for multiple postings.
The problem is that in some cases, the BAPI is not returning the error mesage in return table and it directly throws it in the screen while the program is in execution. So due to this, the execution is terminated and the remaining data are not posted.
So i would like to know is there any way to catch the direct error messages and display it at the end of program execution?
regards,
Prabhu
‎2007 Oct 05 10:25 AM
Can you check if the addition
ERROR_MESSAGE = <some number>
can help you in any way?
Please read ABAP documentation for the key word 'ERROR_MESSAGE' you will know how you to use it.
‎2007 Oct 05 10:36 AM
Hi,
try like this..
after calling bapi say like this..
it will return the return structure ryt.
so do like this.
Loop at itab1
call bapi.
if not it_return[] is initial.
read table it_return with key type = 'E'.
if sy-subrc eq 0.
call the FM 'FORMAT_MESSAGE'.
EXPORTING
id = it_return -id
lang = sy-langu
no = it_return -msgnr
v1 = it_return -message_v1
v2 = it_return -message_v2
v3 = it_return -message_v3
IMPORTING
msg = lv_msg.
now append this error message to some internal table say
move:lv_msg to itab_error-msg.
append itab_error.
endif.
endloop.
Now u r error messages with be thre in the internal table itab_error and finally u can display..
Reward if helpful.
Regards,
Nagaraj
‎2007 Oct 05 11:53 AM
Hi,
i would like to describe the problem in detail. i already handled the return messages from the BAPI. but i get some errors which are not returned through return table and directly thrown in the screen. So please help if you have already explored such a kind of problem.
thanks in advance,
Prabhu
‎2007 Oct 05 12:01 PM
Hi,
I think there might be some problem with ur data whch u r passing...as far as i concerned the bapi should return messages in the return table..also when u r getting those messages on screen,as unlike BDC bapi don't navigate through screens...
Regards,
Nagaraj