SAP FUNCTIONS EXPRESSIONS

Get Example source ABAP code based on a different SAP table
  


ARTICLE

Functions and Expressions for Operand Positions
ITOC

Writer Positions
Expressions that can be specified in writer positions are
Declaration expressions
... DATA(...) ...
... FIELD-SYMBOL(...) ...
Writable expressions
The constructor expressions NEW class( ... )->attr and CAST type( ... )->dobj
Table expressions itab[ ... ] and their chainings

Reader Positions
Functions that can be specified in reader positions are
Predefined functions

... func( arg ) ...
... func( val = arg p1 = arg1 p2 = arg2 ... ) ...

Functional methods

... meth( ) ...
... meth( a ) ...
... meth( p1 = a1 p2 = a2 ... ) ...
... meth( [EXPORTING p1 = a1 p2 = a2 ...]
[IMPORTING p1 = a1 p2 = a2 ...]
[CHANGING p1 = a1 p2 = a2 ...] ) ...

Method chaining

Chained method call:

... ...->meth1( ... )->meth2( ... )->...->meth( ... ) ...

Chained attribute access:

... ...->meth1( ... )->meth2( ... )->...->attr ...

Expressions that can be specified in reader positions are

Calculation expressions:
Arithmetic expressions

... arith_exp ...

Bit expressions

... bit_exp ...

String expressions

... string_exp ... Constructor expressions:
Instance operator

NEW

Value operator

VALUE

Reference operator

REF

Lossless operator

EXACT

Conversion operator

CONV

Casting operator

CAST

Notes
Functions with numeric return values and arithmetic expressions are combined in numeric expressions.
Functions with character-like return values and string expressions are combined as character-like expressions.
Functions with a byte-like return values and bit expressions are combined as byte-like expressions .

Example
Numeric expression as an index specified for an internal table. DATA: itab TYPE STANDARD TABLE OF i,
wa LIKE LINE OF itab,
n TYPE i.

...

READ TABLE itab • lines( itab ) - n
INTO wa.