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

Disabling Custom Button in Docking ALV

Former Member
0 Likes
554

Hi

I have made a Docking Alv Report i.e two output in 1 , TOP Alv,Bottom Alv,

In Top alv I have some custom button in toolbar, Now I have to disable button on certain condition say

when i press 1 button some processing is done and I disable/enable a button on the conditions.

How to do the above, please guide

Best regards

bobby

4 REPLIES 4
Read only

Former Member
0 Likes
468

Hi,

Refer to the example BCALV_TEST_GRID_TOOLBAR in the package SLIS of your R3 system for your requirement.

regards,

Advait

Read only

0 Likes
468

Hi Advait,

The Report mention in your mail only disables standard toolbar button, I need to disable custom button made by user like 'Toggle' in report BCALV_TEST_GRID_TOOLBAR

thanks

bobby

Read only

0 Likes
468

Hello Bobby

You may have a look at my answer in thread

You should call method go_grid->set_toolbar_interactive( ) at PBO of your screen so it always triggers event TOOLBAR where you can evaluate your condition.

Regarding activation & inactivation there is no difference between standard and custom functions.

Regards

Uwe

Read only

0 Likes
468

Dear Uwe,

Could you please guide me how to disable the custom button , as I am unable to do it.

In PBO I have following Code, and I have Custom Button on toolbar name 'DET', I want to diable this after certain Processing. When I am calling method ALV_TOP->SET_TOOLBAR_INTERACTIVE its giving Dump .

CHECK DOCKINGBOTTOM IS INITIAL.

CREATE OBJECT DOCKINGTOP

EXPORTING

REPID = REPID

DYNNR = SY-DYNNR

SIDE = DOCKINGTOP->DOCK_AT_TOP

EXTENSION = 200.

CREATE OBJECT ALV_TOP

EXPORTING

I_PARENT = DOCKINGTOP.

SET HANDLER LCL_EVENT_HANDLER=>HANDLE_TOOLBAR_TOP FOR ALV_TOP.

SET HANDLER LCL_EVENT_HANDLER=>USER_COMMAND FOR ALV_TOP.

CALL METHOD ALV_TOP->SET_TOOLBAR_INTERACTIVE .

MOVE 'COLOR_LINE' TO WA_LAYOUT-INFO_FNAME.

CALL METHOD ALV_TOP->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = WA_LAYOUT

IT_TOOLBAR_EXCLUDING = LT_EXCLUDE

CHANGING

IT_OUTTAB = T_PO1[]

IT_FIELDCATALOG = T_FIELDCAT1[].

CALL METHOD ALV_TOP->SET_GRIDTITLE

EXPORTING

I_GRIDTITLE = 'Purchase Order Summary'(T06).

CALL METHOD ALV_TOP->SET_READY_FOR_INPUT

EXPORTING

I_READY_FOR_INPUT = '1'.

  • handler for ALV grid

SET HANDLER LCL_EVENT_HANDLER=>HANDLE_DOUBLE_CLICK FOR ALV_TOP.

  • handler for ALV grid

SET HANDLER LCL_EVENT_HANDLER=>HANDLE_HOTSPOT_CLICK FOR ALV_TOP.

CREATE OBJECT DOCKINGBOTTOM

EXPORTING

REPID = REPID

DYNNR = SY-DYNNR

SIDE = DOCKINGBOTTOM->DOCK_AT_BOTTOM

EXTENSION = 200.

CREATE OBJECT ALV_BOTTOM

EXPORTING

I_PARENT = DOCKINGBOTTOM.

SET HANDLER LCL_EVENT_HANDLER=>USER_COMMAND FOR ALV_BOTTOM.

CALL METHOD ALV_BOTTOM->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = WA_LAYOUT

IT_TOOLBAR_EXCLUDING = LT_EXCLUDE

CHANGING

IT_OUTTAB = T_FINAL[]

IT_FIELDCATALOG = T_FIELDCAT2[].

CALL METHOD ALV_BOTTOM->SET_GRIDTITLE

EXPORTING

I_GRIDTITLE = 'Purchase Order Detail'(T07).

CALL METHOD ALV_BOTTOM->SET_READY_FOR_INPUT

EXPORTING

I_READY_FOR_INPUT = '1'.

and following Code For Toolbar

----


  • FORM f_handle_toolbar_TOP *

----


  • --> PV_OBJECT *

  • --> E_INTERACTIVE *

----


FORM F_HANDLE_TOOLBAR_TOP USING PV_OBJECT TYPE REF TO

CL_ALV_EVENT_TOOLBAR_SET

E_INTERACTIVE TYPE CHAR1.

DATA:

LS_TOOLBAR TYPE STB_BUTTON.

LS_TOOLBAR-FUNCTION = 'INB_DELV'.

LS_TOOLBAR-QUICKINFO = 'Create Inbound Delivery'(T01).

LS_TOOLBAR-TEXT = 'Create Inbound Delivery'(T02).

LS_TOOLBAR-BUTN_TYPE = '0'.

LS_TOOLBAR-ICON = ICON_EXECUTE_OBJECT.

APPEND LS_TOOLBAR TO PV_OBJECT->MT_TOOLBAR.

CLEAR LS_TOOLBAR.

LS_TOOLBAR-FUNCTION = 'DET'.

LS_TOOLBAR-QUICKINFO = 'Purchase Order Details'(T03).

LS_TOOLBAR-TEXT = 'PO Details'(T04).

LS_TOOLBAR-BUTN_TYPE = '0'.

LS_TOOLBAR-ICON = ICON_EXECUTE_OBJECT.

APPEND LS_TOOLBAR TO PV_OBJECT->MT_TOOLBAR.

CLEAR LS_TOOLBAR.

LS_TOOLBAR-FUNCTION = 'INBCHK'.

LS_TOOLBAR-QUICKINFO = 'Inbound Delivery Check'(T05).

LS_TOOLBAR-TEXT = 'Inbound Delivery Check'(T05).

LS_TOOLBAR-BUTN_TYPE = '0'.

LS_TOOLBAR-ICON = ICON_EXECUTE_OBJECT.

APPEND LS_TOOLBAR TO PV_OBJECT->MT_TOOLBAR.

CLEAR LS_TOOLBAR.

ENDFORM. " f_handle_toolbar_TOP

Thanks

Bobby

Edited by: Bobby G on Feb 20, 2009 9:45 AM

Edited by: Bobby G on Feb 20, 2009 9:46 AM