Skip to Content

Get change request number in a implicit enhancement in a method of class CL_BS_BP_OVP_ASSIST

Hi guys! How are you?

I have the following requirement, I need to hide some UIBB dependent on the value of an attribute of the BP_CENTRL entity. I know how to hide the UIBBs, although I do not know if this is the best way (please tell me if there is a best way).

I enhanced the method IF_FPM_OVP_CONF_EXIT~OVERRIDE_EVENT_OVP and in this method I can hide what I need, however there are criteria to show and hide the UIBBs and it's depends on the value of an attribute of the BP_CENTRL entity.

I debugged the code and set breakpoints at several points, first at enhancement and in a feeder class I work with.

When I search for a business partner, before the screen is displayed with the data, it stops 3 times in the enhanced method and finally in the feeder class.

So, I did not see any way to get the change request number in my enhanced method.

The only idea that occurs to me is force another round trip just after the screen is displayed, but I don't know how could I do that and it's looks like a quick and dirty solution but with this I could export the value of the parameter that I need and import it in my enhanced method.

Can someone please help me with this problem? Any ideas?

Best regards,

Ronaldo S, Vieira

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 12, 2018 at 11:44 PM

    Hi Ronaldo,

    Get the context reference using class CL_USMD_APP_CONTEXT and using the method GET_ATTRIBUTES you can get the CR number.

    Then by using CR Apis, you can read the data of BP_CENTRL entity.

    Here is a little help:-

    * Read the CR number if exists.
        DATA(lo_context) = cl_usmd_app_context=>get_context( ).
        CHECK lo_context IS BOUND.
        CALL METHOD lo_context->get_attributes
            ev_crequest_id = DATA(lv_request_id).     " Change Request
        CHECK lv_request_id IS NOT INITIAL.
    *  Get the Instance based on the CR Number
          cl_usmd_crequest_api=>get_instance( EXPORTING iv_crequest           =  lv_request_id
                                                        iv_model_name         =  if_mdg_bp_constants=>gc_bp_model
                                              IMPORTING re_inst_crequest_api  = DATA(lo_cr_api) ).
          CHECK lo_cr_api IS BOUND.
    *  Get the BP_HEADER Entity using the CR_API
          lo_cr_api->read_objectlist(         EXPORTING iv_entity_type        = if_mdg_bp_constants=>gc_bp_model_entity-bp
                                              IMPORTING et_entity             = DATA(lt_object) ).

    LT_OBJECT contains the Business Partner Key.

    Now get the model reference using CL_USMD_MODEL_EXT for 'BP' (Data Model). and Create the data reference for your BP_CENTRL entity & read the values.



    Add comment
    10|10000 characters needed characters exceeded