08-28-2017 4:58 AM
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!
08-28-2017 6: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.
08-28-2017 6:50 AM
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.
08-28-2017 6: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.
08-28-2017 6:46 AM
Can you give me a example for passing header line and table body to tables parameter dynamically by RTTS?
08-28-2017 7:47 AM
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.
08-28-2017 8:38 AM
Thanks! I tried cl_alv_table_create=>create_dynamic_table still my problem is not solved.
08-28-2017 10: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.
08-28-2017 2:22 PM