Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Field symbol with header line for REUSE_ALV_BLOCK_LIST_HS_APPEND - Dump

former_member199670
Participant
0 Kudos

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!

8 REPLIES 8

Sandra_Rossi
Active Contributor
0 Kudos

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.

0 Kudos
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.

horst_keller
Product and Topic Expert
Product and Topic Expert

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.

0 Kudos

Can you give me a example for passing header line and table body to tables parameter dynamically by RTTS?

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

In RTTS, the concept of header lines is not supported. You also can't create tables with header lines using CREATE DATA.

Maybe the ALV framework offers with cl_alv_table_create=>create_dynamic_table a workaround for their usage of obsolete TABLES parameters. you can google for cl_alv_table_create=>create_dynamic_table to find examples.

0 Kudos

Thanks! I tried cl_alv_table_create=>create_dynamic_table still my problem is not solved.

horst_keller
Product and Topic Expert
Product and Topic Expert

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.

0 Kudos

I like this answer! I gonna try this.