ABAPASSIGN - ASSIGNPERFORM Short Reference ROGBILLS - Synchronize billing plans
This documentation is copyright by SAP AG.
This statement assigns the memory area specified using mem_area to the field symbol <fs>. A data object or a memory area calculated from the address of a data object can be assigned. After the assignment, the field symbol refers to the assigned memory area and can be used in operand positions. When used in a statement, it behaves like a dereferenced data reference, meaning that the statement works with the content of the memory area.
The following can be specified for <fs>:
An existing field symbol with appropriate typing.
An inline declaration FIELD-SYMBOL(<fs>).
The typing depends on the mem_area specified.
The data type with which the assigned memory area is handled depends on what is specified in casting_spec. Either an explicit casting can be performed or the field symbol uses the data type of the data object specified in the assignment. In both cases, the data type used must match the typing of the field symbol. A field symbol to which a memory area is assigned, has this data type after the assignment and behaves like a data object of this type.
The assigned memory area mem_area must be at least as long as the data type specified in casting_spec and must have at least the same alignment. If the data type determined in casting_spec is deep, the deep components with their type and position must appear in the assigned memory area exactly like this.
The information in range_spec is used to define the memory area that can be assigned to the field symbol.
The return value is set only for the dynamic variants and the table expression variant of mem_area. If the constructor operator NEW is used as a writable expression, this operator sets the return value.
|4||Assignment not completed.|
|8||A table expression was not assigned.|
If a dynamic assignment or assignment of a table expression could not be performed, the field symbol
keeps its previous state. If the static assignment could not be performed, a memory is not assigned to the field symbol after the statement ASSIGN and the assignment can be checked with the
IS ASSIGNED. If an assignment were to produce illegal memory accesses, an exception is raised in the case of both static and dynamic ASSIGN statements.
If field symbols are set using ASSIGN, permission to access the assigned data object is only
checked at the position of the statement. The field symbol can then be passed on as required and used
to access the assigned data object in any position. To prevent access to private and read-only attributes
using field symbols outside classes, field symbols for these attributes should not be published externally. A constant or read-only input parameter, however, can never be made modifiable by passing a field symbol.
One obsolete form of the statement ASSIGN is ASSIGN LOCAL COPY.
Three field symbols are assigned the subfields for year, month, and day of the system field sy-datlo. The subfields can then be addressed using field symbols.
FIELD-SYMBOLS <year> TYPE n.
FIELD-SYMBOLS <month> TYPE n.
FIELD-SYMBOLS <day> TYPE n.
ASSIGN sy-datlo+0(4) TO <year>.
ASSIGN sy-datlo+4(2) TO <month>.
ASSIGN sy-datlo+6(2) TO <day>.
)->display( <day> ).
- Cause: The type of the source field and the target type do not exactly match in offset and type in those components that are strings, tables, or references.
Runtime Error:ASSIGN_CASTING_ILLEGAL_CAST (catchable)
- Cause: A type specified dynamically after CASTING is unknown.
Runtime Error:ASSIGN_CASTING_UNKNOWN_TYPE (catchable)
- Cause: The data object in addition RANGE does not contain the assigned data object.
Runtime Error:ASSIGN_FIELD_NOT_IN_RANGE (catchable)
- Cause: The field symbol is structured and the assigned field is shorter than the structure.
- Cause: The alignment for field f is too short for the type of the field symbol.
- Cause: For TYPE, you can specify only simple types.
- Cause: The source field is longer than 16 bytes and can, therefore, not be interpreted as a type p field.
- Cause: The alignment of field f is too short for the type specified at TYPE.
- Cause: The length of field f does not match the type specified in TYPE.
- Cause: The type specified at TYPE is unknown.
- Cause: Only up to 14 decimal places are allowed.
- Cause: Decimal places are allowed only for type p.
- Cause: For field f, a length of 0 was specified.
- Cause: For field f, a length less than 0 was specified.
- Cause: For field f, an offset less than 0 was specified.
- Cause: For field f, offset or length was specified and
the data type of the assigning field does not allow partial access. (This is the case for data types I, F, and P.)
- Cause: The offset specified for field f exceeds the range of the ABAP variable.
- Cause: In the area addressed in the offset and length specifications
for field f, deep components exist (data references, object references, strings, internal tables), which may not be overwritten.
- Cause: Offset and length specified for field f exceed the range of the ABAP variable.
- Cause: Field f is not a data reference. However, a data reference was expected.
- Cause: The type of the source field and the target type do not match exactly in offset and type in those components that are strings, tables, or references.
- Cause: You cannot assign substrings to a field symbol.
- Cause: The field symbol is typed and the type of the assigned field is incompatible to it.
- Cause: The type of the source field contains strings, tables, or references.
- Cause: The type of the source field is a structure and, under Unicode, not compatible to the target type.
RFUMSV00 - Advance Return for Tax on Sales/Purchases Vendor Master (General Section)
This documentation is copyright by SAP AG.
Length: 13773 Date: 20200129 Time: 124655 sap01-206 ( 114 ms )
Looking for Support? Questions?
Leave us your contact details and we will call you back. Panels marked with * are mandatory.