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 dividing currency value

former_member632991
Active Contributor
0 Likes
1,480

Hi,

i am facing a problen while dividing the currency value in a routines.

i have 2 variables of type KBETR.

data : a type konv-kbetr,

b type konv-kbetr,

c type konv-kbetr.

a = '10.00'.

b = '7.00'.

<b>c = b / a.</b>

when i check this code in simple abap editor SE38 , i

<b>get the result as 0.7</b>

but i am using this calculation in a routine for pricing

FORM FRM_KONDI_WERT_622. and include is RV64A622

when i write the same code in this include, i am gettin <b>the result as 0.1.</b>

Pls help why the system is behaving in diff ways at two places.

Points will be awarded for helpful answers.

Regards,

Sonika

Message was edited by:

Sonika Ahuja

Hi,

i am facing a problen while dividing the currency value in a routines.

i have 2 variables of type KBETR.

data : a type konv-kbetr,

b type konv-kbetr,

c type konv-kbetr.

a = '10.00'.

b = '7.00'.

<b>c = b / a.</b>

when i check this code in simple abap editor SE38 , i

<b>get the result as 0.7</b>

but i am using this calculation in a routine for pricing

FORM FRM_KONDI_WERT_622. and include is RV64A622

when i write the same code in this include, i am gettin <b>the result as 0.1.</b>

Pls help why the system is behaving in diff ways at two places.

Points will be awarded for helpful answers.

Regards,

Sonika

Message was edited by:

Sonika Ahuja

6 REPLIES 6
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,158

Hi

FORM FRM_KONDI_WERT_622 will give 0.7 only.

Please check the declaration types are in synchronous with FM types.

Regards,

Sreeram

Read only

Former Member
0 Likes
1,158

Hi

Division and Multiplication won't work properly in routines

Only you can do addtions/substitutions

so better write a Zfun module outside to do the same simplification in that

and call the custom fun module into the routine

(just pass two paramters like konv-kwert to that fun module

and one output parameter as Kwert )

This will serve the purpose

we have done like this and succeeded.

reward points

regards

Anji

Read only

former_member632991
Active Contributor
0 Likes
1,158

Hi,

i have got where the problem is...

in the attributes of my include there is no checkbox for <b>fixed point arithmetic</b> which should be checked , but i am not able to see that checkbox i mean attribute for that include.

how can i check that attribute for include??

Regards,

Sonika

Read only

0 Likes
1,158

I was thinking of that , but as it is standard include wondering how can u change that...

will check any FM which will change the attributes and let u know shortly

Read only

0 Likes
1,158

use FM <b>RS_TRDIR_UPDATE</b>,

Pass the structure TRDIR with the field FIXPT as X , hope this will update TRDIR table and solve ur problem

Read only

0 Likes
1,158

Hi Chandrashekhar,

i have updated using FM RS_TRDIR_UPDATE, but still division is not working.

i had to do as Anji as suggested by ZFM only.

Thanks.

Regards,

Sonika