Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Get values of Field symbol type any

former_member2492
Active Participant
0 Kudos

I have the following loop:

    FIELD-SYMBOLS: <fs_data> type any,
<gt_data> type standard table
LOOP AT <gt_data> ASSIGNING <fs_data>.
ENDLOOP.

How can I get the values

in <fs_data> and append them to an internal table?

1 ACCEPTED SOLUTION

emanuel_klenner
Active Participant
You can do one of the following. 
FIELD-SYMBOLS: <LV_ANY> TYPE ANY
<LV_MATNR> TYPE MATNR.
a) DO. ASSIGN component sy-index of structure <fs_data> to <LV_ANY>.
IF SY-SUBRC IS NOT INITIAL.
EXIT.
ENDIF.
ENDDO.
b) ASSIGN COMPONENT 'MATERIAL_CODE' of structure <fs_data> to <LV_MATNR>>
2 REPLIES 2

Sandra_Rossi
Active Contributor

"ASSIGN COMPONENT 1 OF STRUCTURE ..." Search the ABAP documentation and forum for more details.

emanuel_klenner
Active Participant
You can do one of the following. 
FIELD-SYMBOLS: <LV_ANY> TYPE ANY
<LV_MATNR> TYPE MATNR.
a) DO. ASSIGN component sy-index of structure <fs_data> to <LV_ANY>.
IF SY-SUBRC IS NOT INITIAL.
EXIT.
ENDIF.
ENDDO.
b) ASSIGN COMPONENT 'MATERIAL_CODE' of structure <fs_data> to <LV_MATNR>>