Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

decrease the tool bar in alv

Former Member
0 Likes
753

hi i have alv and i don't wont all the icon in the alv tool bar i just wont the print icon and the sort icon .i go to the set table for the first display but i don't have access key what can i do regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
718

go to se80 choose salv fn group and gui status standard and copy that for your program.

in alv set your pf status by that name and exclude the fn code from your status.

form set_pf_status using extab type slis_t_extab.

data : wextab type slis_extab.

wextab-fcode = '&OUP'.

append wextab to extab.

like this

set pf-status 'ZSTANDARD' excluding extab.

endform.

regards

shiba dutta

6 REPLIES 6
Read only

Former Member
0 Likes
719

go to se80 choose salv fn group and gui status standard and copy that for your program.

in alv set your pf status by that name and exclude the fn code from your status.

form set_pf_status using extab type slis_t_extab.

data : wextab type slis_extab.

wextab-fcode = '&OUP'.

append wextab to extab.

like this

set pf-status 'ZSTANDARD' excluding extab.

endform.

regards

shiba dutta

Read only

Former Member
0 Likes
718

Hello,

You have an interface parameter (IT_TOOLBAR_EXCLUDING) in the method SET_TABLE_FOR_FIRST_DISPLAY. Populate this table with the function codes of the buttons you want to exclude and then pass it to the method. All those buttons will disappear from the toolbar of the grid. The function codes are listed in the Attributes tab in SE24.

Refer to package SLIS for examples.

Regards,

Manoj

Read only

0 Likes
718

hi manoj maybe u can explain it better or give an example thanes

Read only

0 Likes
718
1. Declare this event if not declare

     *for event handling
CLASS LCL_EVENT_RECEIVER DEFINITION DEFERRED.


2.CLASS LCL_EVENT_RECEIVER DEFINITION.

       *method to handle toolbar
    HANDLE_TOOLBAR
        FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
            IMPORTING E_OBJECT E_INTERACTIVE.

   ENDCLASS.

3.CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.

    METHOD HANDLE_TOOLBAR.
    DATA: WA_TOOLBAR  TYPE STB_BUTTON.

    CLEAR WA_TOOLBAR.
    LOOP AT E_OBJECT->MT_TOOLBAR INTO WA_TOOLBAR.
      IFWA_TOOLBAR-FUNCTION = '&LOCAL&SORT' OR
         WA_TOOLBAR-FUNCTION = '&LOCAL&PRINT' OR         

        DELETE E_OBJECT->MT_TOOLBAR INDEX SY-TABIX.
      ENDIF.
    ENDLOOP.

  ENDMETHOD.                    "handle_toolbar

   ENDCLASS.

4. *sets toolbar event
  SET HANDLER W_EVENT_RECEIVER->HANDLE_TOOLBAR FOR W_GRID.



"I am not sure about the FOCDES , just debug and checkout the FCODES for SORT and PRINT
Read only

Former Member
0 Likes
718

Hi,

Go to Menu painter (se41) - give Program name and your STATUS 'MAIN100'

- Change mode- Now delect the Icons which you don't want.

other way - Exclude the options in Application toolbar

wa_excluding-fcode = p_fcode." Give the focde for buttons u want to exclude

APPEND wa_excluding TO it_excluding.

CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IT_TOOLBAR_EXCLUDING = it_excluding

IS_LAYOUT = GS_LAYOUT

is_variant = variant

I_SAVE = 'A'

CHANGING

IT_FIELDCATALOG = GT_FIELDCAT

IT_OUTTAB = ITAB.

Refer std programs:

BCALV_TEST_FUNCTIONS

BCALV_TEST_GRID_TOOLBAR

Also check this link:

Suggest you to Search in SDN with key - <b>EXCLUDE</b>

Will get few more useful related Posts.

Reward points if this Helps.

Manish

Read only

Former Member
0 Likes
718

Hello,

Do like this:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = G_F_PROGNAME

I_CALLBACK_PF_STATUS_SET = 'ALV_PF_STATUS_SET'

I_CALLBACK_USER_COMMAND = 'ALV_USER_COMMAND'

I_CALLBACK_TOP_OF_PAGE = 'ALV_TOP_OF_PAGE'

I_CALLBACK_HTML_END_OF_LIST = 'ALV_END_OF_LIST'

IS_LAYOUT = G_S_LAYOUT

IS_PRINT = G_S_PRINT

I_GRID_SETTINGS = G_S_GRID_SET

IT_FIELDCAT = G_T_FIELDCAT

IT_SORT = G_T_SORT

IS_VARIANT = G_R_VARIANT

IT_EVENTS = G_T_EVENT

I_SAVE = 'A'

I_GRID_TITLE = G_F_GRID_TITLE

TABLES

T_OUTTAB = G_T_ALVLIST

EXCEPTIONS

OTHERS = 1.

&----


*& Form ALV_PF_STATUS_SET

&----


FORM ALV_PF_STATUS_SET USING RT_EXTAB TYPE SLIS_T_EXTAB.

DATA:

LR_EXTAB TYPE SLIS_EXTAB.

IF PA_PRKOS NE 'X'.

LR_EXTAB-FCODE = 'PSPLIST'.

APPEND LR_EXTAB TO RT_EXTAB.

LR_EXTAB-FCODE = 'TEXT20PSP'.

APPEND LR_EXTAB TO RT_EXTAB.

ELSE.

IF SY-UNAME NE 'BO88WA2' AND SY-UNAME NE 'QN82FE'.

LR_EXTAB-FCODE = '&OUP'.

APPEND LR_EXTAB TO RT_EXTAB.

LR_EXTAB-FCODE = '&ODN'.

APPEND LR_EXTAB TO RT_EXTAB.

LR_EXTAB-FCODE = '&ILT'.

APPEND LR_EXTAB TO RT_EXTAB.

LR_EXTAB-FCODE = '&OL0'.

APPEND LR_EXTAB TO RT_EXTAB.

LR_EXTAB-FCODE = '&OAD'.

APPEND LR_EXTAB TO RT_EXTAB.

LR_EXTAB-FCODE = '&AVE'.

APPEND LR_EXTAB TO RT_EXTAB.

ENDIF.

LR_EXTAB-FCODE = 'TEXT20'.

APPEND LR_EXTAB TO RT_EXTAB.

ENDIF.

  • 001 vsm1kor 18.01.07 " OPL 1448

IF SY-TCODE = 'ZLIEFERLISTE'.

LR_EXTAB-FCODE = '&OL0'.

APPEND LR_EXTAB TO RT_EXTAB.

LR_EXTAB-FCODE = '&OAD'.

APPEND LR_EXTAB TO RT_EXTAB.

LR_EXTAB-FCODE = '&AVE'.

APPEND LR_EXTAB TO RT_EXTAB.

LR_EXTAB-FCODE = 'TEXT'.

APPEND LR_EXTAB TO RT_EXTAB.

LR_EXTAB-FCODE = 'TEXT20'.

APPEND LR_EXTAB TO RT_EXTAB.

ENDIF.

  • 001 vsm1kor 18.01.07 " OPL 1448

SET PF-STATUS 'ZSTANDARD' EXCLUDING RT_EXTAB.

ENDFORM. "ALV_PF_STATUS_SET

If useful reward.

Vasanth