2013 Nov 25 2:56 PM
Hi Everyone ,
I am getting a dump 'Field symbol has not yet been assigned' while accessing a smartform. When i debug the smartforms ,though i have used the assign statement it is not assigning the value to the field symbol.Please refer to the snapshot.
I have assigned the field symbol at line 842 and it is throwing error at line 845 as described earlier.
BR.
2013 Nov 25 3:44 PM
Hello Giri,
in the line 841 you are calculating a string that holds the name of the field:
CONCATENATE 'LV_' <fs_laytext>-text_id '_ID' INTO lv_field.
Then, in line 842, you assign the field with this name (the name calculated in lv_field variable) of the loop structure to the field symbol.
This assignment may be wrong if the structure you are looping at does not include any field with the name that holds "lv_field" variable value.
For example, if lv_field = 'LV_MYFIELD_ID' and your looping structure does not include any field with this name, the assigment in line 842 will be erroneous and the assignment will fail; this will cause a fatal error then in line 845 because <fs_field> is not assigned to any data object and the statement cannot write any value referenced by this alias.
If you can debug, check assigments at line 842, or think about the values you are getting in line 842 that maybe does not exist as fields in the structure. Also, as the other colleagues have said, check "sy-subrc" after line 842 to check if the assignment have been correct; if not, do not try to put any value to field symbol <fs_field> (as in line 845).
Hope it helps,
David
2013 Nov 25 3:06 PM
HI GIRI
Show the declarations os field symbols.
Please.
Thanks.
2013 Nov 25 3:19 PM
Hi Ronaldo ,
field-symbols: ,
<fs_laytext> type ykwsd_laytext,
<fs_laylabels> type ykwsd_laylabel,
<fs_laylabelp> type ykwsd_laylabel,
<fs_field>,
<fs_fields>,
<fs_fieldl>,
<fs_struct>.
data: lv_field type string,
lv_fieldl type string,
lv_struct type string,
lv_layout type ykwsd_layout.
BR.
2013 Nov 25 3:26 PM
Hi,
I can see from the screenshot of your debugger that SY-SUBRC is set to 4. This means that the instruction to assign fieldsymbol <fs_struct> failed. You should check the content of the variable lv_struct and see if it is what you waited to have in it.
Martin
2013 Nov 25 3:34 PM
Always check your sy-subrc.
for example:
ASSIGN ... TO <fs>.
IF sy-subrc = 0.
...
ENDIF.
2013 Nov 25 3:44 PM
Hello Giri,
in the line 841 you are calculating a string that holds the name of the field:
CONCATENATE 'LV_' <fs_laytext>-text_id '_ID' INTO lv_field.
Then, in line 842, you assign the field with this name (the name calculated in lv_field variable) of the loop structure to the field symbol.
This assignment may be wrong if the structure you are looping at does not include any field with the name that holds "lv_field" variable value.
For example, if lv_field = 'LV_MYFIELD_ID' and your looping structure does not include any field with this name, the assigment in line 842 will be erroneous and the assignment will fail; this will cause a fatal error then in line 845 because <fs_field> is not assigned to any data object and the statement cannot write any value referenced by this alias.
If you can debug, check assigments at line 842, or think about the values you are getting in line 842 that maybe does not exist as fields in the structure. Also, as the other colleagues have said, check "sy-subrc" after line 842 to check if the assignment have been correct; if not, do not try to put any value to field symbol <fs_field> (as in line 845).
Hope it helps,
David