Hegal,
Adding to what above mentioned .
Its work this way , The yellow highlighted for first line - Stock value = Units X Std unit price and diff will go to price diff account( it will not get added to stock value)
The second line : if you need the MAP as statistical for your business reporting . You can do this way -
MAP= Stock value+ Price diff value / total units .
Transaction level MAP is tricky !!!
You need to determine the MAP before the moment of Transaction. I.e
Total stock value + price diff value at that point / Total unites in stock at that point .
go for Z if its really required but check in your test system its showing results as expected. It may give strange reports and it will be tough for Users/ Account folks to justify this operational data/ reports .
fyi- i have same question Bijay asked( ref: jurgen's link)