Skip to Content

Replacement for i_grid_title in REUSE_ALV_GRID_DISPLAY in SALV

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2015 at 11:58 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 10, 2015 at 10:21 AM

    Just wondering if there is really no replacement for this parameter in the OOPS variant 😔 🤯

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 20, 2015 at 08: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.