Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to run script in Test Mode

Hi All

We are working on SAP e sourcing 5.1. I have written a method wherein I am trying to deploy a while loop. However I am a bit skeptical about this resulting in an infinite loop and that is why I want to run this script in test mode first. Is there any way in e sourcing for achieving the same. Plz guide

-


SetRenewalDate (ContractIBeanIfc masterAgreement)

{

ExpirationDate = masterAgreement.getExpirationDate().getDate();

Calendar cal=Calendar.getInstance();

Calendar currentcal= Calendar.getInstance();

cal.setTime(ExpirationDate);

currentcal.set(currentcal.get(Calendar.YEAR),

currentcal.get(Calendar.MONTH), currentcal.get(Calendar.DAY_OF_MONTH));

While(!(cal.after(currentcal)))

{

Calendar cal2=Calendar.getInstance();

cal2.setTime(ExpirationDate);

durationYear = masterAgreement.getExtensionField("RENEWAL_DUR_YEAR").get();

cal2.add(Calendar.YEAR,durationYear);

if(masterAgreement.isObjectAccessModeEdit())

{

masterAgreement.setExpirationDate(TypeFactory.createSysDate(cal2.getTime()));

masterAgreement.getExtensionField("DAT_EXP").set(masterAgreement.getExpirationDate());

cal= masterAgreement.getExpirationDate().getDate();

}

else

{

masterAgreement.getIBeanHomeIfc().upgradeToEdit(masterAgreement);

masterAgreement.setExpirationDate(TypeFactory.createSysDate(cal2.getTime()));

masterAgreement.getExtensionField("DAT_EXP").set(masterAgreement.getExpirationDate());

masterAgreement.getIBeanHomeIfc().save(masterAgreement);

masterAgreement.getIBeanHomeIfc().downgradeToView(masterAgreement);

cal= masterAgreement.getExpirationDate().getDate();

}

}

}

-


Regards

Mudit Saini

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question