Skip to Content
avatar image
Former Member

internal table

hai.how to increase the fields of internal tabl edynamically?plz help me on this.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Apr 03, 2007 at 10:58 AM

    Hi Mrudula,

    In order to increase the size of the internal table , i.e. fields dynamically , you need to include or append structures to the respective internal table.

    Hope this resolves your query.

    Reward all the helpful answers.

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 03, 2007 at 01:34 PM

    Hi Mrudula,

    Check this code.

    DATA: BEGIN OF str_itab OCCURS 0,

    var1 TYPE i,

    var2 TYPE i,

    END OF str_itab.

    CREATE DATA itab TYPE STANDARD TABLE OF itab.

    By using 'create data' statement you can create internal table dynamically.

    regards,

    Rajesh.

    Message was edited by:

    RK

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 04, 2007 at 07:24 AM

    Hi

    Create the fieldcatalog thru the FM

     CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name = in_tabname
           CHANGING
                ct_fieldcat      = it_fcat
           EXCEPTIONS
                OTHERS           = 1.
    

    then append the number of dynamic fields you want to into the Fieldcatalog and then call on the following class

    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_content.
      IF sy-subrc = 0.
        ASSIGN it_content->* TO <itab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.

    This will return you a table whose fields will increase decrease dynamically.

    Hope that Helps

    Anirban M.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 04, 2007 at 07:24 AM

    Hi

    Create the fieldcatalog thru the FM

     CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name = in_tabname
           CHANGING
                ct_fieldcat      = it_fcat
           EXCEPTIONS
                OTHERS           = 1.
    

    then append the number of dynamic fields you want to into the Fieldcatalog and then call on the following class

    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_content.
      IF sy-subrc = 0.
        ASSIGN it_content->* TO <itab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.

    This will return you a table whose fields will increase decrease dynamically.

    Hope that Helps

    Anirban M.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 04, 2007 at 07:24 AM

    Hi

    Create the fieldcatalog thru the FM

     CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name = in_tabname
           CHANGING
                ct_fieldcat      = it_fcat
           EXCEPTIONS
                OTHERS           = 1.
    

    then append the number of dynamic fields you want to into the Fieldcatalog and then call on the following class

    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_content.
      IF sy-subrc = 0.
        ASSIGN it_content->* TO <itab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.

    This will return you a table whose fields will increase decrease dynamically.

    Hope that Helps

    Anirban M.

    Add comment
    10|10000 characters needed characters exceeded