cancel
Showing results for 
Search instead for 
Did you mean: 

SU(special user) agent type in BRF+ decision tables

former_member193350
Active Participant
0 Kudos

Dear Experts,

Could anyone please explain the significance of SU(special user) agent type in BRF+ decision tables. Suppose I have selected SU instead of US (user) in agent type then what should be the value in the user agent value field.

Thanks in advance!!

Regards

Prateek Agarwal

Any useful answers will be rewarded.

Accepted Solutions (1)

Accepted Solutions (1)

former_member247058
Participant
0 Kudos

Hi, in addition to Tommy Lee's answer: there should be also the option to assign the last user, by choosing LAST for option SU.

Regards,

Hans-Ulrich von Helmolt

former_member193350
Active Participant
0 Kudos

Hi,

Thanks for your reply. I understood the INIT concept but could you please elaborate the

choosing LAST option. How would we know who is the last user?

Regards

Prateek Agarwal

former_member247058
Participant
0 Kudos

Hi,

You don't need to know this in advance. By specifying LAST the workflow runtime assigns the workflow to the user that had the task before the actual task with the current user who performs an action which leads to the condition alias pointing at SU LAST. Mechanism is the same as for INIT in principle  (in the workflow log you can see this as well).

Regards,

Hans-Ulrich von Helmolt

former_member193350
Active Participant
0 Kudos

Hi,

Thanks for your reply.

Could you please explain how  can we implement Job(C) , Organization unit(O), Position (S) user agent type in SAP MDGM.

I tried to create an organizational structure and staffing in ECC (tcode PPOC) and in brf+ assigned that position and organizational unit name in the user agent value of decision table. But when i create a change request and select the workflow log it is showing "NO current processor " and when i use US in user agent type it is working fine.

Do you have any idea how to implement with Job(C) , Organization unit(O), Position (S).

Any screenshot or document link will be really helpful.

Regards

Prateek Agarwal

Useful answers will be rewarded.

former_member247058
Participant
0 Kudos

HI, did you assign the internal Org number or just the name you assigne to it?

You find this from PPOC in the Goto-Menu which leads to you to tcode PP01 where you get the internal key which you need to specify for BRF+.

Kind regards,

Hans-Ulrich von Helmolt

former_member193350
Active Participant
0 Kudos

Hi Helmolt,

Thanks for this useful helpas i am strucking in this and not able to proceeding.

Yes, previously i am using the name in the user agent value for the organizational unit, position and job. But after your response i changed the name to that object ID and it starts working.

Thanks again...

Regards

Prateek

former_member193350
Active Participant
0 Kudos

Hi Helmolt,

One more query, Is it possible in MDG to pick the hierarchy of the management from organization structure for next level of approval ?

For example, I want to pick an employee based on some criteria to approve the general data and after his approval his manager has to approve some critical data in the change request. So. is it possible to pick the manager from organization hierarchy based on the employee who approved it?

Regards

Prateek Agarwal

former_member247058
Participant
0 Kudos

Hi Prateek,

I am sure that this is possible, but, sorry, I can't tell you how, since I don't know how to retrieve the org assignment from the user and subsequently the superior position dynamically.

Of course, this is possible if you want to input the knowledge about the org structure into the decision table explicetly. This would make sense for simple cases only, however. You could try to derive the position (superordinate) from the user and step number.

Regards,

Hans-Ulrich von Helmolt

PS: My first name is Hans-Ulrich, not Helmolt

Former Member
0 Kudos

Hi Prateek,

  As Hans-Ulrich mentioned, it is possible to do anything using rule based workflow by using the BADIs. In this case, you would have to implement the Dynamic User Determination BADI for the approval step and do the following within this BADI.

- Find out the workitems of the CR using the FM SAP_WAPI_WORKITEMS_TO_OBJECT. Preapre the object key properly using the following code

     DATA lv_realchange_request_number TYPE mdg_crequest.

     DATA lv_object_id TYPE drf_object_id.

     lv_realchange_request_number = lv_mdg_change_request_number && '000000'.

     lv_obj_id = '000000' && lv_realchange_request_number.

- Delete the workitems which are not dialogue type and not completed (using fields wi_type and wi_stat) i.e you get only the dialogue workitems which are already processed

