Hello Experts ,
We are on SAP Sourcing 10 . We are using workflow for project documents. Currently we have a scenario where certain checkboxes have to be checked immediate after the approver approves the project document .
To accomplish that , I have created postscript in workflow which will check if the document is approved and then check the checkbox . However , I see that the checkbox is not getting checked after approval . However document is moved successfully to next stage and getting unlocked . Checkbox name is - Z_WF_COMMGR
The code in postscript -
// getting project home
projectHome = IBeanHomeLocator.lookup(session,com.sap.eso.api.projects.ProjectIBeanHomeIfc.sHOME_NAME);
proj_id= doc.getDocumentId();
myProjHome1 = IBeanHomeLocator.lookup(session, ProjectIBeanHomeIfc.sHOME_NAME );
relProjectIfc = myProjHome1.findForEditByUniqueDocName(proj_id);
if (getApprovalStatus() == APPROVED ){
try{
projectHome.upgradeToEdit(doc);
relProjectIfc .getExtensionField("Z_WF_COMMGR").set(true);
}
catch(e){
logMsg.setLogMessage(e.toString());
logMsg.setException(e);
Logger.error(logMsg);
}
}
When I check the log I see the below info but the workflow owner has all the rights to change the project document .
com.sap.odp.api.common.exception.ApplicationException: You cannot view the document because you do not have sufficient permissions. Contact the document owner to request access to it.
ValidatingParent=-2147482721:1100:From Template Strategic Sourcing Comm & - com.sap.odp.api.common.exception.ApplicationException: You cannot view the document because you do not have sufficient permissions. Contact the document owner to request access to it.
at com.sap.odp.doc.DocAuthorizer$AssureDocAuthorizer.assureCanViewDocument(DocAuthorizer.java:757)
at com.sap.odp.doc.AbsDocDb.findDocCommon(AbsDocDb.java:201)
at com.sap.odp.doc.AbsDocDb.findDocCommon(AbsDocDb.java:147)
at com.sap.odp.doc.AbsDocDb.find(AbsDocDb.java:127)
at com.sap.odp.doc.AbsDocDb.find(AbsDocDb.java:57)
at com.sap.odp.doc.ContainerHome.find(ContainerHome.java:314)
at com.sap.odp.doc.configphase.AbsPhaseConfigSubBo.getParentPhaseConfigContainer(AbsPhaseConfigSubBo.java:258)
at com.sap.odp.doc.configphase.AbsPhaseConfigSubBo.postFindHook(AbsPhaseConfigSubBo.java:531)
at com.sap.odp.doc.ContainerBo.postFind(ContainerBo.java:2232)
at com.sap.odp.doc.ContainerDocBo.postFind(ContainerDocBo.java:665)
Thanks
Sudipta