Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

ABAPCALL_FUNCTION_EXC_SHORT_FORM - CALL FUNCTION EXC SHORT FORM

ABAPCALL_FUNCTION_EXC_SHORT_FORM - CALL FUNCTION EXC SHORT FORM

BAL Application Log Documentation   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

CALL FUNCTION EXCEPTIONS, Short Form

CALL FUNCTION func ...
                   EXCEPTIONS exc1 exc2 ...


Effect

This short form for specifying non-class-based exceptions in the parameter list of the statement CALL FUNCTION is obsolete. It has the same effect as the following:

CALL FUNCTION func ...
                   EXCEPTIONS exc1 = 1
                              exc2 = 1
                              ...

Each exception specified after EXCEPTIONS that is not assigned to an explicit return code using = is assigned the value 1 implicitly.

Notes

  • This short form is extremely error-prone and should never be used.
  • Both the short form and the complete form can appear in a CALL FUNCTION statement.

Example

The syntax of the following function module call is correct but can have unexpected results.

CALL FUNCTION func EXCEPTIONS = 4.

The developer probably expected the following:

CALL FUNCTION func EXCEPTIONS OTHERS = 4.

The complete form of the statement is as follows, however:

CALL FUNCTION func EXCEPTIONS = = 1
                              4 = 1.

Since exceptions called "=" are not possible, and exceptions called "4" are unlikely, this call will almost certainly not catch any exceptions, even though it is designed to catch every exception.






CL_GUI_FRONTEND_SERVICES - Frontend Services   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 2538 Date: 20221203 Time: 165826     sap01-206 ( 28 ms )