Skip to Content
-1

Exception handling in FM

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..

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 22, 2017 at 01:39 PM

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

    Add comment
    10|10000 characters needed characters exceeded