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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a 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 😊

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.