Skip to Content
avatar image
Former Member

Enable Edit button in FPM_OIF_COMPONENT

Hi all,

I'm new in SRM and I need some guidance.

I have the requirement to enable button edit in the next screen:

This is the technical help:

They want this:

Is the same component, but I don't know where could I change that. What should I do?

Thanks in advance, best regards!

1.png (38.8 kB)
2.jpg (135.0 kB)
3.jpg (59.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 09, 2015 at 09:18 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • Jan 16, 2015 at 10:57 AM

    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

    Add comment
    10|10000 characters needed characters exceeded