title: REUSE_ALV_FIELDCATALOG_MERGE for generating ALV hierarchial list?
body: <p>When I execute this code some error occurs. Can <code>REUSE_ALV_FIELDCATALOG_MERGE</code> function module be used to generate alv hierarchial reports in ABAP? And are there any tips for the simplest fieldcatalog merging?</p>
  
  <pre><code>REPORT ZSAMPLE_ALV_HIERACHIAL.
  
  DATA : IT_VBAK LIKE TABLE OF VBAK,
         WA_VBAK LIKE VBAK,
  
         IT_VBAP LIKE TABLE OF VBAP,
         WA_VBAP LIKE VBAP,
  
         IT_MARA LIKE TABLE OF MARA,
         WA_MARA LIKE MARA,
  
         IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
         WA_FCAT TYPE SLIS_FIELDCAT_ALV,
  
         IT_FCAT1 TYPE SLIS_T_FIELDCAT_ALV,
         WA_FCAT1 TYPE SLIS_FIELDCAT_ALV,
  
         IT_EVENT TYPE SLIS_T_EVENT,
         WA_EVENT TYPE SLIS_ALV_EVENT,
  
         V_VBELN TYPE VBAK-VBELN,
  
         GS_KEYINFO TYPE SLIS_KEYINFO_ALV,
  
         WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
         WA_LAYOUT1 TYPE SLIS_LAYOUT_ALV.
  
  WA_LAYOUT-ZEBRA = 'X'.
  WA_LAYOUT-COLWIDTH_OPTIMIZE = 'C510'.
  
  WA_LAYOUT-ZEBRA = 'X'.
  WA_LAYOUT-COLWIDTH_OPTIMIZE = 'C510'.
  
  SELECT-OPTIONS S_VBELN FOR V_VBELN.
  
  START-OF-SELECTION.
    PERFORM READ_DATA.
    PERFORM KEY_INFO.
    PERFORM FILL_FIELD_CATALOG USING 'IT_VBAK' 'VBAK'.
    PERFORM FILL_FIELD_CATALOG USING 'IT_VBAP' 'VBAP'.
    PERFORM DISPLAY_HIERACIAL_ALV.
  
  *&amp;---------------------------------------------------------------------*
  *&amp;      Form  READ_DATA
  *&amp;---------------------------------------------------------------------*
  *       text
  *----------------------------------------------------------------------*
  FORM READ_DATA .
  
    SELECT * FROM VBAK INTO TABLE IT_VBAK WHERE VBELN IN S_VBELN.
  
    IF NOT IT_VBAK IS INITIAL .
  
      SELECT * FROM VBAP INTO TABLE IT_VBAP FOR ALL ENTRIES IN IT_VBAK WHERE VBELN = IT_VBAK-VBELN.
  
    ENDIF.
  
  ENDFORM.                    "READ_DATA
  
  *&amp;---------------------------------------------------------------------*
  *&amp;      Form  KEY_INFO
  *&amp;---------------------------------------------------------------------*
  *       text
  *----------------------------------------------------------------------*
  FORM KEY_INFO .
  
    CLEAR GS_KEYINFO.
    GS_KEYINFO-HEADER01 = 'VBELN'.
    GS_KEYINFO-ITEM01 = 'VBELN'.
    GS_KEYINFO-HEADER02 = SPACE.
    GS_KEYINFO-ITEM02 = 'VBELP'.
  
  ENDFORM.                    "KEY_INFO
  
  *&amp;---------------------------------------------------------------------*
  *&amp;      Form  FILL_FIELD_CATALOG
  *&amp;---------------------------------------------------------------------*
  *       text
  *----------------------------------------------------------------------*
  *      --&gt;TNAM       text
  *      --&gt;C          text
  *----------------------------------------------------------------------*
  FORM FILL_FIELD_CATALOG  USING    TNAM TYPE C STRUCTURE TYPE C.
  
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        I_PROGRAM_NAME     = SY-REPID
        I_INTERNAL_TABNAME = TNAM
        I_STRUCTURE_NAME   = STRUCTURE
      CHANGING
        CT_FIELDCAT        = IT_FCAT.
  ENDFORM.                    "FILL_FIELD_CATALOG
  
  *&amp;---------------------------------------------------------------------*
  *&amp;      Form  DISPLAY_HIERACIAL_ALV
  *&amp;---------------------------------------------------------------------*
  *       text
  *----------------------------------------------------------------------*
  FORM DISPLAY_HIERACIAL_ALV .
  
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM      = SY-CPROG
        IS_LAYOUT               = WA_LAYOUT
        IT_FIELDCAT             = IT_FCAT
        I_TABNAME_HEADER        = 'IT_VBAK'
        I_TABNAME_ITEM          = 'IT_VBAP'
  *     I_STRUCTURE_NAME_HEADER = 'VBAK'
  *     I_STRUCTURE_NAME_ITEM   = 'VBAP'
        IS_KEYINFO              = GS_KEYINFO
      TABLES
        T_OUTTAB_HEADER         = IT_VBAK
        T_OUTTAB_ITEM           = IT_VBAP.
  
  ENDFORM.
  </code></pre>