on 04-28-2015 10:25 PM
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
Hi Ricardo,
Please create dynamic class/method and assign the same in SPRO and using dynamic method hide the button.
Regards,
Navdeep Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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_TYPE | Importing | Type | BBP_BUS_OBJECT_TYPE |
IV_ACTION | Importing | Type | /SAPSRM/PDO_ACTION_TYPE |
IS_HEADER | Importing | Type | ANY |
IV_MODE | Importing | Type | /SAPSRM/PDO_INST_MODE |
IS_ADD_DATA | Importing | Type | /SAPSRM/S_PDO_META_ACT_ADD_DAT |
CS_METADATA | Changing | Type | /SAPSRM/S_PDO_ACTION_METADATA |
cs_metadata-action_enabled = abap_false.
Hope it will hide the same.
Regards,
Navdeep SIngh
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.