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.
Showing results for 
Search instead for 
Did you mean: 

Problem in calculating moving a price...

Former Member
0 Kudos

Hi Experts,

I am Modifying Standard Program RM07MLBD(Tcode : mb5b) I have copied to zprogram in my program i am adding few fields in program my fields are closing stock qty(by document by document) closing stock value(price document by docment)

Price(Moving avg price by document by document)

i am calculating a price

show example :

mb5bqty mb5bprice cs cv(closing value)

0 MT 249.17- 2,682.180 9,200,499.51

329- MT 1,248,516.14- 2,353.180 7,951,983.37

1.960 MT 93,337.25 2,375.140 8,045,320.62

6.550 MT 70,342.96 2,391.690 8,115,663.58

2.110 MT 93,974.80 2,413.800 8,209,638.38

Now i want to calculate the moving avg price.

mov = cv / cs.

i wrote the same logic in my program

it will show like this


but the actual value is 3430.23

i am declaring the variable

data: mov type p decimals 2,

cv type p decimals 3,

cs type p decimals 2.


Former Member
0 Kudos

In your program attributes, do you have the 'Fixed point arithmetic' flag set?