on 02-04-2013 2:12 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.