Error while deploying loop in scripting
Hi
We are working on SAP e sourcing 5.1
I am trying to access all the master agreement with Display_Name beginning with "A" and trying to change expiration date based on an integer value extension field "RENEWAL_DUR_YEAR". I have written the following script for the same
-
import com.frictionless.api.contracts.ContractIBeanIfc;
import java.text.*;
import java.util.*;
import java.lang.*;
import com.frictionless.api.ibean.IBeanHomeLocatorIfc;
import com.frictionless.api.ibean.IBeanHomeIfc;
import com.frictionless.api.contracts.*;
import java.text.SimpleDateFormat;
import com.frictionless.api.ibean.OrderedSubordinateCollectionIfc;
logMsg = Logger.createLogMessage(session);
contractHome = IBeanHomeLocator.lookup(session,com.frictionless.api.contracts.ContractIBeanHomeIfc.sHOME_NAME);
contractList = contractHome.findWhere("DISPLAY_NAME LIKE 'A%' '');
for(Iterator iterator1 = contractList.iterator(); iterator1.hasNext();)
{
ContractIBeanIfc masterAgreement = (ContractIBeanIfc)iterator1.next();
ExpirationDate = masterAgreement.getExpirationDate().getDate();
Calendar cal2=Calendar.getInstance();
cal2.setTime(ExpirationDate);
durationYear = masterAgreement.getExtensionField("RENEWAL_DUR_YEAR").get();
cal2.add(Calendar.YEAR,durationYear);
masterAgreement.setExpirationDate(TypeFactory.createSysDate(cal2.getTime()));
}
-
I am getting the following error:
Error executing script: Sourced file: inline evaluation of: ``import com.frictionless.api.contracts.ContractIBeanIfc; import java.text.*; imp . . . '' : Method Invocation masterAgreement.setExpirationDate.
setExpirationDate is working fine otherwise. Is there something I am missing? please suggest
Regards
Mudit Saini
Edited by: Mudit_UCB on May 18, 2011 10:33 AM
Edited by: Mudit_UCB on May 18, 2011 10:49 AM