Application Development and Automation 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: 
Read only

Field Symbol Assignment not working

amrita_goswami
Participant
0 Likes
1,980

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

2 REPLIES 2
Read only

amrita_goswami
Participant
0 Likes
981

E_TH_CHAS is a hashed table in the above example.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
981

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.