Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create dynamic table from dynamic tablefield

Former Member
0 Likes
432

Hi,

I want to create a dynamic table from dynamics tablefields.

It's on SAP 4.6 and I use this code :


CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
  EXPORTING
    I_STRUCTURE_NAME = STRUCTURE_NAME
  CHANGING
    CT_FIELDCAT = t_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.
ELSE.
  DELETE t_fieldcat
  WHERE INTTYPE <> 'C'.

  l_colonne = 1.
  LOOP AT t_fieldcat INTO x_fieldcat.
    append x_fieldcat-fieldname to t_columns.
    x_fieldcat-col_pos = l_colonne.
    l_colonne = l_colonne + 1.
    append x_fieldcat to t_fieldcat2.
  ENDLOOP.

  if not t_columns[] is initial.

    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
      EXPORTING
        IT_FIELDCATALOG = T_FIELDCAT2
      IMPORTING
        EP_TABLE = o_handle
      EXCEPTIONS
        GENERATE_SUBPOOL_DIR_FULL = 1
        OTHERS = 2.

    IF SY-SUBRC <> 0.
    ENDIF.

It's ok but after 36 times, the exceptions GENERATE SUBPOOL DIR FULL appear.

I can't use the CREATE DATA method because I don't have a table type.

Thanks you for your help.

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
0 Likes
354

try

A.

2 REPLIES 2
Read only

andreas_mann3
Active Contributor
0 Likes
355

try

A.

Read only

0 Likes
354

It's OK.

Thanks for your link.