Skip to Content
author's profile photo Former Member
Former Member

IPC formula problem

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Feb 28, 2007 at 11:53 AM

    I feel this line BigDecimal valorCusto = (BigDecimal) pricingItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_E); is raising the Exception !

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.