‎2012 Jan 27 10:30 PM
Hello Abap forum.
I'm developing a report that loops on FM 'MD_STOCK_REQUIREMENTS_LIST_API' but I can not catch the exception after FM AUFBAUEN_M because it does not use the RAISING clause. The program stops with an error message.
How can I avoid the hard stop on the error message and contine the loop? Can I use TRY...CATCH in this scenario?
Thanks!!
*****LOOP START
...
CALL FUNCTION 'MD_STOCK_REQUIREMENTS_LIST_API'
EXPORTING
....
....
EXCEPTIONS
MATERIAL_PLANT_NOT_FOUND = 1
PLANT_NOT_FOUND = 2.
....
*****LOOPEND
FM MD_STOCK_REQUIREMENTS_LIST_API:
CALL FUNCTION 'AUFBAUEN_M
EXPORTING
....
EXCEPTIONS
error_message = 01
OTHERS = 02.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
‎2012 Jan 27 10:38 PM
‎2012 Jan 27 10:38 PM