cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow approver based on organizational structure

Former Member
0 Kudos

Hi Experts,

I would like to configure a project workflow where approver is selected based on  organizational structure. I'm wondering how to build such structure and how to select correct approver? Is there any standard configuration to do this or needs a script in workflow definition?

As I have this structure already in SAP ERP (tcode PPOMW) is it possible to integrate org structure for workflow from SAP ERP to SAP Sourcing?  If not what would you recommend to fulfill this requirement?

I see that I can assign user to organizational unit and also indicate which user is a supervisor. Is it a good direction?

Thanks for any suggestions.

Marcin Bernat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Marcin,

It sounds like this needs script in the workflow definition to find the approver on the organization unit.

You could create an extension on the organization unit to hold the approver name or group.

I have some example prescript code you could try below. This is with an extension called OrgLevel1AppGrp that holds a group of approvers.

// Create a logger for messaging

logMsg = Logger.createLogMessage(session);

// Step 1: Add level 1 approver from Org Unit

// Get the home and bean for the Org Unit referenced by this project

if (hasValue(doc.getOrganizationalUnitRef()))

{

    orgHome = IBeanHomeLocator.lookup(session, doc.getOrganizationalUnitRef());

    orgBean = orgHome.find(doc.getOrganizationalUnitRef());

    principal =orgBean.getExtensionField("OrgLevel1AppGrp").get();

    if (hasValue(principal))

         {

         // Add the group as the approver

         addApprover(principal,new CollaboratorApprovalRuleType(0));

      

         // log details

         logMsg.setLogMessage("Added group: " + principal.getDisplayName() + " as approver");

         Logger.info(logMsg);

         }

}

I hope this helps.

Dan

Former Member
0 Kudos

Hi Daniel,

I assume from what you wrote, that you've defined "OrgLevel1AppGrp" extension field for "Organizational Unit". Have you managed to link value list for that field with User Groups system dictionary?

I'm trying to do that, added extension field, chose Data Type as "Reference Object" and then there is no Account Group on the list. Any idea how to do that? With Account Users it goes smooth as "User Account" is on the list of objects that you can refer to.

Best regards,

TG

Former Member
0 Kudos

Hi Tomasz,

The extension on the organization unit is an object reference to groups.

If this is not in the list to choose you can set it up yourself under: Setup>Configuration>Extension Reference Types

In this area you will see all of the options that are available when creating an extension of type object reference. If groups is not in the list you can add it in yourself.

Thanks

Dan

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks Daniel,

we're starting scripting.. By the way don't you know whether I can integrate workflow org structure from ERP to SAP Sourcing?

Marcin

Former Member
0 Kudos

Hi Marcin,

There is no mention of organization unit in the SAP integration guide so I do not believe it is possible to interface this information without some sort of customization.

Thanks

Dan