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

How to loop on Function Module that does not have EXCEPTION... RAISING

Former Member
0 Likes
512

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.

2 REPLIES 2
Read only

Former Member
0 Likes
398

Check

Rob

Read only

marcin_cholewczuk
Active Contributor
0 Likes
398

Hi,

Just try it instead of asking.

BR

Marcin Cholewczuk