Application Development 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: 

Overloaded Functions : FRAC(), FLOOR(), CEIL() strange behavior...

Former Member
0 Kudos

Hello,

These ABAP commands have a different behavior in a report or in a user-exit.

For instance :

DATA: v_frac LIKE vbep-bmeng,

v_floor LIKE vbep-bmeng,

or (same results)

DATA: v_frac type p decimals 3,

v_floor type p decimals 3.

The code in my report ( ztest ) is :

vbep-bmeng = 1333 / 1000.

v_frac = FRAC( vbep-bmeng ).

v_floor = FLOOR( vbep-bmeng ).

I see, in debug mode:

v_frag set to 0.333 -> works fine

v_floor set to 1.000 -> works fine

Now in my User-exit (include MV45AFZZ), I put exactly the same code.

I see, in debug mode,

v_frag set to 0.000 -> ????

v_floor set to 1.333 -> ???

I don't understand why the results are different ?

In the Exit, the types P or Quant seem to be considered as Integer...

any idea ?

( R/3 ECC5, ABAP 6.40)

Thank you

Ramdane

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor
0 Kudos

hi,

MV45AFZZ is an include of main program SAPMV45A. Whatever reason but the fixed point arithmetic is not turned on in this main program (an OSS issue?), I guess that is the reason, that the calculation fails.

hope this helps

ec

1 REPLY 1

JozsefSzikszai
Active Contributor
0 Kudos

hi,

MV45AFZZ is an include of main program SAPMV45A. Whatever reason but the fixed point arithmetic is not turned on in this main program (an OSS issue?), I guess that is the reason, that the calculation fails.

hope this helps

ec