on 09-18-2012 6:13 PM
Hi guys,
import package "com.sap.odp.api.* " not working in script definition in ESourcing 7.
Recently we upgraded the Esourcing System from 5.1 to 7 and i tried changing the import packages in the scripts (below sample code) but it is not working. Below is the error logs.
Error Logs
Sourced file: inline evaluation of: ``import com.sap.odp.common.log.Log; import com.sap.eso.api.doccommon.masterdata. . . . '' : Can't new: void : at Line: 162 : in file: inline evaluation of: ``import com.sap.odp.common.log.Log; import com.sap.eso.api.doccommon.masterdata. . . . '' : new Price ( costReduce .getDimensionReference ( ) , calcSavings )
Below is the code.
try {
baseCurr = null;
calcSavings = 0.00;
ObjectReferenceIfc costReduce = doc.getExtensionField("costReductionAmt").get();
ObjectReferenceIfc costAvoid = doc.getExtensionField("CostAvoidanceAmt").get();
/* i = ClassInfo.getClassIdFromName("masterdata.Currency");
id = costReduce.getDimensionId();
objRef = new ObjectReference(i, id);
logInfo("**** objReference: " + objRef);
objRef.setDisplayName(baseCurr);
*/
newPrice = new Price(costReduce.getDimensionReference(), calcSavings);
logInfo("**** newPrice : " + newPrice);
doc.getExtensionField("TotalSavings").set(newPrice);
logInfo("**** totalSavings (After): " + doc.getExtensionField("TotalSavings").get());
}
catch (Exception e) {
log.setLogMessage(e.toString());
log.setException(e);
Logger.error(log);
}
}
}
}
Hi Vimal,
The error you are getting is not related to the import statements. Looks like you are trying to set a price. You would have to use the TypeFactory class.
Regards,
Vikram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.