Skip to Content
0

Field symbol with header line for REUSE_ALV_BLOCK_LIST_HS_APPEND - Dump

Aug 28, 2017 at 03:58 AM

51

avatar image

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!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Horst Keller
Aug 28, 2017 at 05:35 AM
1

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.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

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

0

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

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

0
Horst Keller
Aug 28, 2017 at 09:00 AM
1

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.
Show 1 Share
10 |10000 characters needed characters left characters exceeded

I like this answer! I gonna try this.

0
Sandra Rossi Aug 28, 2017 at 05:29 AM
0

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.

Show 1 Share
10 |10000 characters needed characters left 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.

0