Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Create_dynamic_table does not work when fieldcatalog table contains LVC_S_S

I'm getting short-dump when creating dynamic internal table via CALL METHOD cl_alv_table_create=>create_dynamic_table. The fieldcatalog contains a component named LVC_S_STYL which populates fine when after call function LVC_FIELDCATALOG_MERGE but when this is passed to cl_alv_table_create=>create_dynamic_table it short dumps!

Is it possible to pass the style catalog in this case, how? Below is my code.

Structure of 'ZZ_ALV_FCAT' is WERKS type werks_d, DATE type datum, CELLTAB type LVC_S_STYL.

       i_structure_name             = 'ZZ_ALV_FCAT'
        ct_fieldcat                  = lt_fieldcat.

    CALL METHOD cl_alv_table_create=>create_dynamic_table
        it_fieldcatalog           = lt_fieldcat
        i_length_in_byte          = ''
        ep_table                  = dy_table
        generate_subpool_dir_full = 1
        OTHERS                    = 2.

    IF sy-subrc EQ 0.
      ASSIGN dy_table->* TO <dyn_table>.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

<b>I'll be generously giving away points for any help!</b>

Any idea anyone? I was thinking may be convert the HEX data to CHAR before creating the dynamic table then again convert the CHAR data back to HEX before I call SET_TABLE_FOR_FIRST_DISPLAY? In that case, how to convert Hex of a structure to CHAR and vice versa?

Message was edited by:

Sougata Chatterjee

Former Member
Former Member replied

Hello Sougata

I have used class CL_SALV_TABLE just for displaying the results of the dynamic itab creation. The purpose of routine FILL_CELLTAB is just to show that we are able to create a complex itab (record contains one field (CELLTAB) which itself is a table type) and how to fill it because this has to be done dynamically, too.

If the dynamically created itab is used for an editable ALV list then you must use CL_GUI_ALV_GRID.



0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question