on 01-08-2015 7:37 PM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gr8! question.....if you are a functional consultant please take help from some technical guy
Steps-
1.) Create Enhancement for the WDC /a SAPSRM/WDC_UI_SC_DOFC_HD,shortcut to create enhncement (Ctrl+F4).
2.) Go to Component controller-> Method Process Event.
3.) You will find options to create PRE, POST, OVERWRITE EXITS, click on create POST EXIT.
follow the below link-
http://wiki.scn.sap.com/wiki/display/WDABAP/Enhancing+the+WebDynpro+Component+and+Methods.
And exactly implement my 1st post, your Job will be done
Did you follow the above link?
You have to create an enhancement.
Then after you don't have to go inside that method.
When you got to the methods tab, after enhancement you will find options for creating POST, PRE and OVERWRITE EXITS.
This has been covered in the above shared link too.
There 1st create a POST EXIT and add the new code.
Hey,
This is a tried and tested piece of code and we had covered this requirement long back.
1.) Please check the button IDs used here(ACCEPT/REJECT), they might be different in you's case.
2.) Check the FPM configuration.
3.) Put a break point inside this POST EXIT Created and debug it once.
Also share the screen shot of what you have coded inside this POST EXIT.
Hello Karina,
The button in question is an FPM Button and in SRM we have an extensive meta data framework to control button visibility.
Depending on your release the SM30 views will differ
1. Lower than SRM 702 - SM30 View /SAPSRM/V_MDA_HD
2. SRM 702 and greater - /SAPSRM/V_MDA_H1
A.Here look for
PDO Action Type - EDIT
Bus object Type - BUS2121
You might one more entries based on the mode and you will specifically find a dynamic class and dynamic method which will control the visibility of the button. You might to create overwrite exits for the method and alter the behavior.
This should help you control the UI.
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.
Hello Karina,
These follow the newer methods of adding the enhancement in abap namely pre-exit. post-exit and overwrite exit.This SC link should help you
Thanks,
Veera
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.