2007 Dec 07 5:55 PM
Hi All,
When i tried to execute my program its giving me short dump "Field Symbol has not been yet assigned". I am using dynamic table to populate my final table. Here is my code:
CALL METHOD g_grid->set_table_for_first_display
CHANGING
it_outtab = <GT_TABLE>
it_fieldcatalog = gt_fldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4
This is my Dynamic table:
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
i_style_table =
it_fieldcatalog = gt_fldcat
i_length_in_byte =
IMPORTING
ep_table = gep_table
e_style_fname =
EXCEPTIONS
generate_subpool_dir_full = 1
others = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
ASSIGN gep_table->* TO <gt_table>.
Create dynamic work area and assign to FS
CREATE DATA gwa_line LIKE LINE OF <gt_table>.
ASSIGN gwa_line->* TO <gwa_table>.
ENDIF.
Building Final Internal Table for ALV Report
LOOP AT gt_amstatus INTO gwa_amstatus.
IF sy-tabix NE 1.
AT NEW posid.
APPEND <gwa_table> TO <gt_table>.
CLEAR <gwa_table>.
ENDAT.
ENDIF.
ASSIGN COMPONENT 'PROJECTNUMBER' OF STRUCTURE <gwa_table> TO <gfs_field>.
<gfs_field> = gwa_amstatus-posid.
ASSIGN COMPONENT 'CUSTOMERNAME' OF STRUCTURE <gwa_table> TO <gfs_field>.
<gfs_field> = gwa_amstatus-name1.
READ TABLE gt_fldcat INTO gwa_fldcat WITH KEY reptext = gwa_amstatus-usr01.
IF sy-subrc EQ 0.
ASSIGN COMPONENT gwa_fldcat-fieldname OF STRUCTURE <gwa_table> TO <gfs_field>.
<gfs_field> = gwa_amstatus-stat.
ENDIF.
ENDLOOP.
APPEND <gwa_table> TO <gt_table>.
My Field catalog is build as follows:
clear lwa_fldcat.
lwa_fldcat-col_pos = 1.
lwa_fldcat-fieldname = 'ProjectNumber' .
lwa_fldcat-datatype = 'C30'.
lwa_fldcat-reptext = 'Project Number'.
lwa_fldcat-inttype = 'C'.
lwa_fldcat-intlen = '30'.
APPEND lwa_fldcat TO gt_fldcat .
clear lwa_fldcat.
lwa_fldcat-col_pos = 2.
lwa_fldcat-fieldname = 'CustomerName' .
lwa_fldcat-datatype = 'C50'.
lwa_fldcat-reptext = 'Customer Name'.
lwa_fldcat-inttype = 'C'.
lwa_fldcat-intlen = '50'.
APPEND lwa_fldcat TO gt_fldcat .
LOOP AT lt_comp INTO lwa_comp.
CLEAR lwa_fldcat.
lv_opt = 'OPN'.
ADD 1 TO lv_count.
CONCATENATE lv_opt lv_count INTO lv_oper.
lwa_fldcat-col_pos = sy-tabix + 2.
lwa_fldcat-fieldname = lv_oper.
lwa_fldcat-datatype = 'C6'.
lwa_fldcat-reptext = lwa_comp-name.
lwa_fldcat-inttype = 'C'.
lwa_fldcat-intlen = '6'.
APPEND lwa_fldcat TO gt_fldcat .
CLEAR lv_opt.
ENDLOOP.
When i try to debug when calling class my final table <gt_table> is populated with the data and the filedcatalog is also build properly. I am confused whether this dump is due to my filedcatalog or dynamic table.
Any suggestions on this error.
Hi All,
When i tried to execute my program its giving me short dump "Field Symbol has not been yet assigned". I am using dynamic table to populate my final table. Here is my code:
CALL METHOD g_grid->set_table_for_first_display
CHANGING
it_outtab = <GT_TABLE>
it_fieldcatalog = gt_fldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4
This is my Dynamic table:
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
i_style_table =
it_fieldcatalog = gt_fldcat
i_length_in_byte =
IMPORTING
ep_table = gep_table
e_style_fname =
EXCEPTIONS
generate_subpool_dir_full = 1
others = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
ASSIGN gep_table->* TO <gt_table>.
Create dynamic work area and assign to FS
CREATE DATA gwa_line LIKE LINE OF <gt_table>.
ASSIGN gwa_line->* TO <gwa_table>.
ENDIF.
Building Final Internal Table for ALV Report
LOOP AT gt_amstatus INTO gwa_amstatus.
IF sy-tabix NE 1.
AT NEW posid.
APPEND <gwa_table> TO <gt_table>.
CLEAR <gwa_table>.
ENDAT.
ENDIF.
ASSIGN COMPONENT 'PROJECTNUMBER' OF STRUCTURE <gwa_table> TO <gfs_field>.
<gfs_field> = gwa_amstatus-posid.
ASSIGN COMPONENT 'CUSTOMERNAME' OF STRUCTURE <gwa_table> TO <gfs_field>.
<gfs_field> = gwa_amstatus-name1.
READ TABLE gt_fldcat INTO gwa_fldcat WITH KEY reptext = gwa_amstatus-usr01.
IF sy-subrc EQ 0.
ASSIGN COMPONENT gwa_fldcat-fieldname OF STRUCTURE <gwa_table> TO <gfs_field>.
<gfs_field> = gwa_amstatus-stat.
ENDIF.
ENDLOOP.
APPEND <gwa_table> TO <gt_table>.
My Field catalog is build as follows:
clear lwa_fldcat.
lwa_fldcat-col_pos = 1.
lwa_fldcat-fieldname = 'ProjectNumber' .
lwa_fldcat-datatype = 'C30'.
lwa_fldcat-reptext = 'Project Number'.
lwa_fldcat-inttype = 'C'.
lwa_fldcat-intlen = '30'.
APPEND lwa_fldcat TO gt_fldcat .
clear lwa_fldcat.
lwa_fldcat-col_pos = 2.
lwa_fldcat-fieldname = 'CustomerName' .
lwa_fldcat-datatype = 'C50'.
lwa_fldcat-reptext = 'Customer Name'.
lwa_fldcat-inttype = 'C'.
lwa_fldcat-intlen = '50'.
APPEND lwa_fldcat TO gt_fldcat .
LOOP AT lt_comp INTO lwa_comp.
CLEAR lwa_fldcat.
lv_opt = 'OPN'.
ADD 1 TO lv_count.
CONCATENATE lv_opt lv_count INTO lv_oper.
lwa_fldcat-col_pos = sy-tabix + 2.
lwa_fldcat-fieldname = lv_oper.
lwa_fldcat-datatype = 'C6'.
lwa_fldcat-reptext = lwa_comp-name.
lwa_fldcat-inttype = 'C'.
lwa_fldcat-intlen = '6'.
APPEND lwa_fldcat TO gt_fldcat .
CLEAR lv_opt.
ENDLOOP.
When i try to debug when calling class my final table <gt_table> is populated with the data and the filedcatalog is also build properly. I am confused whether this dump is due to my filedcatalog or dynamic table.
Any suggestions on this error.
2007 Dec 07 6:16 PM
May be the table type / data type in field catalog is different from your dynamic internal table. Make sure you have created the object.
Why dont you use the dynamic field catalog?
Create a fieldcatalog from function module for the same table that you have crated dynamic internal table.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = str_report
CHANGING
ct_fieldcat = p_it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
str_report is the table name/structure name .
P_it_fieldcat is the itab to pass with the display method.
This will create the same field catalog that you have used for your internal table.
reward if helpful
2007 Dec 07 7:50 PM
Thanks for the reply,
But i am already getting the table with the fieldcatalog using cl_alv_table_create=>create_dynamic_table. So why should we have to again use FM to generate fieldcatalog. I am not clear about that.
2007 Dec 07 8:33 PM
So are you saying that you don't get the dump when you try to debug through it? Or does it still dump in debugging as well as during regular execution? If you can make it dump while debugging, which exact statement is it dumping on?
- April King