06-20-2007 1:15 PM
The error is this:
Field symbol has not yet been assigned.
Error in the ABAP Application Program
The current ABAP program "SAPLSLVC" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
When I want to display the data with alav grid, I could not achieve it and got the error described above.
What is the cause of this problem?
Thanks.
06-20-2007 2:32 PM
Hi,
I had got the same problem previously. It is the problem with incorrect assignment. I had changed the code as below:
REPORT ZYKTEST3 .
DATA: d_ref TYPE REF TO data,
d_ref2 TYPE REF TO data,
i_alv_cat TYPE TABLE OF lvc_s_fcat,
ls_alv_cat LIKE LINE OF i_alv_cat.
TYPES: tabname LIKE dcobjdef-name ,
fieldname LIKE dcobjdef-name,
desc LIKE dntab-fieldtext.
PARAMETER: p_tablen TYPE tabname.
DATA: BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE dntab.
DATA: END OF itab.
FIELD-SYMBOLS : <f_fs> TYPE table,
<f_fs1> TYPE table,
<f_fs2> TYPE ANY,
<f_fs3> TYPE ANY,
<f_fs4> type any,
<f_field> TYPE ANY.
REFRESH itab.
CALL FUNCTION 'NAMETAB_GET'
EXPORTING
langu = sy-langu
tabname = p_tablen
TABLES
nametab = itab
EXCEPTIONS
no_texts_found = 1.
LOOP AT itab .
ls_alv_cat-fieldname = itab-fieldname.
ls_alv_cat-ref_table = p_tablen.
ls_alv_cat-ref_field = itab-fieldname.
ls_alv_cat-seltext = itab-fieldtext.
ls_alv_cat-reptext = itab-fieldtext.
APPEND ls_alv_cat TO i_alv_cat.
ENDLOOP.
internal table build
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = i_alv_cat
IMPORTING
ep_table = d_ref.
ASSIGN d_ref->* TO <f_fs>.
DATA: l_field TYPE fieldname,
l_field1 type fieldname.
SELECT * FROM (p_tablen) INTO CORRESPONDING FIELDS OF TABLE <f_fs>.
LOOP AT <f_fs> ASSIGNING <f_fs2>.
ASSIGN COMPONENT 2 OF STRUCTURE <f_fs2> TO <f_fs3>.
ASSIGN COMPONENT 3 OF STRUCTURE <f_fs2> TO <f_fs4>.
IF sy-subrc = 0.
MOVE <f_fs3> TO l_field.
MOVE <f_fs4> TO l_field1.
WRITE:/1 l_field(20),
22 l_field1(10).
ENDIF.
ENDLOOP.
Regards
Kannaiah
06-20-2007 1:19 PM
Hi
That dump is usually triggered when something of the ALV structures is wrong.
U should check how you fill the catalog table.
Max
06-20-2007 2:17 PM
Hi,
As correctly pointed out by the previous post, Problem will definately be with the fieldcatalog. Please check the fieldname defined in fieldcatalog & internal table are matching. Please also note that in field catalog field names MUST BE in CAPITALS.
I still your problem is not solved follow the followinf procedure to fix the problem.
Suppose you have got 5 fields which you are dispalying in ALV then comment out fieldcatalog enteries of 4 fields & check. If you do not get the dump that implies this field is OK. Now uncomment the fieldcatalog enteries of the second field & check if you get a dump. If no follow the same procedure with the remaining field till you get a dump. Rest is easy. In case you have got lot of fields you may use the above approach with a group of say 5 to 7 fields, & once group is fixed follow the above procedure to fix the field.
I hope this helps,
Regards
Raju Chitale
12-13-2013 10:55 AM
Thanks for your explanation.. It was useful to me. My fieldname was in lowercase;
06-20-2007 2:21 PM
Field catalog is used to display report data in output of alv, Fcat will creates columns in ALV.
when u are calling REusealvhere u have a option to call Fcat as a export parameter.
<b> fcat-fieldname = 'FDTM'.
fcat-hotspot = ' '.
fcat-no_zero = 'X'.
fcat-just = 'R'.
fcat-seltext_l = 'Filler D/T'.
fcat-ddictxt = 'L'.
fcat-inttype = 'P'.
fcat-datatype = 'QUAN'.
append fcat.
clear fcat.</b>
<b>call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = lv_repid
i_callback_user_command = 'Z_USER_COMMAND'
is_layout = fs_layo
it_fieldcat = fcat[]
it_sort = fsort[]
I_CALLBACK_PF_STATUS_SET = g_statu_07
i_default = 'X'
i_save = 'U'
it_events = fevents[]
tables
t_outtab = itab_order2[].</b>
Regards
Peram
06-20-2007 2:24 PM
Hi,
I think that you have provided incomplete fieldcatalog information for your ALV .
Try to use function modules to build field catalog instead of doing mannually.
REUSE_ALV_FIELDCATALOG_MERGE (Using REUSE* fm)
LVC_FIELDCATALOG_MERGE (Using OOp)
aRs
06-20-2007 2:32 PM
Hi,
I had got the same problem previously. It is the problem with incorrect assignment. I had changed the code as below:
REPORT ZYKTEST3 .
DATA: d_ref TYPE REF TO data,
d_ref2 TYPE REF TO data,
i_alv_cat TYPE TABLE OF lvc_s_fcat,
ls_alv_cat LIKE LINE OF i_alv_cat.
TYPES: tabname LIKE dcobjdef-name ,
fieldname LIKE dcobjdef-name,
desc LIKE dntab-fieldtext.
PARAMETER: p_tablen TYPE tabname.
DATA: BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE dntab.
DATA: END OF itab.
FIELD-SYMBOLS : <f_fs> TYPE table,
<f_fs1> TYPE table,
<f_fs2> TYPE ANY,
<f_fs3> TYPE ANY,
<f_fs4> type any,
<f_field> TYPE ANY.
REFRESH itab.
CALL FUNCTION 'NAMETAB_GET'
EXPORTING
langu = sy-langu
tabname = p_tablen
TABLES
nametab = itab
EXCEPTIONS
no_texts_found = 1.
LOOP AT itab .
ls_alv_cat-fieldname = itab-fieldname.
ls_alv_cat-ref_table = p_tablen.
ls_alv_cat-ref_field = itab-fieldname.
ls_alv_cat-seltext = itab-fieldtext.
ls_alv_cat-reptext = itab-fieldtext.
APPEND ls_alv_cat TO i_alv_cat.
ENDLOOP.
internal table build
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = i_alv_cat
IMPORTING
ep_table = d_ref.
ASSIGN d_ref->* TO <f_fs>.
DATA: l_field TYPE fieldname,
l_field1 type fieldname.
SELECT * FROM (p_tablen) INTO CORRESPONDING FIELDS OF TABLE <f_fs>.
LOOP AT <f_fs> ASSIGNING <f_fs2>.
ASSIGN COMPONENT 2 OF STRUCTURE <f_fs2> TO <f_fs3>.
ASSIGN COMPONENT 3 OF STRUCTURE <f_fs2> TO <f_fs4>.
IF sy-subrc = 0.
MOVE <f_fs3> TO l_field.
MOVE <f_fs4> TO l_field1.
WRITE:/1 l_field(20),
22 l_field1(10).
ENDIF.
ENDLOOP.
Regards
Kannaiah
12-29-2014 1:33 PM
Hi,
Change the field name in ALV field category into caps.
Example:
wa_alv_fieldcat-fieldname = 'object_id'
INTO
wa_alv_fieldcat-fieldname = 'OBJECT_ID'