Application Development 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: 

Exception handling in FM

former_member211992
Active Participant
0 Kudos

Dear all

CALL FUNCTION 'SD_PURCHASE_CHANGE_ORDER'

in this FM there is no Exception parameter maintained , but explicitly maintained like

CALL FUNCTION 'SD_PURCHASE_CHANGE_ORDER'
TABLES
I_VBEPEK = I_VBEPEK
EXCEPTIONS
error_message = 1
others = 2.

How this works.

2)inside the fm ther is another FM

if da_poupd eq space.
call function 'SD_SALES_DOCUMENT_READ'
exporting
document_number = i_vbepek-vbeln
call_active = activity_purchase
i_no_authority_check = charx
exceptions
error_message = 01.
da_subrc = sy-subrc.
if da_subrc ne 0.
da_msgid = sy-msgid.
da_msgno = sy-msgno.
message e227(v2) with i_vbepek-vbeln da_msgid da_msgno. """"No raising here
endif.
endif.

Now the case is if i remove exception in 'SD_PURCHASE_CHANGE_ORDER'if sy-subrc ne 0 it thro's the error "message e227(v2) with i_vbepek-vbeln da_msgid da_msgno." but if i maintain exception system not throwing error though there is no RAISING clause ..How it works..

1 REPLY 1

raymond_giuseppi
Active Contributor

Read the online documentation for ERROR_MESSAGE and OTHERS for statement CALL FUNCTION option EXCEPTIONS.