on 07-25-2012 12:32 PM
Hi,
We need to compute a due date based on extension data. Due date is to be specified in months from current date.
correct codding shall be :
--------------------------------
Calendar cal = new Calendar();
Sate dueDate = cal.getDate();
----------------------------------
but this gives a permission exception ( see below )
====================== java.util.Calendar permission ========================== Facility=local4;sessionid=VwOLoS6U9QVKqCVS3Qpa2AOko3iyOAHC00EA_SAP;tenantid=#lundbeck.context.id#;username=asuhanu;exception=Sourced file: inline evaluation of: ``//imports import java.util.ArrayList; import java.util.Iterator; import java. . . . '' : Typed variable declaration : Constructor error: we don't have permission to create an instance : at Line: 97 : in file: inline evaluation of: ``//imports import java.util.ArrayList; import java.util.Iterator; import java. . . . '' : new Calendar ( ) ;stacktrace=Sourced file: inline evaluation of: ``//imports import java.util.ArrayList; import java.util.Iterator; import java. . . . '' : Typed variable declaration : Constructor error: we don't have permission to create an instance : at Line: 97 : in file: inline evaluation of: ``//imports import java.util.ArrayList; import java.util.Iterator; import java. . . . '' : new Calendar ( )
at bsh.BSHAllocationExpression.constructObject(Unknown Source) at bsh.BSHAllocationExpression.objectAllocation(Unknown Source) at bsh.BSHAllocationExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHVariableDeclarator.eval(Unknown Source) at bsh.BSHTypedVariableDeclaration.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at com.sap.odp.comp.scripting.ScriptEnvironment.execute(ScriptEnvironment.java:144)
at com.sap.odp.comp.scripting.ScriptManager.executeDocumentEventScript(ScriptManager.java:1129)
at com.sap.odp.doc.ContainerBo.executeDocumentPhaseChangeScript(ContainerBo.java:5688)
at com.sap.odp.doc.configphase.AbsConfigPhaseHandler.processPhaseChange(AbsConfigPhaseHandler.java:732)
at com.sap.odp.doc.configphase.AbsConfigPhaseHandler.processPhaseChangeNoValidation(AbsConfigPhaseHandler.java:588)
at com.sap.odp.usermgmt.vendormgmt.AbsVendorMgmtBo.changePhaseToCreated(AbsVendorMgmtBo.java:887)
at com.sap.odp.usermgmt.vendormgmt.vendormodification.WorkflowVendorModificationUIRQHook.postAddHook(WorkflowVendorModificationUIRQHook.java:135)
at com.sap.odp.doc.display.util.AddDocRQ.processAddRequest(AddDocRQ.java:323)
at com.sap.odp.doc.display.util.AddDocRQ.processRequestHook(AddDocRQ.java:154)
at com.sap.odp.doc.display.util.AbsDocRQ.processRequest(AbsDocRQ.java:198)
at com.sap.odp.doc.display.util.AbsRQ.run(AbsRQ.java:110)
at java.lang.Thread.run(Thread.java:708)
;Sourced file: inline evaluation of: ``//imports import java.util.ArrayList; import java.util.Iterator; import java. . . . '' : Typed variable declaration : Constructor error: we don't have permission to create an instance Sourced file: inline evaluation of: ``//imports import java.util.ArrayList; import java.util.Iterator; import java. . . . '' : Typed variable declaration : Constructor error: we don't have permission to create an instance : at Line: 97 : in file: inline evaluation of: ``//imports import java.util.ArrayList; import java.util.Iterator; import java. . . . '' : new Calendar ( )
Sourced file: inline evaluation of: ``//imports import java.util.ArrayList; import java.util.Iterator; import java. . . . '' : Typed variable declaration : Constructor error: we don't have permission to create an instance : at Line: 97 : in file: inline evaluation of: ``//imports import java.util.ArrayList; import java.util.Iterator; import java. . . . '' : new Calendar ( )
at bsh.BSHAllocationExpression.constructObject(Unknown Source) at bsh.BSHAllocationExpression.objectAllocation(Unknown Source) at bsh.BSHAllocationExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHVariableDeclarator.eval(Unknown Source) at bsh.BSHTypedVariableDeclaration.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at com.sap.odp.comp.scripting.ScriptEnvironment.execute(ScriptEnvironment.java:144)
at com.sap.odp.comp.scripting.ScriptManager.executeDocumentEventScript(ScriptManager.java:1129)
at com.sap.odp.doc.ContainerBo.executeDocumentPhaseChangeScript(ContainerBo.java:5688)
at com.sap.odp.doc.configphase.AbsConfigPhaseHandler.processPhaseChange(AbsConfigPhaseHandler.java:732)
at com.sap.odp.doc.configphase.AbsConfigPhaseHandler.processPhaseChangeNoValidation(AbsConfigPhaseHandler.java:588)
at com.sap.odp.usermgmt.vendormgmt.AbsVendorMgmtBo.changePhaseToCreated(AbsVendorMgmtBo.java:887)
at com.sap.odp.usermgmt.vendormgmt.vendormodification.WorkflowVendorModificationUIRQHook.postAddHook(WorkflowVendorModificationUIRQHook.java:135)
at com.sap.odp.doc.display.util.AddDocRQ.processAddRequest(AddDocRQ.java:323)
at com.sap.odp.doc.display.util.AddDocRQ.processRequestHook(AddDocRQ.java:154)
at com.sap.odp.doc.display.util.AbsDocRQ.processRequest(AbsDocRQ.java:198)
at com.sap.odp.doc.display.util.AbsRQ.run(AbsRQ.java:110)
at java.lang.Thread.run(Thread.java:708)
Can anyone help me with this ?
Regards,
Stefan
Hi Stefan,
Could you try
cal = Calendar.getInstance();
Regards,
Vikram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vikram,
That seemed to work. Thank you for your input !!
Regards,
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.