Creating action menu on a field – CRM WebUI.
Hi All,
This document explains how to implement an action menu on a field in WebUI, this feature has been provided since EHP1 but no clear documentation is available on the Web for this .We shall take a scenario where we will add a menu on the field EMAIL on Business partner screen in web-UI.
1. Create a class ZL_ACTION_MENU in SE24 with super class “CL_BSP_WD_ACTION_PROVIDER” .
2. Redefine the method IF_BSP_WD_ACTION_DESCR_EXT~BUILD_ACTIONS of class ZL_ACTION_MENU with the code below :
METHOD if_bsp_wd_action_descr_ext~build_actions.
* Hasan : Testing for action menu – Testing
DATA : ls_acts TYPE wcfs_thtmlb_action_menu_item.
CASE iv_attribute_path.
WHEN ‘SMARTFORM.’.
ls_acts–id = ‘QC1’.
ls_acts–text = ‘New Email Form’.
ls_acts–onselect = ‘quick_create’.
ls_acts–icon_src = ‘/sap/bc/bsp/sap/thtmlb_styles/sap_skins/default/images/email.gif’.
APPEND ls_acts TO et_actions.
CLEAR ls_acts.
WHEN OTHERS.
ls_acts–id = ‘ACT1’.
ls_acts–text = ‘Send mail’.
ls_acts–onselect = ’email’.
ls_acts–icon_src = ‘/sap/bc/bsp/sap/thtmlb_styles/sap_skins/default/images/email.gif’.
APPEND ls_acts TO et_actions.
CLEAR ls_acts.
ls_acts–id = ‘ACT2’.
ls_acts–text = ‘Check existence’.
ls_acts–onselect = ‘VERIFY’.
APPEND ls_acts TO et_actions.
ENDCASE.
ENDMETHOD.
3. Then enhance the component BP_ADDR , view : StandardAddress ; node : STANDARDADDRESS .
4. Here create the method GET_AC for the field STRUCT.E_MAILSMT, with the code :
method GET_AC_E_MAILSMT.
* Hasan : Testing for action menu.
data : lr_action type REF TO zl_action_menu.
create OBJECT lr_Action.
rv_action_descriptor ?= lr_action.
endmethod.
This will enable the action menu on the attribute.
Thanks hasan . . .
Nice document
Thanks Dinesh ! Just a small effort from my side 🙂 . Could you please rate the document ?
/Hasan
Very helpful document..
Thanks Hasan..
Five stars, we needed this kind of document.
Thanks a lot Joaquin.
Thank You... Hasan For document....
Hi All,
As I followed same code but I am unable to get menu's. And one more I found that it is not working for value nodes. But what about table view, Can we apply?
Please help me. I am ready to discuss about this. Is there any documentation for this, if so paste the link. 😕
Thanks in Advance.
Regards,
Mithuunn,
SAP CRM Technical Consultant.