Skip to Content

Field symbol is not getting assigned

Jan 12 at 07:22 AM


avatar image

We have following code:

DATA: l_search_fields TYPE adsrchline,
im_t_search_fields TYPE TABLE OF adsrchline,
l_fieldname TYPE dynfnam.

** Field Symbols
FIELD-SYMBOLS: <fs_fieldname> TYPE ANY.

LOOP AT im_t_search_fields INTO l_search_fields.
CONCATENATE 'ex_match_struc-'
INTO l_fieldname.
ASSIGN (l_fieldname) TO <fs_fieldname>.
MOVE l_search_fields-content TO <fs_fieldname>.

For 20 millions records above code worked fine but after that it gave dump 'GETWA_NOT_ASSIGNED' at MOVE command. Please help me to solve this as I am clueless why it worked earlier and now it is giving dump.

10 |10000 characters needed characters left characters exceeded

Please edit your code by using the button CODE. It's difficult to read it. Thanks.


I think the answer has been given below, so I'm closing this question.

* Please Login or Register to Answer, Follow or Comment.

3 Answers

Raymond Giuseppi
Jan 12 at 10:24 AM

Use a more 'solid' code like

LOOP AT im_t_search_fields INTO l_search_fields.
  ASSIGN COMPONENT l_search_fields-fieldname OF STRUCTURE ex_match_struc TO <fs_fieldname>.
    MESSAGE e207(/bobf/conf) WITH l_search_fields-fieldname 'EX_MATCH_STRUC'.
    " Field &1 of value set is not part of structure of &2
    MOVE l_search_fields-content TO <fs_fieldname>.

then look for any recent change in program or ddic structure?

Hint: If the exported structure is actually dynamic use cl_abap_structdescr or similar class to provide more information, like ddic structure name.

Show 5 Share
10 |10000 characters needed characters left characters exceeded

Thanks for the solution.

I tried with code provided by you but 'ex_match_struc-' is a string. So, when I am trying to write your code it is giving me error that ex_match_struc- not found.

It is like I have concatenated string with a variable and then trying to assign this concatenated value to field symbol.

Kindly guide me.


Check your code. Raymond wrote

...OF STRUCTURE ex_match_struc TO...

You appear to have written

...OF STRUCTURE ex_match_struc- TO...

It seems you do not really understand what your code does.

Matthew Billingham

To avoid handwriting errors, use the Copy and Paste functions. You may even use the keyboard shortcuts Ctrl+C and Ctrl+V to go faster.


It's actually irrelevant in this case why this worked before and stopped working. It was poorly written code to begin with. We can't just say ASSIGN and not check if it actually happened ("assumption is mother of all screw-ups"), not to mention ASSIGN COMPONENT has been around for ages already.

Don't be like the person who wrote that code and read ABAP documentation. There are examples available of the proper use of ASSIGN. There are also many SCN blogs and Q&A on this subject, one recent blog example can be found in Google.


If ex_match_struc is a type TYPE STRING then your code make no sense for me (no subfield) Also the text 'ex_match_struc-' doesn't appear in my snippet (trailing '-' and quotes ?)

Nevertheless, try to check the IS ASSIGNED status of the field symbol in your original program...

Mike Pokraka Jan 12 at 10:15 AM

Firstly, please use the code formatting ("CODE" button) when posting code. It makes code look like code and much easier to read.

The error is telling you that l_fieldname did not get assigned. Please review the contents of your other variables, they should be listed in the dump.

10 |10000 characters needed characters left characters exceeded
Simone Milesi Jan 12 at 10:23 AM

It seems to me pretty easy: structure ex_match_struc- doesn't contain a certain field listed in the table im_t_search_fields.

Avoiding it's easy too: just check your assign has worked otherwise handle the error.

10 |10000 characters needed characters left characters exceeded