SAP BUILT IN FUNCTIONS - Syntax



Get Example source ABAP code based on a different SAP table
  


• ( ) ABAP_BUILTIN_FUNCTION

Built-In Functions, Syntax
ITOC
In functions with named arguments, there is usually a main argument val and the option of specifying further arguments, some of which are optional. The following sections show the general syntax for calling built-in functions.

Functions with an Unnamed Argument

ABAP_SYNTAX
... func( arg ) ...
In functions with an unnamed argument, the syntax is the same as the syntax for calling functional methods with one input parameter. func is the built-in function and the argument arg is an operand whose data type matches the function. The blanks after the opening parentheses and before the closing parentheses are relevant.
BEGIN_SECTION SAP_INTERNAL_HINT
Undocumented feature: The spaces after the opening and before the closing bracket can be omitted if the argument is a text literal within quotes.
END_SECTION SAP_INTERNAL_HINT

ABAP_EXAMPLE_VX5
The built-in function line_exists has an unnamed argument that expects a table expression.
ABEXA 00842
ABAP_EXAMPLE_END

Functions with Named Arguments

ABAP_SYNTAX
... func( val = arg p1 = arg1 p2 = arg2 ... ) ...
Functions with one or more named arguments are bound to keyword parameters in the same way as when functional methods are called with multiple input parameters. Operands can be specified for the arguments whose data type matches the corresponding parameter. The blanks after the opening parentheses and before the closing parentheses are relevant. If such a function has only one argument, or if only the main argument is to be supplied, the syntax can be simplified as follows:
... func( arg ) ...
BEGIN_SECTION SAP_INTERNAL_HINT
Undocumented feature: The space before the closing bracket can be omitted if the last argument is a text literal within quotes.
END_SECTION SAP_INTERNAL_HINT

ABAP_EXAMPLE_VX5
The built-in function condense has named arguments and can, for example, be called as follows.
ABEXA 00843
ABAP_EXAMPLE_END