Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

decimal value problem

Former Member
0 Likes
1,018

hi Experts,

I have created the alv grid report to display the balance periodic wise.

the report is displaying fine but the amount value in the report is not displaying the decimal value correctly .

for EX: i have the previous balance 1,455,932.41- and this month balance 8,075,892.48 then the cum.balance should be 6,619,960.07 but it is displaying 6,619960.48 and when we add to next month value 186 it is displaying 6,620,146.00.

the data type i have used is 'CURR'.

please suggest me what to do and what is the reason behind this problem .

thanks

Shambuling

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
986

Hi,

Check wether your Adding Values Data type and Destination variable data type same or not.

Thanks

Mani

9 REPLIES 9
Read only

Former Member
0 Likes
987

Hi,

Check wether your Adding Values Data type and Destination variable data type same or not.

Thanks

Mani

Read only

0 Likes
986

hi nagamani

thanku for reply

i am storing the field val\ amount of that month in to the variable bal which is of type i,

is because of it its is displaying link that.

Read only

0 Likes
986

Hi Shambuling,

Instead of using type i, try declaring the variable like

data bal type p decimals 3.

This will solve your problem.

Read only

0 Likes
986

hi Aniket

Thank you very much that solved the issue. the report is fine now .

regards

Shambuling

Read only

vinoth_aruldass
Contributor
0 Likes
986

hi,

for currencies its always better to use packed decimals,

the problem occured because while calculating your decimal value is changing . so use standard decimal 2 or three in both the values.

hope it helps,

Vinoth

Read only

0 Likes
986

hi vinoth

thanks it solved the issue

Read only

yogendra_bhaskar
Contributor
0 Likes
986

Hi Shambuling ,

Can you be more specific how you are declaring and calculating the balance .

if you can provide the code , it will be more helpful to solve the issue

Read only

0 Likes
986

hi yogendra

thank you for reply .

i have stored the previous month amount in the variable when the loop is executed the field value is added with the previous balance and displayed .

ex fldval  = bal + fldval1.

regards

Shambuling

Read only

0 Likes
986

thank you yogendra for helping