10-19-2015 12:17 PM
Hi,
im looking for an replacement for I_grid_title the the FM REUSE_ALV_GRID_DISPLAY:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = alv_report_id
i_grid_title = tmp_title
is_layout = alv_layout
is_print = alv_print
it_fieldcat = it_fcat
i_save = 'A'
it_sort = it_alv_sort
is_variant = alv_variant
I tried
salv_display_settings->set_list_header( 'Userlist' ).
and
create object salv_header.
salv_label = salv_header->create_label( row = 1 column = 1 ).
salv_label->set_text('Title for the ALV').
salv->set_top_of_list( salv_header ).
But both are not an replacement for the I_grid_title parameter as the position and look&feel is completely different.
10-19-2015 12:58 PM
hi,
try this piece of code for fm reuse grid display.
TYPES: BEGIN OF GRID,
TITLE TYPE CHAR70,
END OF GRID.
MOVE 'Report For Items' TO I_GRID-TITLE.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_GRID_TITLE = I_GRID-TITLE
IS_LAYOUT = G_LAYOUT
IT_FIELDCAT = IT_FCAT[]
I_SAVE = 'A'
IS_VARIANT = LS_VARIANT
TABLES
T_OUTTAB = IT_OUTPUT4
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
10-19-2015 1:47 PM
10-19-2015 1:53 PM
11-10-2015 10:21 AM
Just wondering if there is really no replacement for this parameter in the OOPS variant
11-10-2015 2:23 PM
Hi Rainer,
There is a replacement. Please check the quick example I have put together.
That leads to the Output:
Hope this is what you're looking for.
Regards
Oliver
11-11-2015 6:49 AM
Why didn't you read my question more carefully? I definitely said that I tried the label/header stuff and that this is NOT a replacement as it looks different.
Worthless to ask here.
11-11-2015 8:20 AM
Exactly - it looks better and gives more flexibility. Worthless to reply here.
11-20-2015 6:18 AM
The worm must be tasty for the fish, and not for the fisherman. So if you think it looks better that's okay, but please allow others to have another opinion.
11-20-2015 8:50 AM
Hi Rainer,
SALV OM encapsulates the different flavours of tabular ALV - list, fullscreen grid, container grid. I just put a breakpoint in REUSE_ALV_GRID_DISPLAY & executed the SALV OM.
BR,
Suhas
11-20-2015 10:16 AM
If you want it to look the same, create splitter container. Put the SALV in the bottom one and in the top a document or HTML container - then you can play with the formatting to your heart's content and even make it look as it did old school.
11-20-2015 8:31 AM
Hi Rainer,
Simply make a program and check and share the output.
Each and Every thing of alv is handle more properly in OM model of ALV.
*&---------------------------------------------------------------------*
*& Data Declaration
*&---------------------------------------------------------------------*
DATA: gt_makt TYPE TABLE OF makt.
DATA: gr_table TYPE REF TO cl_salv_table.
DATA: gr_display TYPE REF TO cl_salv_display_settings.
*&---------------------------------------------------------------------*
*& Start-of-Selection
*&---------------------------------------------------------------------*
START-OF-SELECTION.
SELECT * UP TO 10 ROWS FROM makt INTO TABLE gt_makt.
*Generate an instance of the ALV table object
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = gr_table
CHANGING
t_table = gt_makt.
*Get the reference to the settings of the table
gr_display = gr_table->get_display_settings( ).
*Set the striped pattern (ZEBRA pattern)
gr_display->set_striped_pattern( cl_salv_display_settings=>true ).
*Set the heading
gr_display->set_list_header( 'Heading for ALV Demo Program' ).
*Remove horizontal lines of the grid
gr_display->set_horizontal_lines( if_salv_c_bool_sap=>false ).
*Remove vertical lines of the grid
gr_display->set_vertical_lines( if_salv_c_bool_sap=>false ).
*Display the ALV table.
gr_table->display( ).
Some time some property are overwritten because of wrong coding.