- sort the workitems by ID in descending order and take the user (field WI_AAGENT) from the top item. This will give you the user who has processed the last dialogue step in your workflow.

- Check the thread http://scn.sap.com/thread/63926 on how to get the manager of the employee and use the ID it returns to assign as processor

If your workflow is complex with parallel steps, it needs a very different approach to resolve your problem. Let me know if you face any issues.

MDG experts please clarify if we can solve this issue with more simple code.

Best Regards,

Kiran

Former Member
0 Kudos

Hi Hans-Ulrich,

I am new in BRF+, could you please help me in detail on how to implement org structure into the decision table explicitly? What are the other parts in BRF+ should be adjusted? (Functions, Ruleset, etc?). My org structure so far is pretty simple, employee A has Manager A as the CR approver.

Currently I am implementing MDG for Material rule based Workflow using BRF+ and need to differentiate approver based on each requester, i.e. CR from Requester Plant A should go to Approver Plant A.

Thank you in advance.

Regards,

Lingga

former_member247058
Participant
0 Kudos

Hi, for me your example rather sounds like you'd better use rolesor user than an org structure. But this is up to you. You need to follow http://scn.sap.com/docs/DOC-14881 (extensibility guide for BRF+ controlled WF). YOu find this in the list of all extensibility guides  in http://scn.sap.com/docs/DOC-7858.

Instead of using field LABOR you need to enhance the interface to BRF+ by the field plant (WERKS) and then you can adapt DT_USER_AGT_GRP_MAT01 like described in the How-to-guide accordingly.

Kind regards,

Hans-Ulrich von Helmolt

Former Member
0 Kudos

Hi Hans-Ulrich,

the solution in the How-to-Guide looks similar with our case. We have tried to implement it and tried to retrieve the WERKS field instead of LABOR in the BADI. However we had difficulties to get its value as I assume it doesn't exist in MARA table/directly under entity MATERIAL or not defined as Attribute (from MDGIMG in Visualize Data Model MM, under folder MARCxx, I found WERKS is defined as "Qualifying entity type" instead of Attrribute).

In BRF+ itself, adding WERKS in new column on table DT_USER_AGT_GRP_MATxx is not a problem. However since BADI could not determine the WERKS value, the workflow could not find the agent.

Could you maybe explain in detail what exactly needs to be done in BADI so that it could generate the WERKS value (instead of LABOR) from the Change Request?

Thank you in advance.

Best regards,

Lingga

former_member247058
Participant
0 Kudos

Hi Lingga,

In my answer I assumed of course that you adapt the example accordingly, because I know, of course, that the plant is not part of the root entity MATERIAL ;-))

One question in davance: are you sure that you really want to use the field plant (WERKS) as key criterion for BRF+? Reason for this question: what happens if the requester enters more than one plant and they belong to different approvers? You can't split the CR easily and you can't avoid this situation without further actions (for instance checks or UI adaptations). If, however, it were solely user dependent, then you could use the BRF+ built-in function CURRENT_USER as column in the decision table instead without further enhancement.

Let's assume for now that it is a given that only one plant is entered, then you need to read the plant data for the material by specifying this in method lr_model->read_char_value by using the appropriate constant (I would recommend to use GC_ENTITY_MARCBASIC, because this is the leading entity and will always be present). That should be it. (I am not exactly sure if you need to call the same method before for the entity MATERIAL, but I don't believe it, so just try it ;-)) ).

By the way, I assumed that you only use single object CRs in here, like in the extensibility guide.

Regards,

Hans-Ulrich

Answers (2)

Answers (2)

Former Member

Hello

When you choose Agent Type SU, and if you put INIT then the workflow will go to the initiator of the workflow.

shrimogarge
Explorer
0 Kudos

Hi,

Do we have any user agent values for the first, second, or Last user/approver in the workflow, just INIT for Initiator?

SugguSandeep
Active Participant
0 Kudos

Hi Shriniwas Mogarge,

  1. Non-User - Foreground Action Takes Place
  2. User Agent Decision Table - User Agent value Will be (INIT) Initiator as it's background process, to start the workflow Initiator must be there & ending will be nothing that's the thing will take care of Non-User
  3. Single Value Decision Table - Each & every step need to define, even between step after step what's need to perform should be define...

Still Not Clear Let me know, will provide more information 🙂

Thank You,

Suggu Sandeep.