cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying the quantity field in decimal values

Former Member
0 Kudos

hi

I have created a web dynpro application,and I am calling BAPI functional module from that webdynpro application.

Now the output is being displayed in the second view by giving the input from the first view.

Now my problem is that the quantity value is being displayed as "5" and whereas It should be "5.00".

Is there any setting to be done from the properties end of that particular table.

Please suggest me in this issue.

thanks and regards

kris

Accepted Solutions (1)

Accepted Solutions (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Are you familiar with the DecimalFormatter?



<b>DecimalFormat df = new DecimalFormat("#.00");</b>

elm.setPercentage<b>(df.format(dPercent).toString());</b>


Regards,

Rich Heilman

Former Member
0 Kudos

Adding to what Rich Heilman said.

For the attribute which displays the value as 5.00:

make isCaculated property to true and then it will generate setter and getter functions automatically. In the getter function you can write the logic of making it display as 5.00 instead of 5.

RK

Former Member
0 Kudos

hi Radha,

Thanks for your response.

Can you please let me know where the property isCalculated can be found.I was unable to overcome the problem.

Moreover If you can brief me more on the solution that would be of great help.

We are mapping the node values to the table and displaying the output in that table view.

Is there any way to set the DecimalFormatter for a partuicular mapped column of the table.

thanks and regards

kris

Former Member
0 Kudos

Hi Gopi,

The property in question is "calculated". This is a property of a context value attribute. So select the value attribute in the context to which your field is bound and view the properties. Set "calculated=true". It will generate the accessors.

In the setter method, add the following piece of code:


public void set<your attribute name>(IPrivate<your component>View.IContextElement element, java.lang.String value)
  {
  DecimalFormat df = new DecimalFormat("#.00");
  value = df.format(value).toString(); 
  }

Regards,

Satyajit

Message was edited by: Satyajit Chakraborty

Message was edited by: Satyajit Chakraborty

Former Member
0 Kudos

Hi Satyjit,

Thanks for ur response .

Here iam using Context Attribute and i want to chage the decimal value to that Attribute inly..

Please let me know where can i change What i need to change.

Please guide me for this.

Thanks

BHI

Former Member
0 Kudos

Hi BHI,

Please start a new thread regarding your problem. It's better if we keep different threads for different user problems.

Will definitely help you.

Regards,

Satyajit.

Answers (1)

Answers (1)

Former Member
0 Kudos

closing the thread