Friday, January 20, 2012

How to Scan ABAP Sources for Specific Strings

It is simple to locate a string within a program but have you ever wondered how to find all programs where a specific ”string”, or line of text, or object name, is used.
There is a wonderful report which is I use to find ABAP programs related to specific search terms.
  • The Report name is – RPR_ABAP_SOURCE_SCAN 
  • You can execute it from transaction SA38 or SE38.
Some useful benefits of this report are:
You can limit the search range of the programs for example to your custom built developments only for example all programs starting with Y* or Z*.

Tip - Another similar program is RKCTSEAR.

Transport of Copies

Issue: Imagine you create and release a few transports before setting up the target system and Landscape. Because of this, the transports can be released without target clients. How do you fix this problem?

Fix: Fix is done using Transport of Copies Method:
  1. Execute transaction SE10
  2. Select the create icon.
  3. Select “Transport of Copies”
  4. Enter short description and save, this will create your transport number.
  5. Now follow the menu path to place your objects into this transport copy:
    1. Request Type–>Object List–>Include Objects
  6. Select “Object List from Request” and enter your old transport number.
Thats it! Your new transport is a copy of your old transport with all associated objects

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.