sapdev logo background
sapdev logo sapdev logo
Comments

ABAP CALL FUNCTION EXC SHORT FORM Statement syntax, information and example SAP source code



Return to Statement index



CALL FUNCTION EXCEPTIONS - Short Form
ABAP Syntax(Obsolete) CALL FUNCTION func ...
EXCEPTIONS exc1 exc2 ...

What does it do? 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 listed after EXCEPTIONS that is not assigned to an explicit return code using = is given the value 1 implicitly.
Latest 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 ABAP Coding The syntax of the following function module call is correct, but can have unpredictable 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, then this call will almost certainly not catch any exceptions, even though it is intended to catch every exception.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




CALL_FUNCTION_DYNAMIC
CALL_FUNCTION_GENERAL




comments powered by Disqus