cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable a button on SAP SRM UI Addon?

vimal
Active Participant
0 Kudos

I have a requirement where we want to disable a button as shown below when page opens up in SAP SRM UI Add on.

In following screen , we want to disable "Approver" button .

New to UI5, So Please explain with steps.

Thanks,

Vimal

Accepted Solutions (0)

Answers (3)

Answers (3)

vimal
Active Participant
0 Kudos

Hi,


Following is the solution :

/srmnxp/bd_Change_data - To disable the entities  on UI.

/srmnxp/if_enhance_data_prov~change_data

IF iv_entity_name = 'Approval'.

     FIELD-SYMBOLS<ls_ui_header> TYPE /srmnxp/s_approval.

     FIELD-SYMBOLS<lt__header_ui>   type any table.

     ASSIGN cr_entity->* to <ls_ui_header>.

     IF <ls_ui_header> is assigned.

        <ls_ui_header>-add_approver_a_e = ' '.

     ENDIF.

     ASSIGN cr_entity_set->*     to     <lt_header_ui>.

     IF <lt_header_ui> is assigned.

          LOOP AT <lt_header_ui> is assigned.

               <ls_ui_header>-add_approver_a_e = ' '.

          ENDLOOP.

     ENDIF.

ENDIF.

IF iv_reviewer     =     'Reviewer'.

     FIELD-SYMBOLS<ls_ui_review> type /srmnxp/s_reviewer.

     FIELD-SYMBOLS<lt_ui_review>  type any table.

     ASSIGN     cr_entity->*     to <ls_ui_review>.

     IF <ls_ui_review> is assigned.

          <ls_ui_review>-add_reviewer_a_e     =     '     '.

     ENDIF.

   

     ASSIGN cr_entity_set->*     to     <lt_ui_review>.

     IF <lt_ui_review>     is     ASSIGNED.

          LOOP     AT     <lt_ui_review>     ASSIGNED     <ls_ui_review>.

               <ls_ui_review>-add_reviewer_a_e     =     '     '.

          ENDLOOP.

     ENDIF.

ENDIF.

laurent_burtaire
Active Contributor
0 Kudos

Hello,

please, have a look at file name "Extensibility-Customer_CookBook_SP07.pdf" attached to OSS note 1830075 - User-defined fields: Preparation and use and more precisely to paragraph 2.2.3

Regards.

Laurent.

vimal
Active Participant
0 Kudos

Thanks Laurent. Book is helpful.

Former Member
0 Kudos

Hi Vimal,


You can check in SPRO settings Extension and Field Control --> Control Action --> Configure Control Action on Header/Item level if you have header/Item level buttons.


PDO action type :-  Action name (button u want to disable)
Process mode :- EDIT/DISPLAY mode

object type : Document object type (BUS2121/BUS2201)

Transcation type : SHC/EC

PDO Action enable/disable : X

If u have condition basis disabling the Button add the custom dynamic method.

Hope this helps.


Best Regards,

Siddappa

vimal
Active Participant
0 Kudos

Hi Siddappa,

I tried creating entries as shown below but still button remains enabled.

Please suggest.

Thanks,

Vimal

Former Member
0 Kudos

Hi Vimal,

Please remove check box PDO action enabled and see.

It is possible to disable in webdyanpro component as well.

Please find the webdyanpro component for the screen by disabling the attribute and check with ABAP team to disable this button.

Best Regards,

Siddappa

vimal
Active Participant
0 Kudos

Hi Siddappa,

Tried by removing PDO checkbox but still it does not work.

Also this is SRM UI Addon and it's based on UI5 not on Webdynpro.

Thanks,

Vimal