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: 

System is giving different result for same calculation in different program

Former Member
0 Kudos

dear,

i m facing a problem while calculation in routine for billing

(VF02). i am just multiplying two varibles and the system is giving one result which is a include program while i m calculating the same with same data value the system is giving different result in another program.

both have same data type and data value

the first one is giving 118110 (correct one)

other program is giving 1181100.

the calculation is as follows (as example).

data: CONST(5) TYPE C VALUE '39.37' .

DATA: W_LENINCH(10) TYPE N.

TYPES:BEGIN OF TY_ZROLL,

AREA TYPE ZROLL-AREA,

ACTUAL_LEN TYPE zpack_list-ACTUAL_LEN,

VBELN TYPE ZROLL-VBELN,

END OF TY_ZROLL.

DATA: IT_ZROLL TYPE TABLE OF TY_ZROLL,

WA_ZROLL LIKE LINE OF IT_ZROLL.

WA_ZROLL-ACTUAL_LEN = '3000'.

W_LENINCH = WA_ZROLL-ACTUAL_LEN * CONST.

write:W_LENINCH.

please reply

3 REPLIES 3

Former Member
0 Kudos

hi,

i think u need data type as P...."W_LENINCH(10) TYPE P".

im not sure ,

please check it .

thank u

santhosh

Former Member
0 Kudos

the reason is, in the main program SAPMV60A for the tcode VF02 the fixed point arithmetic check box is not checked in the attributes. One solution for your problem would be to call a Z* function module in the include program which does the calculations and returns the result. OR you have to divide the result with 10(which is not suggested though)

Former Member
0 Kudos

partially solved