ABAPASSIGN_COMPONENT - ASSIGN COMPONENT
TXBHW - Original Tax Base Amount in Local Currency RFUMSV00 - Advance Return for Tax on Sales/PurchasesThis documentation is copyright by SAP AG.
ASSIGN COMPONENT
Variant 2
ASSIGN COMPONENT idx OF STRUCTURE struc TO <fs>.
ASSIGN COMPONENT name OF STRUCTURE struc TO <fs>.
Additions
1. ... CASTING ... or
2. ... TYPE type
3. ... DECIMALS dec
4. ... RANGE r
Effect
If the field name or idx has the type C or is a substructure that does not contain aninternal table, it is regarded as a component name, otherwise is is regarded as a component number.The corresponding component of the structured field struc is assigned to the field symbol <fs>.
Return Value
- SY-SUBRC = 0:
- Assignment successful.
- SY-SUBRC = 4:
- The system could not assign the field to the field symbol.
Note
If idx has the value 0, the entire structure is assigned to the field symbol.
- Before Release 6.10, assigning structure components to field symbols was the only way of accessing componentsof formal parameters or field symbols if these were typed unstructured. Since Release 6.10, you canalso specify componenents of unstructured typed field symbols and formal parameters. when specifying a data object dynamically.
Example
PROGRAM P1MAIN.
DATA: BEGIN OF STR,
A VALUE 'a',
B VALUE 'b',
C VALUE 'c',
D VALUE 'd',
END OF STR,
CN(5) VALUE 'D'.
FIELD-SYMBOLS <FS> TYPE ANY.
DO 3 TIMES.
ASSIGN COMPONENT SY-INDEX OF
STRUCTURE STR TO <FS>.
IF SY-SUBRC <> 0. EXIT. ENDIF.
WRITE <FS>.
ENDDO.
ASSIGN COMPONENT CN OF STRUCTURE STR TO <FS>.
WRITE <FS>.
Output: a b c d
Exceptions
For more information on the exceptions that can be raised by the ASSIGN statement, see ASSIGN Exceptions.
Related
Additional help
Assigning Data Objects to Field Symbols
PERFORM Short Reference RFUMSV00 - Advance Return for Tax on Sales/Purchases
This documentation is copyright by SAP AG.
Length: 3844 Date: 20120518 Time: 191946 triton ( 114 ms )






