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

Problem in decimals values

Former Member
0 Likes
1,196

Hi all,

Have problem in the decimals values , please find the Examples

Ex: DATA: l_var1(11) TYPE p DECIMALS 4 ,

l_var2 TYPE KOmV-KBETR."

l_var1 = '29.7250' .

l_var1 = l_var1 * 1000.

l_var3 = l_var1 .

write: l_var3.

correct values is : 29725.00

am get the values 2972500.00.

Please guide me how to correct

Regards,

San

10 REPLIES 10
Read only

Former Member
0 Likes
1,152

Where is l_var3? How have you declared that?

Vikranth

Read only

0 Likes
1,152

Hi Vikranth,

Thanks for the replying, have corrected in the code please guide me how to come out problem .

Ex: DATA: l_var1(11) TYPE p DECIMALS 4 ,

l_var3 TYPE KOmV-KBETR."

l_var1 = '29.7250' .

l_var1 = l_var1 * 1000.

l_var3 = l_var1 .

write: l_var3.

correct values is : 29725.00

am get the values 2972500.00.

Please guide me how to correct

Regards,

San

Read only

0 Likes
1,152

Check with other calculation problems....

and as well as your profile settings also..

in my system report is coming fine.

Regards

sas

Read only

0 Likes
1,152

Hi saslove,

This is happening at the time of the routines in the VF01 while passing the values into XKOMV-KBETR (L_VAR3) field .

Regards,

San

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,152

Hello Santosh,

What is the reference UoM or Currency Key for this particular field?

Check the number of decimal places allowed for the same.

BR,

Suhas

Read only

0 Likes
1,152

Or may be related to the setting "FIXED POINT ARITHMETIC" in Main program ?

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,152

>

> Or may be related to the setting "FIXED POINT ARITHMETIC" in Main program ?

Exactly what i was thinking earler. But

... This is happening at the time of the routines in the VF01 ...

made me change my mind

@OP: You may also check if the "Fixed Point Arithmetic" option is checked in the program attributes.

BR,

Suhas

Read only

0 Likes
1,152

you are not defined the I_var3 data type.

the following code gives ur answer .

DATA: l_var1(11) TYPE p DECIMALS 4 ,

l_var3(11) TYPE p DECIMALS 4,

l_var2 TYPE KOmV-KBETR."

l_var1 = '29.7250' .

l_var1 = l_var1 * 1000.

l_var3 = l_var1 .

write: l_var3.

and u can be modified by an edit mask or convertion exit.

regards

kamal kishore

Read only

Former Member
0 Likes
1,152

If you want to Print l_var3...I would suggest you to declate it with relevant data element ..

In your case

DATA: l_var3 type KBETR

.

Try practicing that all currency and quantity fileds must be defined with data element reference...

Thanks,

Nag

Read only

Former Member
0 Likes
1,152

solved by myself by using the function module

CALL FUNCTION 'ROUND'

EXPORTING

DECIMALS = 2

input = l_wa_zjdd-shecess_d

  • SIGN = ' '

IMPORTING

OUTPUT = XKOMV-KBETR

  • EXCEPTIONS

  • INPUT_INVALID = 1

  • OVERFLOW = 2

  • TYPE_INVALID = 3

  • OTHERS = 4