Skip to Content
author's profile photo
Former Member

REUSE_ALV_GRID_DISPLAY

Is it possible to alter the standard toolbar in the generated alv grid, e.g. removing/disable buttons using REUSE_ALV_GRID_DISPLAY?

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Best Answer
    author's profile photo
    Former Member
    Oct 05, 2005 at 12:59 PM

    Hi Rune,

    U have to declare in this way

    DATA:I_EXCLUDE TYPE SLIS_T_EXTAB.

    wa_exclude type slis_extab. "ALV EXCLUDE WORK AREA

    clear wa_exclude.

    wa_exclude-fcode = '&VEXCEL'.

    append wa_exclude to i_exclude.

    clear wa_exclude.

    wa_exclude-fcode = '&ETA'.

    append wa_exclude to i_exclude.

    all function 'REUSE_ALV_GRID_DISPLAY'

    exporting

    i_callback_program = ws_program

    i_callback_user_command = 'USER_COMMAND'

    is_layout = i_layout

    it_fieldcat = i_fieldcat

    <b> it_excluding = i_exclude</b>

    it_sort = i_sort

    i_save = 'A'

    • IS_VARIANT =

    it_events = i_events

    tables

    t_outtab = final_itab.

    Thanks&Regards,

    Ruthra

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks for all answers. I had to write it this way to make it work:

      DATA it_excludes TYPE TABLE OF <b>slis_extab</b>.

      DATA wa_exclude LIKE LINE OF it_excludes.

  • author's profile photo
    Former Member
    Oct 05, 2005 at 12:26 PM

    hi,

    Another option fill the fcodes you want to exclude in internaltable and pass it in FM call.

    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

    EXPORTING

    ....

    IT_EXCLUDING = lt_excludes

    ...

    regards,

    suresh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      The IT_EXCLUDING table is type of SLIS_T_EXTAB,

      Define work area 'LIKE LINE of SLIS_T_EXTAB'.

      Move your fcode to this workarea and append it itab.

      regards,

      suresh

  • author's profile photo
    Former Member
    Oct 05, 2005 at 12:19 PM

    Hi,

    yes u can do it.

    In order modify PF_STATUS of ALV grid report you need to perform the following steps:

    1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include:

    i_callback_pf_status_set = 'SET_PF_STATUS' statement.

    2. Create 'SET_PF_STATUS' FORM

    3. Create pf_status (i.e. 'ZNEWSTATUS').

    - It is recommend that you copy standard status'STANDARD' from function group SALV

    and modify it accordingly. ALV standard function codes always start with '&'.

    call function 'REUSE_ALV_GRID_DISPLAY'

    exporting

    i_callback_program = gd_repid

    i_callback_top_of_page = 'TOP-OF-PAGE'

    <b> i_callback_pf_status_set = 'SET_PF_STATUS'</b> "see FORM

    is_layout = gd_layout

    it_fieldcat = fieldcatalog[]

    i_save = 'X'

    tables

    t_outtab = it_ekko

    exceptions

    program_error = 1

    others = 2.

    ----


    • FORM SET_PF_STATUS *

    ----


    <b>FORM set_pf_status USING rt_extab TYPE slis_t_extab.

    SET PF-STATUS 'ZNEWSTATUS'.</b> "Copy of 'STANDARD' pf_status from fgroup SALV

    ENDFORM.

    Hope it helps u.

    Kindly reward points if u find it useful.

    Thanks&Regards,

    Ruthra

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 05, 2005 at 12:20 PM

    Hi Rune,

    You can use the parameter I_CALLBACK_PF_STATUS_SET for this. Please see the documentation of the function module. For more info pls refer this.

    http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm

    Cheers

    Vinod

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 05, 2005 at 12:31 PM

    Hi Rune,

    It is possible.

    DATA: BEGIN OF i_functions OCCURS 0.

    INCLUDE STRUCTURE rseul_fun.

    DATA: END OF i_functions.

    DATA: BEGIN OF i_function_list OCCURS 0.

    INCLUDE STRUCTURE rsmpe_funl.

    DATA: END OF i_function_list.

    DATA: BEGIN OF it_exclude OCCURS 0,

    fcode LIKE rsmpe-func.

    DATA: END OF it_exclude.

    CALL FUNCTION 'RS_CUA_GET_STATUS_FUNCTIONS'

    EXPORTING language = sy-langu

    program = 'SAPLKKBL'

    status = 'STANDARD'

    • IMPORTING

    • MASTER_LANGUAGE =

    TABLES functions = i_functions

    function_list = i_function_list

    EXCEPTIONS menu_not_found = 1

    program_not_found = 2

    status_not_found = 3

    OTHERS = 4.

    DELETE i_function_list WHERE fcode = '&UMC' OR fcode = '&SUM'.

    LOOP AT i_function_list.

    MOVE i_function_list-fcode TO it_exclude.

    APPEND it_exclude.

    CLEAR it_exclude.ENDLOOP.

    Kindly award points if you got satisfactory output.

    Regards,

    Dilip

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 05, 2005 at 12:43 PM

    Hi,

    I think you need to combine both pf-status and user_command to make it happen.

    Kindly reward points by clicking the star on the left of reply,if it helps.

    Add comment
    10|10000 characters needed characters exceeded