As an ABAPer we have SAT, ST05 ( or sometimes ST12 ) for trace in our toolbox, and recently I find this report which could also do the trace job.

Although the trace information it generates is quite technical and perhaps more useful for those guys who are interested with the ABAP kernel.

How to use this report

1. SE38, execute report RSTRC000, mark the checkbox “Keep Work process”, so that a free work process will be owned exclusively by you unless you release it via this report again. And change the trace Level to 2: Full trace. Select the component which you would like to trace, for example Database.

/wp-content/uploads/2014/07/clipboard1_492824.png

Click save button and you can see the work process 23 is locked.

/wp-content/uploads/2014/07/clipboard2_492826.png

you could observe that the work process 23 has status “halt” in tcode SM50./wp-content/uploads/2014/07/clipboard3_492830.png

2. Now it is ready to run the program which you would like to trace ( just the similar process as SAT or ST05 ). Use /nse38 to go to abap editor starting from the current screen of report RSTRC000, and run your program. For me, I just run a report which will query material data from database table COMM_PRODUCT. Once the program finishes, run report RSTRC000 again.

click button “Default val.” so that trace Level is changed to 1 automatically,

/wp-content/uploads/2014/07/clipboard4_492831.png


then click save button and you could observe the previously locked work process 23 is released.

/wp-content/uploads/2014/07/clipboard5_492810.png

Now you could click “Display” button to review trace log:

/wp-content/uploads/2014/07/clipboard6_492811.png

You could export the trace locally to review it. For me I prefer to use my favourite text editor “sublime text” to review text file.

Here below I just list the trace review of several trace component which I have already tried myself.

Database log

from the log, I could find which database tables are involved in the report execution and which ABAP program triggers such access. Some C language call could be observed but due to security or authority reasons maybe, we could not review the source file like ablink.c in folder /bas/*.


/wp-content/uploads/2014/07/clipboard7_492848.png

We could also find the detail OPEN SQL statement from the log, however I could not find the value of query parameter as shown below – they are displayed as ? in the trace.


/wp-content/uploads/2014/07/clipboard8_492849.png

ABAP proc.

It just lists all the ABAP class which are involved in the report execution but without method name of those class. In my case from the trace I can just know there are totally 40 different ABAP class with prefix CL_CRM_PROD* ( which are responsible by me)  involved in the execution.

/wp-content/uploads/2014/07/clipboard9_492850.png

Database (DBSL)

Since we are currently use HANA as our database, I could have a very draft understanding about how the OPEN SQL like SELECT XXX FROM table statement is executed in HANA.

/wp-content/uploads/2014/07/clipboard10_492851.png

Lock Management

This time I would like to trace the lock behavior in tcode COMMPR01. I switch to edit mode which triggers a lock request to enqueue server to lock the product and then I make changes on its description field.

/wp-content/uploads/2014/07/clipboard11_492852.png

in the trace this enqueue request is perfectly recorded:

  • the enqueue object
  • the database table on which the enqueue object is working
  • the guid of the product instance being locked
  • the tcode name COMMPR01
  • the user which triggers the enqueue request

/wp-content/uploads/2014/07/clipboard12_492853.png

/wp-content/uploads/2014/07/clipboard13_492854.png

From my point of view this option is a good substitute for the enqueue trace in ST05.

/wp-content/uploads/2014/07/enqueue_493564.png

Background

I run my report ZHANA_OBJECT_SEARCH in the background and

/wp-content/uploads/2014/07/clipboard14_492855.png


and I could see from the job log that it is successfully executed.

/wp-content/uploads/2014/07/clipboard15_492856.png

and this information is also available in RSTRC000 trace:

/wp-content/uploads/2014/07/clipboard16_492858.png

I didn’t try all the other trace options and maybe they are useful under some extreme use cases. If you are interested, you can start now try it yourself 🙂

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. nabheet madan

    Wow..I did not know of this report…reading your blog is always a pleasure… so many tips and tricks are share by you. Will explore what the rest of the options does:)..

    thanks once again and keep them coming.

    Nabheet

    (0) 
  2. Jelena Perfiljeva

    Maybe we could have a discussion in this blog about what is the best usage of this report.

    Hmm, this sounds suspiciously like “I’ll get all the points while you guys provide information that I should’ve found before posting this blog”. Nice try. 🙂

    Most likely the readers would want to know in what situations this report could be useful, how exactly is it better than other tools, whether we could run it in a productive environment without getting yelled at by Basis or whether there is a risk of “paralysis by analysis” due to too much data in the trace file. Your account seems to have the SAP logo, so wouldn’t you be in a good position to find someone at SAP who actually knows those kinds of things? Or at least share with us what compelled you personally to run this report and what specific benefits did you get?

    Otherwise it’s not a bad blog and I’m sure someone will find this helpful, but it’s just “hey, I ran this random report and here are the screenshots” and it could be much better.

    (0) 
    1. Jerry Wang Post author

      Hello Jelena,

      Thanks a lot for your comment, it really makes sense and really helpful. I think I would think twice about how to organize the blog and provide more background information as you suggested to make the blog more informative and understandable by others, instead of just providing my findings. I will try to find if there is more information for this report. Thank you for your reminding.

      Best regards,

      Jerry

      (0) 

Leave a Reply