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

Remove Two Digits After Decimal

Former Member
0 Likes
786

Hello Experts,

Please resolve my Problem......

As i am Working on 4.7, Here i am facing one problem, in my report i am getting vendor closing balance and vendor opening balance through function BAPI_AP_ACC_GETKEYDATEBALANCE. Here after executing this function i am getting output like:

keybalance-T_CURR_BAL = 17500.0000.

when i am passing this value to my temp variable which is like bseg-dmbtr i am getting 1750000.00

But now user requirement is user only wants 2 digits after decimal like 17500.00. I am unable to get this value kindly resolve my problem.

Regards

Shelly Malik

5 REPLIES 5
Read only

Former Member
0 Likes
721

Hi,

you should use an intermediary variable for this like

data new_var(8) type p decimals 2.

keybalance-T_CURR_BAL = 17500.0000

move keybalance-T_CURR_BAL to new_var

move new_var to temp variable.

Read only

0 Likes
721

Hi,

Still it is Doing same thing.....

keybalance-T_CURR_BAL = 17500.0000.

vtemp = 1750000.00.

where vtemp is like p(16) decimal 2.

Read only

Former Member
0 Likes
721

dear,

you can take one global variable like

data: gv_var type p decimals 2.

and assign the value which you are getting after bapi to this variable.

now you will get only two digits after decimal.

regards.

Srinivas

Read only

Former Member
0 Likes
721

Check Program attributes, Fixed Point Arithmetic should be set to true.

Regards

Vinod

Read only

Former Member
0 Likes
721

Resolved by myself