cancel
Showing results for 
Search instead for 
Did you mean: 

import package "com.sap.odp.api.* " in script definition not working in ESourcing 7

Former Member
0 Kudos

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);

}

}

}

}

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

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

Former Member
0 Kudos

Hi Vikram,

Thanks. but the script was working in ESO 5.1 version. Let me check at the code level. Thanks again for your valuable information.

Vimal