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

Divided by

abdulgaffarmohd
Participant
0 Likes
753

hi ,

i am dividing two fields with data type currency.

But in my final field i am getting rounded value .

E.g...,

if final value is : .970345

but i am getting .1

7 REPLIES 7
Read only

Former Member
0 Likes
714

HI,

what are the data types of ur fields.

check a sample code here.

data: var1 type netwr_ak value '10.234',

var2 type netwr_ak value '11.1',

var3 type netwr_ak.

var3 = var1 / var2.

write: var3.

the output will be 0,092

regards,

pavan.

Read only

0 Likes
714

Same datatypes.

It is an routine, routine include in attributes there is no option for fixed point arithmetic.

If there is no option to achieve the divided by then what are the basic step's to carry out.

Please suggestion from your end..,

Regards,

Abdul.

Read only

Former Member
0 Likes
714

Hi,

If you dont wan the rounded off value then you can do one thing:

Declare the third field as type of CURRENCY e.g CURR3

You will get the exact answer without round-off.

Example

DATA: var1 TYPE i VALUE 10,

var2 TYPE curr3 VALUE 3.
DATA: var3 TYPE curr3.

var3 = var1 / var2.
WRITE:/ var3.

Read only

Former Member
0 Likes
714

Hi,

Increase the no. of decimal places in the data type which you are using.

Thanks,

Sudheer

Edited by: sudheer kumar on Feb 3, 2010 8:43 AM

Read only

Former Member
0 Likes
714

Hi,

please declare the result field of type currency.

thanks,

Read only

abdulgaffarmohd
Participant
0 Likes
714

self answered..,due to arithemetic check box tick....,in standard exit...,

Read only

0 Likes
714

Hi Abdul in wich standard exit did you activate the aritmetic check box?

I'm facing the same problen with a pricing routine.

Thanks