Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Function Module Exceptions handling

Hi all,

I dont know how to handle exceptions. For example I have given code below. In that do I need to put any extra logic or not.

CALL FUNCTION 'BDC_CLOSE_GROUP'

EXCEPTIONS

NOT_OPEN = 1

QUEUE_ERROR = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks,

Shashikanth.

Tags:
Former Member
Former Member replied

You can do something like this -

<b>If SY-SUBRC NE 0.

Write:/ 'Error in Function BDC_CLOSE_GROUP',

/ 'SY-SUBRC', SY-SUBRC .

ENDIF.</b>

This will help you analyze where and what error occured and after which function call.

Cheers.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question