Skip to Content

LVC_FIELDCATALOG_MERGE with internal table

Hi,

Can I use Function Module LVC_FIELDCATALOG_MERGE to get the fieldcatalog of the global internal table in my program instead of dictionary table.

Using parameter i_internal_tabname instead of i_structure_name doesn't work.

Thanks,

Eyal.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 11, 2005 at 10:03 AM

    Hi

    This fm doesn't work by internal table, you have to pass only dictionary table, but you can use REUSE_ALV_FIELDCATALOG_MERGE:

    TYPE-POOL SLIS:

    DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

    LT_FIELDCAT TYPE SLIS_FIELDCAT_ALV,

    GT_LVC_FIELDCAT TYPE LVC_T_FCAT,

    LT_LVC_FIELDCAT TYPE LVC_S_FCAT.

    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

    EXPORTING

    I_PROGRAM_NAME = GT_REPID

    I_INTERNAL_TABNAME = 'ITAB'

    I_INCLNAME = GT_REPID

    CHANGING

    CT_FIELDCAT = GT_FIELDCAT.

    LOOP AT GT_FIELDCAT INTO LT_FIELDCAT.

    MOVE-CORRESPONDING LT_FIELDCAT TO LT_LVC_FIELDCAT.

    APPEND LT_LVC_FIELDCAT TO GT_LVC_FIELDCAT.

    ENDLOOP.

    Max

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2005 at 10:04 AM

    Eyal,

    I don't think you can do that ?

    can you paste the code you have for the call method with the NAME OF THE STRUCTURE?

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 11, 2005 at 10:11 AM

    Check this

    In PBO,

    *   Building the field catalog
        PERFORM f9001_build_field_cat TABLES i_fieldcat
                                USING 'ZCSA_MARKETIING_EXPENSE_OUTPUT'
    
    FORM f9001_build_field_cat TABLES   p_fieldcat STRUCTURE lvc_s_fcat
                          USING value(p_structure).
    
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name       = p_structure
           CHANGING
                ct_fieldcat            = p_fieldcat[]
           EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
      IF sy-subrc <> 0.
        MESSAGE i013 WITH text-e05."Error in ALV field catalogue creation
        LEAVE LIST-PROCESSING.
      ENDIF.
    
    ENDFORM.                    " f9001_build_field_cat

    U can create a structure or example pass MARA then it will take the structure of MARA.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 11, 2005 at 11:15 AM

    Hi,

    In the function module attribute SAP wrote:

    Create field catalog from dictionary structure or <b>internal table</b>

    So maybe there is a way,

    Thanks,

    Eyal.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Vinod Chandran

      If I check the function code of

      'REUSE_ALV_FIELDCATALOG_MERGE'

      if ( i_structure_name is initial )

      and ( i_internal_tabname ne space ).

      " called with internal table

      "( not supported, see documentation)

      It seems it is not supported 😊