cancel
Showing results for 
Search instead for 
Did you mean: 

need to write a routine to calculate value

0 Kudos

Hi

I want to calculate the values in a condition on following basis

Routine will calculate the total of quantities of all the line items of the sales order and if total is more than 300 then it will pick the value from a condition record which will be multiplied by the line item quantity to get the desired result

Line item qty

10 100

20 150

30 170

-


420

-


here total of all quantities is 420> 300 then condition record value should be multiplied with the line item qty otherwise if total < 300 it should be 0 (zero)

Need your help to resolve it

Regards

Ajay

Accepted Solutions (1)

Accepted Solutions (1)

gomatheeswaran_palaniappa
Active Contributor
0 Kudos

Hi,

If you dont have scale based condition records, you can opt group condition. A group condition will club all the indvidual line item values. Based on that value, you can apply a condition record.

If it is based on scales, the below thread would also help you.

Regards,

P Gomatheeswaran

Answers (1)

Answers (1)

former_member209761
Active Contributor
0 Kudos

Dear Ajay,

With the help of your ABAPer, create a pricing routine for alternative condition value. [ VOFMFORMULASCONDITION VALUE]

In this routine, write a logic as follows.

Put VBELN (Sales order number) in VBAP and fetch the SUMMATION of KWMENG

Check whether summation of KWMENG >300.

If yes,KOMV-KWERT for all the line items will be the multiplication of line item qty * condition record (you can get the value of condition record from the table AXXX.

xxx denotes the table no. (if you have any doubt on this revert back)

Check and revert back.

Thanks & Regards,

Hegal K Charles