Skip to Content
Author's profile photo Michael Piehl

SAP SM: Quoting In-House Repairs

One issue I’ve found in SAP Service Management (Customer Service) is that most companies want to quote the repairs they perform in house.  The problem is that the standard repair process doesn’t give a good alternative to handle this.  You can only use the DP80 functionality if you use a service order that is non-revenue bearing, but you must use a revenue bearing service order to perform in-house repairs.

Up until now, I’ve always handled it manually.  Simply creating a quotation with reference to the repair sales order.  The problem is that the connection to the process is loose at best, and you cannot use the information from planned service order to automatically update the quote.

Recently I found the following OSS notes.

Note 153869 – Creation of quotation after goods receipt for repair

Note 204874 – Settled costs in resource-related billing

This OSS note maps out a process that uses the original repair sales order as both the quote and the order.  Through the use of different item categories, we can use DP90 to perform quoting functions, as well as the actual billing.  Now, several things needs to be taken into account for this process to work.  The first is that you will need to add some addition item categories and item category usages.

I recommend you create Item category Usage, ZEIN & ZENI so you can control the quotation item categories.  Then you can leave SEIN & SENI for use in the billing items.  Be sure to add these new usages to the item category determination for your repair sales orders.

The next step is to properly setup the DIP profile in order to accommodate the new changes. What you need to do is change the billing portion of the profile to include the planned costs.  This will allow DP90 to pull in all of the planned costs, which can be used for quoting. DIP 1.jpg

The other thing you need to decide is if the quotation items will be statistical or not.  This depends on if you want all of the items to be displayed to the customer on the quotation, or if you plan to simply roll the items up for easy calculation of your quotation price.    The basic code provided by SAP assumes that quoting will be actual pricing, and billing will be statistical.  In order to provide some additional flexibility in the solution provided by SAP, I included a check in the code to look at the materials of the quotation usage to determine if each was statistical or not. 

DIP 2.jpg 

In my code below, if the Material Determination for an item was set to C: Transfer qty only, then it was statistical.  In all other options, it was normal pricing.  This does require you to maintain the items in both the quotation and the invoicing portion of the DIP profile, but the flexibility was worth the one time maintenance. 

Be sure to setup ODP4 to show the cost in the sales order.  Be sure the condition you use (EK01 is recommended) is also a part of the pricing procedure for the repair.

Finally, the biggest thing to consider is the output changes that will be required for this process to work. I encourage you to create a new quotation Smartform.  It can be similar to your current quote or order confirmation, but you will want to handle the item categories appropriately for your customers.  For example, you may want to show the itemized quotation costs, but not show any of the repair process items like the inbound delivery.  You will also need to setup the form to show your pricing at the appropriate level. 

Here’s the code I used in the exit: V46H0001 ->EXIT_SAPLV46H_001

data: da_vbak like vbak.
data: da_vbkd like vbkd.
data: lv_quant type AD01INVQUA.

CHECK NOT I_VBAKKOMVBELN IS INITIAL.

CALL FUNCTION ‘SD_VBAK_SELECT’
EXPORTING
I_DOCUMENT_NUMBER 
= I_VBAKKOMVBELN
IMPORTING
E_VBAK            
= DA_VBAK
EXCEPTIONS
DOCUMENT_NOT_FOUND
= 1.

CHECK SYSUBRC = 0.

* only in repair environment
check da_vbakvbklt ca ‘FG’.

* read billing form of repair main item
CALL FUNCTION ‘SD_VBKD_SELECT’
EXPORTING
I_DOCUMENT_NUMBER
= I_VBAKKOMVBELN
I_ITEM_NUMBER    
= C_VBAPKOMUEPOS
IMPORTING
E_VBKD           
= da_VBKD.

CASE I_SDSM_DLIWRTTP.
WHEN ’01’ or .                      “resource related quotation
CASE da_vbkdFAKTF.                 “billing form
WHEN ’01’.                        “fixed rate
select SINGLE INV_QUANT from AD01C_MAT into lv_quant
where PROFNR = I_SDSM_DLIFFPRF and
DPUS  
= ’11’ and       ” quotation
INV_MAT
= I_SDSM_DLISD_MATNR.
if sysubrc  <> 0.
select SINGLE INV_QUANT from AD01C_MAT into lv_quant
where PROFNR  = I_SDSM_DLIFFPRF and
DPUS   
= ’11’ and       ” quotation
MAT_DIR
= ‘X’.
endif.
case lv_quant.
when ‘C’.
C_VBAPKOM
VWPOS = ‘ZENI’.       “statistical
when others.
C_VBAPKOM
VWPOS = ‘ZEIN’.       “not statistical
endcase.
*         C_VBAPKOM-VWPOS = ‘SEIN’.       “not statistical
WHEN ’02’.                        “costs
*         C_VBAPKOM-VWPOS = ‘SENI’.       “statistical
C_VBAPKOM
VWPOS = ‘ZENI’.       “statistical
ENDCASE.

WHEN ’04’.                            “resource related invoice
CASE da_vbkdfaktf.
WHEN ’01’.                        “fixes rate
C_VBAPKOM
VWPOS = ‘SENI’.       “statistical
*       when ’02’.                        “costs
*         no change at the moment, because no change necessary
*         – item with service product   => SENI statistical
*         – items from costs            => SEIN non statistical
*         c_vbapkom-vwpos = ‘SEIN’.       “non statistical
ENDCASE.
ENDCASE.

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Amit Kushwaha
      Amit Kushwaha

      Hi Michael,

      I am working on same scenario. I configured the DIP Profile as  you shown here. I also did the coding as you mentioned here. Still  i am not getting QUCR status in Service order.

      Please suggest

      Author's profile photo Michael Piehl
      Michael Piehl
      Blog Post Author

      Hello Amit,

      Unfortunately, with this method you will not get the QUCR status.  If you follow this path, you will need to setup a user status to handle the quoting and either set it manually, but add some code to a user exit to have it set automatically.  To the best of my knowledge, the QUCR status is set by DP80, and since this method doesn't use DP80, it isn't available.

      Hope this helps,

      Mike

      Author's profile photo Amit Kushwaha
      Amit Kushwaha

      Hi Michael,

      Thanks a lot for your quick response. yes you right QUCR status is only set by DP80. I got it after bypassing the error message " Quotation creation is not possible for non revenue bearing order" in DP80. I don't think bypassing a SAP error message is a good idea.

      If we use DP90 we get Partial billing system status in service order, which is fine.

      I am still working on the solution. will update the outcomes.

      Thank you

      amit kushwaha

      Author's profile photo Former Member
      Former Member

      Hi,

       

      can you please confirm if above code is working for you.

       

      Regards,

      Suresh