cancel
Showing results for 
Search instead for 
Did you mean: 

Java compilation error in Web Dynpro

Former Member
0 Kudos

Hi Experts,

I have to write one line like this in Java program of Web Dynpro:

wdContext.currentPritemElement().setPreq_Price("1.544");

This is not getting compiled. The error is "The method setPreq_Price(BigDecimal) in the type IPrivateMyView.IPritemElement not applicable for arguments(string)".

It looks like there is datatype mismatch and due to this we are getting above error. We Can we do some like typecasting etc to sort out the issue. If yes, how we can do so.

Regards,

Ravindra

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravindra,

The error is because of data type mismatch.

You can do like this:

wdContext.currentPritemElement().setPreq_Price(new BigDecimal(1234));

Thanks.

Best Regards,

Shiva

Former Member
0 Kudos

Hi Shiva,

Thanks. The issue got sorted out using your solution.

Regards,

Ravindra

Answers (1)

Answers (1)

Greg_Austin
Active Participant
0 Kudos

"1.544" is a string. To store this in the context element you either have to change the properties of the element to be either String or double, or create a BigDecimal object with the value of 1.544. To create a BigDecimal in the context change the code to wdContext.currentPritemElement().setPreq_Price(new BigDecimal(1.544));