Pages

Wednesday, July 10, 2013

Dynamic field symbol

*DATA: v_string TYPE string VALUE '(SAPFP50M)PS'.
DATA: v_string TYPE string VALUE '(SAPFP50M)PS[]'." has to be done this way as PS is table with header line
TYPES: BEGIN OF ty_ps.
        INCLUDE STRUCTURE prelp AS prelp.
TYPES:   opera,
        auth.
TYPES: END OF ty_ps.

TYPES: ty_t_ps TYPE STANDARD TABLE OF ty_ps.

FIELD-SYMBOLS: TYPE ty_t_ps,
                      TYPE ty_ps.

ASSIGN (v_string) TO .

LOOP AT ASSIGNING WHERE infty EQ '0210'.
   -begda = sy-datum.
ENDLOOP.