cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow PostScript not working

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member207877
Active Participant
0 Kudos

Hello Sudipta,

Its the workflow process owner who opens and edits the document not the owner.

Check whether the process owner is getting added in collaborators(read/write) once the workflow is initiated.

Raj

Former Member
0 Kudos

Hi Raj, 

Thanks for your reply .

Yes this is as per standard process - workflow owner is automatically added to change the document  with read/write access once the workflow is initiated.

Thanks

Sudipta