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: 

get line item quantities and price in condition value formula VOFM

Former Member
0 Kudos

Hi all,

I am trying to create a condition value formula in VOFM which will allow me to sum up all the line item quantities in material group '01' and also the price

item 1 70EA $5 mat group 01

item 2 80EA $10 mat group 01

item 3 100EA $8 mat group 02

in which case I can capture the total qty as 150EA and total price as $15.

I want to then calculate the average (150/15 = 10) and place this into a header condition.

I am not sure how to code this in the condition value formula, please advise

thanks,

3 REPLIES 3

Former Member
0 Kudos

Hi,

Do the following way:

step1: Sort the table by key magerial group.

step2: at end of mat_group

sum.

qty = l_qty.

price = l_price.

endat.

step3: average = l_qty / l_price.

Regards,

Bhaskar

0 Kudos

Thanks for the response,

which table are you referring to in step 1? How is it stored since it hasn't yet populated a database table?

0 Kudos

Thanks for the response,

>

> which table are you referring to in step 1? How is it stored since it hasn't yet populated a database table?

This is the table he was referring...

item 1 70EA $5 mat group 01

item 2 80EA $10 mat group 01

item 3 100EA $8 mat group 02

Wherever this data is stored....