Skip to Content

Field symbol with header line for REUSE_ALV_BLOCK_LIST_HS_APPEND - Dump

Hi,

I use FM 'REUSE_ALV_BLOCK_LIST_HS_APPEND' to display dynamic data in the ALV. Where I use field symbols as Export tables for header and item. The FM has export tables with header line in it. So I need to assign field symbol with header line. Since I did not assign field symbol with header line the program is going Dump when I process any PF functions. Please help!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Aug 28, 2017 at 05:35 AM

    An FM cannot have an export parameter with header line in it. Also field symbols either denote the header line or the table body.

    If the FM has a TABLES parameter you cannot pass the header line using a field symbol. With a field symbol you can pass only the table body to a TABLES parameter.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 28, 2017 at 09:00 AM

    Since the FM-based ALV uses obsolete TABLES parameters for which no direct dynamic parameter passing is possible, you should consider to move to the object oriented ALV APIs (like SALV).

    If this is not possible, you might wrap the call of the FM in an own procedure (FM or subroutine ) with the same interface as the FM plus an additional structured parameter for the header line. This allows you to pass the data for the header line explicitly to that parameter and inside your wrapper procedure you assign the structure to the header line:

    FORM wrapper TABLES t
                 USING p TYPE any.
      t = p.
      CALL FUNCTION 'FM'
        TABLES
          tab = t.
    ENDFORM.
    Add comment
    10|10000 characters needed characters exceeded

  • Aug 28, 2017 at 05:29 AM

    A field symbol cannot map an internal table with its header line at the same time.

    So, you may never use a field symbol as an argument of the TABLES word in FORM, PERFORM, FUNCTION, and CALL FUNCTION.

    Please share your code (both calling and called parts) so that we can propose you a workaround.

    Add comment
    10|10000 characters needed characters exceeded

    • This is my code
      
            CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
                 EXPORTING
                      i_callback_program       = gv_repid
                      i_callback_pf_status_set = gv_pfstatus
                 i_callback_user_command  = 'USER_COMMAND'.
      *lv_text = 'Select entries to modify'.
            CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_HS_APPEND'
                 EXPORTING
                      is_layout                  = ls_layout
                      it_fieldcat                = lt_field
                      is_keyinfo                 = ls_keyinfo
                      i_header_tabname           = '<GFT_TAB_MOD>'
                      i_item_tabname             = '<LFT_ALV_ITEM>'
                      it_events                  = lt_hevents
      *                i_text                     = lv_text
                 TABLES
                      t_outtab_header            = <gft_tab_mod>
                      t_outtab_item              = <lft_alv_item>.
      The problem is in passing <gft_tab_mod> & <lft_alv_item> to the FM REUSE_ALV_BLOCK_LIST_HS_APPEND. I get the ALV displayed but when I process any PF status I get a DUMP.