Skip to end of metadata
Go to start of metadata

Purpose

CRM pricing functionality is implemented in Java and executed in the Virtual Machine Container (VMC). A detailed analysis of the performance ( e.g. expensive methods) cannot be obtained using the typical transactions for performance analysis, ST05 and ST12. Nevertheless, transaction ST05 or ST12 can be used to get the performance for each of the calls to the VMC ( calls ABAP to Java). This wiki page shows how to do it.

 

Overview

Both transactions ST05 and ST12 can be used to display the performance for each of the calls to the VMC. Additionally, in ST12 the performance of the VMC calls can be seen in the two traces that are taken simultaneously from the same step of the CRM application,  the ABAP trace ( which shows the performance of the ABAP methods) and the performance trace ( which shows the performance of SQL statements and RFC calls).  The ABAP trace has the advantage that you also see the total performance of the step (ABAP + VMC calls), so you can compare it with the performance of the VMC calls and see whether pricing has much weight in the total performance. 
Both ST05 and ST12 traces can be taken for the user that creates a business transaction in CRM Web UI.

Using ST05 to check performance of the VMC calls.

In order to perform pricing, the ABAP side calls remote enabled Java Modules that are executed in the VMC. This function modules can be seen in transaction SE37. However, the coding is not present there, as it is implemented in Java. All of these function modules, have names starting with SPC_ and its functionality can be related to pricing or product configuration. In most cases it is easy to distinguish if it is related to pricing or product configuration just checking the name of the function module. Furthermore, the user for most calls in product configuration is not the end user but the RFC user that triggers the call from the J2EE Engine. Hence, when you take the trace for the end user, most of its VMC calls will be related to pricing.

The steps to check the performance of the VMC calls in ST05 are:

  1. In the application, go through the steps previous to the one for which you need to check pricing performance. For example, in a CRM order, add business partner and organizational data.
  2. Start transaction ST05 and select flag RFC trace, so that the RFC calls to the VMC are added to the trace. Optionally, you can mark SQL trace to record the database acceses (ABAP) as well.Then click button "Activate trace with filter" and filter with your user ( in a general case, the user whose actions you need to trace, the user that works in the CRM order)
     
  3. Perform the step(s) in the application where you expect pricing to be executed, the step(s) that you want to trace. For example, add an item with product, quantity and press enter.
  4. Go to transaction ST05 and click on "Deactivate Trace".
  5. Confirm the next screen and the trace entries will be displayed. The RFC calls are displayed in light blue color. The RFC calls to function modules SPC_*  (starting by SPC_ ) represent RFC calls to the VMC.

    In the example below, the VMC calls are quite quick.For example, the execution of SPC_CHANGE_ITEMS has taken 20.818 microseconds  ( about 0,028 seconds)

 

If you need to get the total time for all the VMC calls in the trace, you can filter by objects starting with SPC_. The steps for this are:

  1. Select column "Object name" , right click and select "Set filter.."
     
  2. In the pop-up, add object name SPC_* and confirm


    The trace entries for the VMC calls are displayed.
    In this sample case, the calls are quick, total duration of all is 169.163 microseconds, about 0,169 seconds

 

Using ST12 to check the performance of the pricing calls

 Transaction ST12 can be used in a similar way as ST05 to check the performance of the pricing calls. The advantage in this case is that in the ABAP trace you can compare the performance of the pricing calls with the total performance for the step.

General information about ST12 can be found in page:
http://scn.sap.com/docs/DOC-44143

The VMC calls in ST12 can be seen in two traces that are taken simultaneously for the same sample step, the ABAP trace ( button "ABAP Trace" ) and the performance trace ( button "Performance Trace"). 

Points that we must consider:

  1. Ensure that the RFC checkbox is marked before we start collecting the trace

     
  2. Once the trace has been collected,  if you click on button "Performance" you can see the VMC calls as well as the ABAP SQL entries . The RFC calls are displayed in light blue color, same as in ST05. The RFC calls to function modules SPC_*  (starting by SPC_ ) represent RFC calls to the VMC.
    In the figure below, you can see a VMC call to function module SPC_CHANGE_PRICING_CONDITIONS which is taking 49.381 microseconds (about 0,049 seconds) .



    If you need to get the total time for all the VMC calls in the trace, you can filter by objects starting with SPC_ . You can do this in the same way as shown above for ST05



  3. Once the trace has been collected, if you click on button "ABAP Trace" you can see the times for the ABAP methods as well as the VMC calls. The VMC calls will be all those that have Call = RFC SPC_* 
    In the figure below, you can see a VMC call to function module SPC_CHANGE_PRICING_CONDITIONS which shows 49.438 microseconds. It is from the same example as the previous performance trace, so the gross time is almost the same as that observed in the previous screenshots ( time was 49.381 microseconds)



    If you need to get the total time for all the VMC calls in the trace, you can filter the results by adding a filter in column "Call" with Call = RFC SPC_* . Afterwards you can just right click in the column gross and add "Total" so that the total value for all these RFC calls is displayed in an extra row above. The result would be like in the figure below.
    Again, this total value of 71.270 microseconds is almost the same as the one observed in the performance trace in the figure of step 2 (time 70.803). As both correspond to the same step in the application, the results match.

    This trace has the advantage that you can compare to the total time spent in the step. Hence for this example:
    Total time spent in the step = 1.617.431  microseconds ( about 1,6 sseconds)
    Total time spent in pricing in the same step = 71.270 microseconds  ( about 0,071 seconds)



 

Related Content

Related SAP Notes/KBAs

KBA 2541124 - Pricing performance optimization in business transactions with many items


__________________________________________________________________________________________________________

Use this structure to help you compose your contributions for WIKI and at the same time will ensure spelling and grammar.

  • No labels