Modifying button properties in Web UI transactions is a common requirement and can be done quite easily. The button properties need to be modified in the method where they are built. To do this:
1. Identify the Component and View where the button appears. As an example, let us disable the EDIT button in Account Overview screen. This is present in the View AccountViewSet of the BP_HEAD component.
2. Enhance the Component and the View. This would generate a new implementation class in the customer namespace.
3.In this implementation class, identify and redefine the Method that builds the Buttons. Buttons are usually built in DO_PREPARE_OUTPUT or IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS.
4. The field 'enabled' in the gt_buttons table needs to be set to blank for the appropriate table line. In our case, for EDIT button, the value for 'enabled' needs to be set to false.
Follow the same steps to change the text, tooltip, on click event for a button etc.
2 Comments
Danilo Cardoso
Hi!!!
Great guide, thanks!
I have a doubt
What the value that parameter cl_wd_utilities=>get_otr_text_by_alias is waiting for? Where can i find these values, there is any transaction?
I need to do the same thing to the button 'New' at the Opportunity View but i don't know what value i must to put in this parameter.
Thanks again.
Danilo
Andrei Vishnevsky
Danilo,
such questions better to ask in discussions right here http://scn.sap.com/community/crm/webclient-ui-framework
Regarding your question check t.code SOTR_EDIT.