Function Module Exceptions handling
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'
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.
You can do something like this -
<b>If SY-SUBRC NE 0.
Write:/ 'Error in Function BDC_CLOSE_GROUP',
/ 'SY-SUBRC', SY-SUBRC .
This will help you analyze where and what error occured and after which function call.