Handling Type 'E' messages from function modules

By Rahul Gopinath, Wipro Technologies

SCENARIO

Standard function module L_TO_CREATE_DN is used for Transfer Order creation. We were facing the issue of abnormal termination of the program when an Error Message was being thrown from the function without the RAISING statement. Since an Exception was not being raised we were not able to handle the same in our program and it lead to abnormal termination with a Type 'E' message in the status bar.

Error Message without RAISING statement

Abnormal termination of the program with the Error Message

Such Error Messages from standard function modules can be handled in our ABAP programs in the same way as we handle Exceptions from function modules and we can continue the execution of the program without the Error Message terminating the program.

 Just call the function module by adding the statement

ERROR_MESSAGE = Any No. in the EXCEPTIONS part of the function module call.

The Number mentioned above will be the value of sy-subrc when the control is returned back to the program after the execution of the function module with an error message.

 

And now we can simple handle that Error Message

 IF sy-subrc EQ 17.

------- “code to handle the error message  

ENDIF.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image