cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding approve button in shopping cart approval screen dynamically

Former Member
0 Kudos

Hi All,

Based on an attribute ( WF approach), we need to disable the approve button in a shopping cart approval screen once the user selects a workitem. In debugging mode, we identified the button ID (F_APPROVE) but we are not able to disable the button using the below code.

   lo_button1->set_visible( cl_wd_uielement=>e_visible-none ).
              lo_button1->set_enabled( abap_false ).

We have tried in debugging mode also. Tried out the code in WDMODIFY-post exit of the SALV_WD_TABLE- VIEW_TABLE.

Kindly let us know in case anyone has come across such enhancement and any possible approach for this issue.

Kind Regards,

Gayathri.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gayathri,

There are 2 ways in which you can achieve this.

1. at the UI element level ->in the wddomodifyview . first get the button element from the view and call the set_enabled(abap_false) which should work (as you have done). This can be done by setting an attribute during the selection of the item(action method) and check the same attribute in the wddomodifyview method  to see if it needs to be disabled.

METHOD wddomodifyview .

   DATA btn_approve TYPE REF TO cl_wd_button.

   IF wd_this->appr_visible = abap_false.

    

     btn_approve ?= view->get_element( id = 'F_APPROV' ).

     btn_approve->set_enabled( value = abap_false   ).

    

   ENDIF.

ENDMETHOD.

2. other wise you can bind the enabled attribute to a context attribute and change the value during the select of the item which is much simpler.

Cheers

Former Member
0 Kudos

Hi Chinna,

Thanks for the reply. We tried the code in the wdmodifyview but this was not working. currently an enhancement in CL_IBO_INBOX_FEEDER_WI~ADJUST_ACTIONS_AFTER_LEAD_SEL seems to work. Thanks for the support!

Answers (1)

Answers (1)

Former Member
0 Kudos

Is it possible to put the code to hide in On Select Event of the drop down?