11-16-2015 12:29 PM
Hi gurus,
I am executing one query I have designed, however, when in SQ01 I get the message "Field symbol has not been assigned".
I have reviewed other posts with the same problem but the issue is still there.
Could you please guide to get a solution? Please check the image attached.
Thanks,
Kind regards,
11-16-2015 12:35 PM
11-16-2015 12:41 PM
Could you please put the check with more details?
Thanks a lot,
Regards,
11-16-2015 12:57 PM
Hi John Smith,
looks like your structure <fs_lin> has no field named Z_RESULT. sy-subrc after assign statement should be 4 and that leads to the error that <fs_val> is not assigned.
regards
Stefan Seeburger
11-16-2015 1:01 PM
Hi Stefan,
Thanks for your reply again. I have variable Z_RESULT defined in the InfoSet.
Please check image attached.
Kind regards,
11-16-2015 1:18 PM
Hi John,
but are you sure that <fs_lin> is assigned correctly? Check the components of structure <fs_lin> in debugger to see its available components.
Regards,
Klaus
11-16-2015 1:00 PM
Hi John,
what's the type of l_fieldnm? If it is a character type, then its content will be checked for a component name. If it's a numeric type, it will be checked for a component position.
If the component name is not matching or the component number does not exist, the ASSIGN will not be successful, which will cause your issue.
Regards,
Klaus
11-16-2015 1:02 PM
Hi Klaus,
the field name is defined as l_fieldnm(10) type c meanwhile the Z_RESULT is character of long 60.
Any idea?
Kind regards,
11-16-2015 1:08 PM
Hi John,
Is 'Z_RESULT' a valid component name of the structure <fs_lin>?
Regards,
Klaus
11-16-2015 1:13 PM
Hi Klaus,
I defined field Z_RESULT in the details of the Infoset. Please check image attached.
Kind regards,
11-16-2015 1:01 PM
Hi John,
1. Please have Sy-subrc check after 'Assign component' statement
2. Please pass some value for 'Z_RESULT' and then check
Cheers,
Kripa Rangachari.
11-16-2015 1:09 PM
Hi Kripa,
Thanks for your message. I have tried what you recommeded and the error now is that the field is completely empty.
11-16-2015 1:21 PM
Hi John
Could you use if <your field simbol> is assigned before use the field symbol.
if you want to know why didnt is assigned you need check if hava data and the field symbol types is compatible.. ( type any....anytable.....)
Hope helepd you.
11-16-2015 1:27 PM
Hi Ronaldo,
The types are character for the field symbol and the data (field Z_RESULT), what else can be happening?
Thanks a lot,
Kind regards,
11-16-2015 1:49 PM
did you check for simple things like the code your executing is your actual code? close/open your programm to load recent changes.
LG
Stefan Seeburger
11-16-2015 1:52 PM
also please add the screenshot what that structure <FS_LIN> looks like in your debugger !!
11-16-2015 6:58 PM
Hi John,
Try this abap code
assign component (l_fieldnm) of structure <fs_lin> to <fs_val>.
<fs_val> = 'Hola'.
Regards
11-17-2015 3:48 PM
Hi John,
you have been directed to the most probable reason of your Problem twice now.
Both, Klaus and Stefan have pointed you towards it.
The crucial thing is, whether <fs_lin> is assigned AND what the assigned structure looks like.
None of your snippets or screenshots shed any light on this.
Where do you actually assign <fs_lin> and to what.
If <fs_lin> is not assigned correctly, your assignment of any of its components is bound to fail.
The same holds true, if <fs_lin> is assigned, but the referred structure does not contain a component named 'Z_RESULT'.
Since you haven't shared that crucial bit of your code, you're on your own there, until you do.
Best regards - Jörg