title: How to use REUSE_ALV_FIELDCATALOG_MERGE function module?
body: <p>I'm trying to use the function module <code>REUSE_ALV_FIELDCATALOG_MERGE</code> to pass the field label in ddic to display in the column header of the alv report.
  But, that didn't work.</p>
  
  <p>If I comment the <code>I_STRUCTURE_NAME = 'TY_YNAH_CUS_OBJ_REQ'</code> line, it give me runtime error state </p>
  
  <blockquote>
    <p>The ABAP program lines are wider than the internal table.</p>
  </blockquote>
  
  <p>But if I uncomment it ,the program still did not work</p>
  
  <pre><code>REPORT YALV_TEST.
  
          tables sscrfields. 
          type-pools : slis.
  
          "CREATE STRUCTURE -1 
          TYPES: BEGIN OF TY_YNAH_CUS_OBJ_REQ, 
                 REQID TYPE YNAH_REQ_ID, 
                 REQUESTOR TYPE YNAH_REQUESTOR,
                 BUSINESS_OWNER TYPE YNAH_BUS_OWN,
                 FUNCTIONAL_OWNER TYPE YNAH_FUNC_OWN, 
                 REQNUM TYPE YNAH_SERVICE_REQ_NUM, 
                 PROJECT_ID TYPE YNAH_PRO_ID, 
                 SYSTEM_ID TYPE YNAH_SYS_ID, 
                 FUNCTIONAL_AREA TYPE YNAH_FUNC_AREA,
                 REQUEST_DATE TYPE YNAH_REQ_DATE,
                 REQUEST_TIME TYPE YNAH_REQ_TIME,
  
             END OF TY_YNAH_CUS_OBJ_REQ.
  
          "defining internal table -2 
  
          DATA: IT_YNAH_CUS_OBJ_REQ type TABLE OF TY_YNAH_CUS_OBJ_REQ 
           * WA_YNAH_CUS_OBJ_REQ type TY_YNAH_CUS_OBJ_REQ.
  
          DATA: it_fcat TYPE slis_t_fieldcat_alv ,
           wa_fcat TYPE slis_fieldcat_alv,
           gd_layout TYPE slis_layout_alv.
  
          SELECTION-SCREEN BEGIN OF BLOCK menu WITH FRAME TITLE text-001.
          SELECT-OPTIONS: s_proid FOR IT_YNAH_CUS_OBJ_REQ-PROJECT_ID.
          PARAMETER p_sysid type TY_YNAH_CUS_OBJ_REQ-SYSTEM_ID.
          SELECTION-SCREEN: BEGIN OF LINE,
          pushbutton 33(8) BUT user-command search. 
          SELECTION-SCREEN END OF LINE. 
          SELECTION-SCREEN END OF BLOCK menu.
  
          initialization. 
          BUT = 'SEARCH'. END-OF-SELECTION.
  
          "execute search function when user click search button
          at selection-screen. "after processing user input 
           case SSCRFIELDS.
             when 'SEARCH'.
              SSCRFIELDS-UCOMM = 'ONLI'.
          endcase.
  
      "fetch data using select-4 START-OF-SELECTION. 
  
      SELECT * 
      FROM YNAH_CUS_OBJ_REQ "Database 
      INTO CORRESPONDING FIELDS OF TABLE IT_YNAH_CUS_OBJ_REQ "Into internal table 
      WHERE 
         PROJECT_ID in s_proid and 
         SYSTEM_ID eq p_sysid.
  
          CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' 
          EXPORTING
           I_PROGRAM_NAME = sy-repid
          I_INTERNAL_TABNAME ='TY_YNAH_CUS_OBJ_REQ'
          * I_STRUCTURE_NAME = 'TY_YNAH_CUS_OBJ_REQ'
          * I_CLIENT_NEVER_DISPLAY = 'X'
          I_INCLNAME = sy-repid 
          * I_BYPASSING_BUFFER = 'X' 
          * I_BUFFER_ACTIVE = CHANGING CT_FIELDCAT = it_fcat. 
          * EXCEPTIONS 
          * INCONSISTENT_INTERFACE = 1 
          * PROGRAM_ERROR = 2 
          * OTHERS = 3 
          * .
           IF SY-SUBRC &lt;&gt; 0. 
          ** Implement suitable error handling here 
          ENDIF.
  </code></pre>