cancel
Showing results for 
Search instead for 
Did you mean: 

Define formula for calculating the condition base value

Former Member
0 Kudos

Hello,

I am trying to determine prices in Repair Orders RAS based on the qty of the servicable material. I was able to use USEREXIT_PRICING_PREPARE_TKOMP to define the field VBAPD-MATNR_G as the pricing material in the communication structure and now the price get calculated based on the ServicableMat but the quantity is still coming from the actual service item.

The help article points says:

Define an alternative formula for calculating the condition base value. You do this in the Customizing activity Define formulas for pricing (choose Sales and Distribution ® System Modification ® Routines ® Define formulas for pricing). Specify in this formula that the quantity for calculating the price should be taken from the VBAPD-MENGE_G field. Assign the formula to the pricing procedure.

Could someone please tell me how exactly am I supposed to specify that in this new formula?

Thank you,

Sergiy

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Sergiy

Lost you towards the end with regard to what is that you are seeking.

1) Using T code VOFM define the new Condition Base Value Formula. It will be under the menu option "Formulas'. Use an unused number > 600.

2) Then you can get the code written for the newly created entry- Routine RV63AXXX. Use ABAPer to do this.

3) Then assign the Formula in the Pricing Procedure against the right condition type (V/08)- Column- Bas Type.

4) If you are talking about how it should be coded: You need to specify the condition base value is to be calculated, so your code will have a line to this effect:

XKOMV-KAWRT = XVBAPD-MENGE_G

But what I am not getting is why do you have to do this. Are you not working with standard ? In the service scenario, the service material will be usually without value, the actual components/materials you are using and the labor will be sub items which will be priced.

Hope this helps.

Former Member
0 Kudos

Chandrasekhar,

Thank you for you help. Yep, it is exactly the code that I am actually having problems with. Unfortunatelly, I don't have access to the experienced ABAPer in this area. We are a small company and try to program some of these smaller routines without the help of dedicated ABAPers. Anyway, I have already done the same steps you point in your instructions but no matter what I put in the code it still takes the quantity from the Order Quantity field in VA01 instead of the Serv. Matl Qty fields as I am trying to make it work.

The reason why I am not using standard is because we are using fixed rate billing, so we don't bill for components used or labor and I would like to make it take the price from the Servicable Material price and assign that price to the Service line. The help article seems to be describing just this scenario:

[http://help.sap.com/saphelp_erp2004/helpdata/en/3b/02953401024735e10000009b38f83b/frameset.htm]

So I am on the second step in the prereqs now.

I created a condition base value formula formula 601, activated and put 601 into my repair procedure on PRRP condition type into AltCBV cell. Still when I enter servicable material and quantity for serviceable material it takes Price from the Serviceable material and qty from the Order Quantity field instead of the Serv. Marl Qty and calculates the price.

When I entered XKOMV-KAWRT = XVBAPD-MENGE_G it gives an error saying that xvbapd is unknown. I even tried setting XKOMV-KAWRT = 3, for example, but still it takes quantity from the Order Quantity field.

I am guessing my code needs something else in there, any suggestions?

Thanks again,

Sergiy

Former Member
0 Kudos

Sergiy

I am not an APAPer, that's my problem.

Looks like Data area VBAPD is not available etc.

So I suggest the following, try with:

1) Check if PMATN (Pricing Reference Material) is getting populated with Serviceable material or not, i.e., if your code for USEREXIT_PRICING_PREPARE_TKOMP is working correctly or not.

2) Try coding without X before VBAPD, i.e., XKOMV-KAWRT = VBAPD-MENGE_G

3) Check if you have declared the data and work area:

DATA: l_vbapd TYPE vbapd

Somewhere during the code before the KAWRT line, you need to use the following lines of code , I am guessing

Store with this line: l_vbapd = vbapd.

Restore with this line: vbapd = l_vbapd.

LOCAL: vbapd, *vbap, *vbapd.

4) Also I don't know which release you are in, but there a few OSS notes on issues with vbapd-MATNR_G. They are not directly related but may give you some clues:

629515 - Change BAPI: Error with repair orders

560909 - Repair order: Returns item is not generated

150999 - Serviceable material/quantity, status n. determined

Note Language: Version: 2

Former Member
0 Kudos

Chandrasekhar,

thanks for all your helpful input. Right now they only enter one item per line on the repair order because for all our repairable items, so I was able to go around this and just configure Item Qty = 1 on the Sales Order Item Category this way it does not prompt me for the quantity any longer but still takes the price from the Serviceable Material from my user exit.

For now this fits my needs, if they start putting in more then one item per line in the future, I might have to play around more with the code for determining the quantity again and try some of these options you provided. At least I know I was on the right track, I think it is just a matter of getting the ABAP part right.

Sergiy