Skip to Content
Author's profile photo Hasan Rafiq

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.

SCN_1.png

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_actsid = ‘QC1’.

       ls_actstext = ‘New Email Form’.

       ls_actsonselect = ‘quick_create’.

       ls_actsicon_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_actsid = ‘ACT1’.

       ls_actstext = ‘Send mail’.

       ls_actsonselect = ’email’.

       ls_actsicon_src = ‘/sap/bc/bsp/sap/thtmlb_styles/sap_skins/default/images/email.gif’.

       APPEND ls_acts TO et_actions.

       CLEAR ls_acts.

       ls_actsid = ‘ACT2’.

       ls_actstext = ‘Check existence’.

       ls_actsonselect = ‘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.

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Thanks hasan . . .

      Nice document

      Author's profile photo Hasan Rafiq
      Hasan Rafiq
      Blog Post Author

      Thanks Dinesh ! Just a small effort from my side 🙂 . Could you please rate the document ?

      /Hasan

      Author's profile photo Former Member
      Former Member

      Very helpful document..

      Thanks Hasan..

      Author's profile photo Joaquin Fornas
      Joaquin Fornas

      Five stars, we needed this kind of document.

      Author's profile photo Hasan Rafiq
      Hasan Rafiq
      Blog Post Author

      Thanks a lot Joaquin.

      Author's profile photo Former Member
      Former Member

      Thank You... Hasan For document....

      Author's profile photo Mithun Chakravarthi
      Mithun Chakravarthi

      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.