Skip to Content

Service Procurement: Using Formulas To Calculate Service Quantity

Dear Friends,

In this document I am going to explain about using formula’s in Service procurement for calculating the ordered quantity of a service.

Ex: You made an agreement with vendor for painting or flooring of tiles in your building at Rs.200 Per Sq.Meter.  In this example if You enter length and breadth then SAP will calculate the total area and thereby ordered quantity is determined.

In order to achieve this follow the below configuration steps.

Step 1. Define Formulas:

Goto SPRO > MM > External Service Management > Formulas for Quantity determination > Define Formulas.


Here Click on New Entries and create formula as shown below for calculation of area.



AREAFORMUL — is a key to identify the formula

L & B are parameters for entering Length and Breadth

M2 is unit of measure of the formula result i.e., for Area SQ.Meter

Step2. Specify Names of Formula variables:

In this step you will define or name the parameters in the formula.


Here click on new entries and select your formula and define each variable by giving unit of measure and description.



Now you have done with the configuration part.


To test the above Follow below steps

1. Create Service master in Transaction code ‘AC03’ and in Basic Data section select your formula as shown below.


2. Create Service PO and enter your service master number in the item detail level. The quantity field is in display mode. So to enter the ordered service quantity scroll to the right in detail and enter the values for variables as shown below. Here the variable names will not be displayed  and shown as Form.Val1, Form.Value2 etc.


The Values for these variables can also be entered at formula tab at detail screen of the service line item as shown below.




Observe that ordered quantity is calculated as per the formula.

If you want to carryout service based invoice verification then select the same in invoice tab.

3. Create Service entry sheet against PO in transaction ML81N and adopt the services from PO by clicking service selection. Now if you want to change the service quantity goto formula tab at service line item details.



4. Carryout the invoice verification in transaction MIRO for the services rendered by vendor.


Note: The above scenario has been done in SAP ECC 6.0 Ehp4. If You are working on below versions of SAP, then formula tab will not appear in Service entry sheet line item details and Error message SE252 will come as shown below.



To Solve the above issue follow the steps as shown below.

Go to Transaction ML90 and click on ENTRY as shown below


Below screen appears. Now click on additional data as shown.


In the pop-up select the optional radio button for ‘FORMULA NUMBER’ field which is hidden.



Now observe the formula tab appearing in Service entry sheet ML81N as shown below.



Thanks For reading and please share your feedback..

Credits: Thanks to Amit Gampawar for the above screen shots related to issue in Lower versions of SAP




You must be Logged on to comment or reply to a post.
    • Hi Jurgen L,

      Thanks for the much needed feedback from you and once again remainding me to always be ready to learn new things....

      I really love your content and contribution to SCN..Once again  I'm very much thankful to You..



  • Very useful information Satish....many thanks..

    I tried using this but while creating entry sheet encountered an issue. The formula screen in ML81N transaction is not editable. Please suggest.

    • Hi Amith,

      Thanks  for the feedback and appreciation....

      From the screen shot you sent I observed that, you are still havn't completely adopted the services from po in to entry sheet...

      First adopt the services in to entry sheet then you can make changes to the variable values and there by quantity....

      So now you have to close that detail window, then select the service line item and click on adopt services button at above or press F9..



      • Hi Satish,

        When I do so system flashes an error message. After this also system shows all the data in non editable mode. Also the FRLM tab does not appear here. Please let me know if any settings to be done for this.

        • Amit,

          After adopting services in to entry sheet scroll to the right...

          There you have to enter values for the variables....

          The best way is while adopting services  after clicking on service selection, a pop up appears. In that select adopt full quantity check box and then select service line items in po and click on adopt services...

  • HI Satish

    Very useful information.

    but when i check the same scenario in my system.

    The FRML tab is not appearing in "maintain service entry sheet screen" while creation of service entry sheet.



    • Amit,

      Can you please send the screen shot of 'service details' of service entry sheet line item...n also tell me which ECC  version you are using?...I'm using ECC 6.0 Ehp4

      • I am using ECC6 and EHP3

        Plz have a look appearing

        FRML tab is not appearing but if I tick adopt full qty, it allowed to save while without tick it not allow to save. it gives error

        "Message no. SE252"

  • Hi Satish,

    Very informative document, I doubt one  it is working only when both variables have same BoM. We have requirement that for transportation charge we pay to transporters on KM & Quintal basis. I.e. for transport of rice from one district to another district we pay to transporter per 1KM/1Quintal. how can we do it here price is fixed?.

    Example: 20000 Quintals of rice for 1000 KM @ .30 Paise per KM& Qunital.

    ie. 20000*10000*.30= Rs.6000000.

    Please give some suggestion on this.


    B V

    • Hi B V,

      You have to define new Unit KMQ (KM / Qunital) & then you can use this unit KMQ while creating service PO with defined formula. Enter total KM & Qunital in service item.

      Regards, Rakesh

      • Hi Rakesh,

        Thank you information, here KM is not fixed. we do not know how many KM it will take to reach destination at time of service order creation. Quanity and price is fixed here.

  • Hi Satish,

    can we create scales for Variables which we create for formula? if Yes, please give suggestion on this.


    B V