Friday, January 20, 2012

Measure specific portions of ABAP Runtime

Most people know about SE30 which can be used to do an ABAP runtime analysis. However did you know that you are able to dynamically call the runtime analysis for a portion of source code for example a section of a user exit, or for a specific function module?
This is easily done by changing the user variant as follows:
  1. Open SE30
  2. On Measurement restrictions (1/2 way down the page) create/change your user defined variant.
    1. Within the variant under program parts, select the “particular Units” check box and save.
Now from within SE38 for the code you wish to measure – set your breakpoint for the position from which you  wish to measure and another for the position to which you wish to measure.
Go back to SE30 and execute your code when you reach the breakpoint activate the runtime analysis from System–>Utilities–>Runtime Analysis –> Switch On.

Run through the code by selecting F8.

When you reach your end point de-activate the analysis by selecting System–>Utilities–>Runtime Analysis –> Switch Off.

TIP: You can activate the runtime performance analysis start by entering the command prompt code /RON in the transaction box. You can de-activate the analysis by using the command prompt code /ROFF.

NOTE: If you get the message “The Particular “units” option is not selected – S7100.  It means you are not using your new changed default user variant for the execution.

Creating Database Table

Questionaire for Creating Database Tables


Check IDoc number

Is there any way to check the IDOC number from a sending system, within a receiving system?

Ans: Yes there is a way to do this. In the receiving system, execute transaction BD87. Select the node for analysis and select “Trace IDOCS”. You will then see all IDOCS as well as the field, IDOC No. partner. (The external IDOC number).

What to use to measure performance improvement?

You know of ST05, ST01 and SE30. But do you know why you would use one transaction code and not the other? What are the main purposes of each one when it comes to performance improvement and measurement?

To measure and improve performance of ABAP programs – Use SE30 to measure:
  • Excessive or unnecessary use of modularization units
  • CPU-intensive program functions
  • User-specific functions that could be replaced with ABAP statements
  • Inefficient or redundant database access.
In addition you may want to analyze or fine-tune a program’s database accesses – Use ST05 to measure:
  • Database accesses (SQL trace)
  • Table buffers
  • RFC calls
  • Lock operations (client side)
If you wishto fine tune the system – use ST01 to measure:
  • Authorization checks
  • Kernel functions
  • Kernel module
In addition ST01 encompasses the majority of the functionality of ST05.

Thursday, October 6, 2011

Added new field NOT show in ALV result list: REUSE ALV FIELDCATALOG MERGE

This is well know issue with ALV buffer: when you change field catalog it is not always updated immediately. To refresh the buffer you can run report BALVBUFDEL or BCALV_BUFFER_DEL_SHARED.

Thursday, August 25, 2011

Restricting Call Transactions - SE97

Problem: We are in one transaction and we click on an ICON and it goes into different transaction, even when the user does not have access to that transaction.

Cause: In the coding there is a statement called CALL TRANSACTION. Normally when user executes a transaction the system is forced to check for S_TCODE and Field TCD. But in this case the Check is missed unless the Transaction mapping is in TCDCOUPLES table. The program checks the TCDCOUPLES  table and see if the called transaction need to be checked. If there is not entry then the check is not performed and user is able to get to the transaction even when the user does not have access to this t-code.

Solution:  Go to transaction SE97 which updates TCDCOUPLES table and add the t-code. So now you will have entry in TCDCOUPLES.
Examples: KSB5 form MB51, MD04 from ME2O, MMBE from MB51 and ME2O, KSB5 from MMBE

PS: This may not work for all transaction so testing is always required

Tuesday, August 16, 2011

How to change development class of a SAPscript

At times developers develop SAPScript as local object. Unlike reports where we can change the development class using the attributes option , nothing such is available for SAPScripts.

However we can use the program RSWBO052 to change the development class.

Following are the step by step screenshots to change the development class