2018 May 27 1:46 PM
Hi All,
I am trying to assign a simple fields symbol as follows:
FIELD-SYMBOLS: <l_area> TYPE any.
ASSIGN COMPONENT 'CO_AREA' OF STRUCTURE e_th_chas TO <l_area> .
LOOP AT lt_range INTO ls_range.
IF ls_range-chanm = '0CO_AREA'.
Move ls_range-low(4) to <l_area> .
ENDIF.
ENDLOOP.
I have also tried to write the Assign statement inside the loop but in both cases i am getting GETWA_NOT_ASSIGNED error.
Please help to identify what is wrong in the code.
Thanks,
AG
Hi All,
I am trying to assign a simple fields symbol as follows:
FIELD-SYMBOLS: <l_area> TYPE any.
ASSIGN COMPONENT 'CO_AREA' OF STRUCTURE e_th_chas TO <l_area> .
LOOP AT lt_range INTO ls_range.
IF ls_range-chanm = '0CO_AREA'.
Move ls_range-low(4) to <l_area> .
ENDIF.
ENDLOOP.
I have also tried to write the Assign statement inside the loop but in both cases i am getting GETWA_NOT_ASSIGNED error.
Please help to identify what is wrong in the code.
Thanks,
AG
2018 May 27 1:49 PM
2018 May 27 3:23 PM
If E_TH_CHAS is a hashed table, you can't use
ASSIGN COMPONENT 'CO_AREA' OF STRUCTURE e_th_chas ...
of course. Should give a syntax error or it is a table with an obsolete header line. Then, the header line seems not to have such a component. More cannot be said from the code snippet.
Since you use dynamic ASSIGN, you must debug to find the error. It cannot be seen from the code.
And by the way, never forget checking sy-subrc after dynamic ASSIGN!
And why do you use dynamic ASSIGN at all? Static ASSIGN would be sufficient in the code shown.