ABAP Keyword Documentation → ABAP − Reference → ABAP Syntax → ABAP Statements → Operands → Functions and Expressions in Operand Positions → Operand Positions for Functions and Expressions → Writing Positions for Functions and Expressions
Declaration Positions
Declaration positions are writing-only positions in which a declaration expression can be specified for an inline declaration. There are no declaration positions within expressions.
The following declaration positions are possible:
- Positions for the inline declaration of variables with
DATA(var)
. These are the following writer positions, where the operand type can be determined in full and where the content of the operand is completely overwritten but not evaluated.
- Left side of an assignment with the assignment operator
=
lhs = ...
- Actual parameters for output parameters and return values of methods for standalone method calls:
meth( IMPORTING p1 = a1 p2 = a2...
RECEIVING r = a )
If a method call is on the right side of an assignment or is part of an expression, these actual parameters are not declaration positions.
- Target fields in statements for string processing and byte string processing:
FIND ... MATCH COUNT mcnt
MATCH OFFSET moff
MATCH LENGTH mlen
RESULTS result_tab|result_wa
SUBMATCHES s1 s2 ...
REPLACE ... REPLACEMENT COUNT rcnt
REPLACEMENT OFFSET moff
REPLACEMENT LENGTH mlen
RESULTS result_tab|result_wa
CONCATENATE ... INTO result
SPLIT ... INTO result1 result2 ...
INTO TABLE result_tab
CONVERT TEXT ... INTO SORTABLE CODE hex
GET BIT ... INTO val
.
- Target fields in statements for time stamps:
CONVERT UTCLONG ... INTO DATE dat TIME tim DAYLIGHT SAVING TIME dst
CONVERT ... INTO UTCLONG time_stamp
GET TIME STAMP time_stamp
CONVERT TIME STAMP ... INTO DATE dat TIME tim DAYLIGHT SAVING TIME dst
CONVERT ... INTO TIME STAMP time_stamp
- Target fields in statements for internal tables:
READ TABLE ... [REFERENCE] INTO dobj
LOOP AT ... [REFERENCE] INTO dobj
INSERT ... [REFERENCE] INTO dobj
COLLECT ... [REFERENCE] INTO dobj
APPEND ... [REFERENCE] INTO dobj
MODIFY ... [REFERENCE] INTO dobj
FIND ... IN TABLE MATCH COUNT mcnt
IN TABLE MATCH LINE mlin
IN TABLE MATCH OFFSET moff
IN TABLE MATCH LENGTH mlen
IN TABLE RESULTS result_tab|result_wa
IN TABLE SUBMATCHES s1 s2 ...
REPLACE ... IN TABLE REPLACEMENT COUNT rcnt
IN TABLE REPLACEMENT LINE rlin
IN TABLE REPLACEMENT OFFSET moff
IN TABLE REPLACEMENT LENGTH mlen
IN TABLE RESULTS result_tab|result_wa
- Target fields of the ABAP SQL statement
SELECT
:
SELECT ... INTO (elem1, elem2, ... )
SELECT ... INTO wa
SELECT ... INTO TABLE itab
- Target fields of the statement
DESCRIBE
:
DESCRIBE FIELD ... TYPE typ [COMPONENTS com] LENGTH ilen DECIMALS dec
OUTPUT-LENGTH olen HELP-ID hlp EDIT MASK mask
DESCRIBE TABLE ... KIND knd LINES lin OCCURS n
DESCRIBE DISTANCE ... INTO dst
- Target fields of various
GET
statements:
GET PARAMETER ... FIELD dobj
GET PF-STATUS status
GET REFERENCE INTO dref
GET RUN TIME FIELD rtime
GET TIME FIELD tim
- Work area in statement for dynpros:
LOOP AT SCREEN ... INTO wa
- Target field for message output:
MESSAGE ... INTO text
- Target fields in file interface statements:
READ DATASET ... LENGTH alen
GET DATASET ... POSITION pos ATTRIBUTES attr
- Target field for a serialization:
CALL TRANSFORMATION ... RESULT XML rxml
- All writing positions used when generating programs:
GENERATE GENERATE SUBROUTINE POOL ... NAME prog error_handling
- Positions for the inline declaration of field symbols with
FIELD-SYMBOL(<fs>)
. These are all places where a memory area can be assigned to a field symbol.
- Field symbol in the statement
ASSIGN
:
ASSIGN... TO <fs>
- Field symbols in statements for internal tables:
READ TABLE ... ASSIGNING <fs>
LOOP AT ... ASSIGNING <fs>
INSERT ... ASSIGNING <fs>
COLLECT ... ASSIGNING <fs>
APPEND ... ASSIGNING <fs>
MODIFY ... ASSIGNING <fs>
Other versions:
7.31 | 7.40 | 7.54
Note
Unlike in standalone method calls, in a functional method call inline declarations cannot be specified as actual parameters for output parameters.
Example
Declaration expression DATA
for declaring an internal table itab
after the addition
INTO TABLE
of a SELECT
statement.
SELECT *
FROM scarr
INTO TABLE @DATA(itab).