Quantcast
Channel: SCN: Message List - Supplier Relationship Management (SAP SRM)
Viewing all articles
Browse latest Browse all 6690

Re: Enable Edit button in FPM_OIF_COMPONENT

$
0
0

Hi Karina,

 

Please follow the below steps to enable the EDIT button-

 

1.) Go to the Component Controller of WDC /SAPSRM/WDC_UI_SC_DOFC_HD.

 

2.) Create a Post-Exit on the method Process Event in the WD Component Controller.

 

3.) Copy paste the below code here to read all the buttons in a table.

 

     DATA: lo_fpm                   TYPE REF TO       if_fpm,
      lo_cnr_oif              
TYPE REF TO       if_fpm_cnr_oif,
      lt_buttons              
TYPE              if_fpm_cnr_oif=>t_button,
      ls_button               
LIKE LINE OF      lt_buttons,


     lo_fpm = cl_fpm_factory=>get_instance( ).
      lo_cnr_oif ?= lo_fpm-
>get_service( cl_fpm_service_manager=>gc_key_cnr_oif ).

*   get all the FPM buttons
CALL METHOD lo_cnr_oif->get_buttons
IMPORTING
et_buttons
= lt_buttons[].

4.) Now consider the role assignment according to your's project requirement here.


5.) Further copy this code to enable the EDIT Button.


IF io_event->mv_event_id = 'FPM_EDIT'.
*   read  button with ID, which you created while creating FPM configuration
READ TABLE lt_buttons[] INTO ls_button WITH KEY element_id = 'ACCEPT'.
IF sy-subrc IS INITIAL.

*     define button as enabled or disabeld
CALL METHOD lo_cnr_oif->define_button
EXPORTING
iv_function  
= ls_button-function
iv_element_id
= 'ACCEPT'
iv_enabled   
= abap_true

ENDIF.

READ TABLE lt_buttons[] INTO ls_button WITH KEY element_id = 'REJECT'.
IF sy-subrc = 0.
*     define button as enabled or disabeld
CALL METHOD lo_cnr_oif->define_button
EXPORTING
iv_function  
= ls_button-function
iv_element_id
= 'REJECT'
iv_enabled   
= abap_true

ENDIF.

please let me know if you need any further clarifications.


Regards,

Mrityunjai


Viewing all articles
Browse latest Browse all 6690

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>