The user who sends an SAP ERP RFQ to SAP Sourcing is not always the owner of the RFx document. The owner can also be the user who created the RFx template. This template (or templates might have been created by an administrator, who by default becomes the owner of all documents that use this template (see my other post, “How to choose which RFx template in SAP Sourcing should be used?”). Of course, it is possible to add other users and groups as owner, but wouldn’t it be easier if the user who maintains the SAP ERP RFQ is also the owner of the Sourcing RFx document? While this is certainly an item in the SAP Sourcing/CLM backlog bucket, it is currently not available. However, I will present one possible workaround (I am sure there are other ways this can be done).
The idea is simple: make sure that the user ID is sent from SAP ERP through PI to SAP Sourcing, and then run a script which replaces the RFx owner with the user ID from ERP. One prerequisite for this approach is that the users are in sync between SAP ERP and SAP Sourcing (that is, the user IDs in both systems should be identical, otherwise the script needs to be adjusted accordingly). Another prerequisite is that the users have the required permission.
Another approach you could take (and skip any work in SAP ERP and SAP PI) is to create (user) groups in SAP Sourcing with the same ID as your Purchasing Groups. Then, run a script similar to the one described above to add this group as collaborators of the RFx document (note that it is not possible to change the owner of a RFx document to a (user) group, thus the owner might be a generic user).
Let’s start in SAP Sourcing by adding an extension field which retrieves the SAP ERP RFQ user ID.
Make sure that the newly created field RFQUSER is selected to ensure that it is part of the generated XML file. Additionally, make sure (in Page Customization) that this field is read-only so that other users cannot change this field.
Now, we can add the script that we discussed earlier.
xx
Before SAP PI mapping occurs, we need to make sure that the user ID is part of the IDoc. The data in the RFQ document is transformed into the IDoc ORDERS05. This IDoc (by default) will not contain the user name or user ID. However, the segment E1EDL37 has a field called ERMAN (Name of Person who created the Object) which can be used for this purpose. For example, use a user exit to populate this field with sy-uname.
In SAP PI, do the following:
Sample script:
// This script will set the document owner to the value of a string extension field RFQUSER.
// It generates an error if the value of the name is not found in the user account data.
uaName = doc.getExtensionField("RFQUSER").get();
if (hasValue(uaName))
{ // See if this string is a valid user account
userAccountHome = IBeanHomeLocator.lookup(session, doc.getDocumentOwnerUserReference());
userAccountBean = userAccountHome.findByName(uaName);
// Throw an error if the name is invalid
if (!hasValue(userAccountBean))
{
throw doc.createApplicationException("RFQUSER", "invalid name");
}
else
{
// Set the owner in the RFx
doc.setDocumentOwnerUserReference(userAccountBean.getObjectReference());
// Clear the name to avoid this code from being executed again
doc.getExtensionField("RFQUSER").set("");
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
16 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |