cancel
Showing results for 
Search instead for 
Did you mean: 

Hide/Disable Edit button

former_member210118
Participant
0 Kudos

Hello friends.

I'm in need of your help.

I need to Hide or Disable the EDIT button you see in the screen:

Does anyone know how and where I can do this ?

I already tried creating an enhancement in webdynpro component FPM_OIF_COMPONENT in CNR_VIEW but I don't know how to get the Edit Button to disable or hide it.

If you have any idea of how to do it, please share.

Thank you,

Ricardo Monteiro

Accepted Solutions (1)

Accepted Solutions (1)

Navdeepbhat
Explorer
0 Kudos

Hi Ricardo,

Please create dynamic class/method and assign the same in SPRO and using dynamic method hide the button.

Regards,

Navdeep Singh

former_member210118
Participant
0 Kudos

Hello Navdeep Singh

Thank you for your reply.

I've just done the configuration but the button keeps appearing. Is the class/method implementation mandatory for button to disappear ?

Here's a screenshot on what I did in the SPRO path Go to SPRO->SRM Server->Cross Application Basic Setting ->Extensions and Field Control -> Control Actions-> configure control of Actions on Header Level.

With this, the button still appears and/or is not disabled.

But as you can see, I didn't implement any customer class / method, is it necessary ?

Thank you,

Ricardo Monteiro

Navdeepbhat
Explorer
0 Kudos

Hi Ricardo,

if you need to display/Hide Button based on some condition then put the logic in Method else put by default as below code in method:

Create Custom Class and method

Method parameters :

IV_OBJECT_TYPEImportingTypeBBP_BUS_OBJECT_TYPE
IV_ACTIONImportingType/SAPSRM/PDO_ACTION_TYPE
IS_HEADERImportingTypeANY
IV_MODEImportingType/SAPSRM/PDO_INST_MODE
IS_ADD_DATAImportingType/SAPSRM/S_PDO_META_ACT_ADD_DAT
CS_METADATAChangingType/SAPSRM/S_PDO_ACTION_METADATA

cs_metadata-action_enabled = abap_false.

Hope it will hide the same.

Regards,

Navdeep SIngh

former_member210118
Participant
0 Kudos

Hi Navdeep Singh,

That's what I did (as you can see in the images), but the EDIT button still appears and or enabled .

As you can see the button is still there and active

Do you think it can be some enhancement that is doing the enabling of the button in hardcode ?

Thanx,

Ricardo

Navdeepbhat
Explorer
0 Kudos

Hi Ricardo,

Can you please let me know have you done some enchacement in PDO.IDEN Class for same.

Please tick Checkbox PDO Action Enabled and then check the same.

Regards,

Navdeep Singh

former_member210118
Participant
0 Kudos

Navdeep,

I've tried ticking the PDO Action, but button keeps the same.

"Can you please let me know have you done some enchacement in PDO.IDEN Class for same."

What class are you referring to ?

Navdeepbhat
Explorer
0 Kudos

HI Ricardo,

We have Control Buttons Visibility in RFX(BUS2200) like this only and it's working fine.

Like this it's working fine in our scenario.

Regards,

Navdeep Singh

former_member210118
Participant
0 Kudos

Navdeep,

I really think this should be some hardocoded somewhere saying to always show the EDIT button because  I just tested the same scenario with the COPY button with success.

Answers (4)

Answers (4)

former_member219747
Participant
0 Kudos

Hi Ricardo, Please follow the below steps to enable the EDIT button- 1.) Look for the technical details and go to the Component Controller of WDC. 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 iv_visible    = 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 iv_visible    = abap_true ENDIF. please let me know if you need any further clarifications. Regards, Mrityunjai

former_member228602
Contributor
0 Kudos

Hello Ricardo,

     Some times edit button might be subject of Workflow and your code will be overridden by workflow. The better place to write a overwrite exit would be /SAPSRM/CL_PDO_META_BO_SC method  /SAPSRM/IF_PDO_META_CONSUMER~GET_ACTION_METADATA and you could check the field iv_action specifically for "EDIT"  and set the visibility to false.

Thanks and Regards,

Veera

Former Member
0 Kudos

Hi Ricardo,

We have did the same in our project,This can be achived through technical changes. Please check with your Webdyn PRO consultant to do so.

Rgds,

Nayeem.

nishantbansal91
Active Contributor
0 Kudos

Dear Ricardo,

If not possible from here, you can go for the Configuration level changes at FPM level.

but there u can't put any condition over there.

Thanks

Nishant