cancel
Showing results for 
Search instead for 
Did you mean: 

web dynpro + adobe form decimal field round off

Former Member
0 Kudos

hello all,

I am now developing an application which is based on the SAP WebDynpro and Adobe form, but the application has an error, if one can help me to resolve the error, I will be very thankful.

The error is as follows, for a decimal filed on the Adobe form which is binded to a deicmal attribute of Webdynpro, if I get the value of the decimal field using the programming code as "context.nodexx.getAttribute("xx")", the decimal value is rounded off (e.g., 2.4 is changed to 2.0, 2.7 is changed to 3.0).

for example:In Web Dynpro, A node name is "TestNode" which has a type of decimalattribute named "TestAttr" , in adobe form a decimal field bind to the TestAttr . when i input 2.3 in adobe form, i click the button with code:

this.wdComponentAPI.getMessageManager.reportSuccess(this.wdContext.nodeTestNode.getTestAttr()+"");

the rusult is : 2.0

if i input the value 2.5 the result will be 3.0

Thanks All !

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member214651
Active Contributor
0 Kudos

Hi,

Try using float / double for displaying the decimal numbers. Previously I had encountered the same problem in WebDynpro by using the decimal attribute.

Regards,

Poojith MV

Former Member
0 Kudos

i am sorry for not completely describing my problem .

I also used the double value for the decimal field in the adobe form designer . But what troubles me is that the double value has default value displayed in the adobe form ,but i do not want it to display if its value is 0 fg. I designed the decimal field with BigDecimal object in Java because of it can be null. But , if it is double type ,it can not be null and adobe form will uglily print 0 where i wish it should be nothing to display

Thanks anyway . Hope for deeper communication!

Former Member
0 Kudos

Hi,

there is a special display pattern to check for null values:


null{pattern}

Example:


null{'please enter a value'}

But I don't know if WDJ is really sending a null value. You can combine this with alternatives using '|' to separate alternatives.

Regards,

Juergen