cancel
Showing results for 
Search instead for 
Did you mean: 

Rule_Context_Prepare BADI for Supplier Scenario

Former Member
0 Kudos

Hi MDG Experts,

I have a scenario where, in case of change Supplier change request (ZSUP02, We have configured rule based workflow WS60800086), when a User change payment term or partner function then workflow should go to approver A, if payment terms and partner function is not changed then it should go to approver B.

For above scenario i am trying to implement Rule_Context_Prepare BADI. But i am getting below problem:-

1) I am not able to fetch data from UI. Can you please let me know which method should i use to do it or is there any other way. When i am trying to use below standard method, i am getting activated data from backend table, but i need data from UI in order to get the changes in payment term or partner function .

CALL METHOD lr_model->read_char_value

    EXPORTING

      i_fieldname       = 'BP_PORG' " i tried to use BP_PORG entity as i was thinking i might get UI data, but no win.

      it_sel            = lt_sel

      i_readmode        = if_usmd_model_ext=>gc_readmode_default

      if_use_edtn_slice = abap_false

    IMPORTING

      et_data           = <lt_data>.

2) How to get BRF application ID for change request ZSUP02.

3) Structure name for supplier which will hold all the fields specially payment term and partner function fields. (for example for material we have /mdgmm/_s_mm_pp_material)

I am following below document :-

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60f0cc68-5884-2e10-b8a9-a71ba25ad...

Thanks

Regards

Nitish Sharma

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

See this document for how to use the MDG model object:

Also, for getting the BRF application ID, see the example BAdI implementation. There is a method there that shows how you can do that. I think it is called get_object_id or something like that.

Former Member
0 Kudos

Hi Abdullah,

Thanks for reply.

BADI is having its own standard API, which we are trying to check, but neither its taking data from UI nor giving data to BRF.

Can you please tell me the aproach, method names or code etc for this Rule context BADI.

We followed the below link for material, we tried to change it as per supplier, but its not working.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60f0cc68-5884-2e10-b8a9-a71ba25ad...

Can you please let us know if you have implemented same kind of scenario for supplier.

Thanks

Regards

Nitish Sharma

Former Member
0 Kudos

The BAdI has its own "signature" not API. MDG API is uniform across all MDG development objects. Dealing with the model object is the same whether it is Material or Supplier.

Please have a break-point in your implementation and identify where the problem is so that we can help you.

To get the BRF+ ID, see method GET_ELEMENT_ID of class CL_MDG_BS_MAT_BRF_CONTEXT_LABO.

Former Member
0 Kudos

Thanks For Help Abdullah.

It is working fine now.