Skip to Content
0
Former Member
Feb 28, 2007 at 10:37 AM

IPC formula problem

21 Views

Hello,

I'm having problems with this simples formula:

public class ZIVAOfertas extends BaseFormulaAdapter{

public BigDecimal overwriteConditionBase(IPricingItemUserExit pricingItem,

IPricingConditionUserExit pricingCondition) {

BigDecimal valorCusto = (BigDecimal) pricingItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_E);

BigDecimal valorLimite = new BigDecimal(14.95);

if (valorCusto.compareTo(valorLimite) < 0){

pricingCondition.setConditionRateValue(PricingTransactiondataConstants.ZERO);

return PricingTransactiondataConstants.ZERO;

}

return null;

}

}

This object is throwing the exception java.lang.ClassCastException: com.sap.spe.conversion.impl.CurrencyValue at runtime, but I'm not sure at what line (since I can't seem to attach the debugger).

I need to compare and constant value (14.95) with subtotal E. If it is lower then 14.95 then the condition base must be set to 0. Any suggestions?

EDIT: Main problem is I can't convert ICurrencyValue to BigDecimal. How do I deal with this?

Message was edited by:

João Sousa