Skip to Content
Author's profile photo Lars Breddemann

Quick note on Plan Visualization in NetWeaver

Ok, just a very quick note today with loads of screen shots and only a few lines of text.

The core statement is (for the ones with little time at their avail) is:

With a current BASIS SP (my test system is on SP 9) you can create Plan Visualization from within NetWeaver and display it later in SAP HANA Studio.

And here’s how 🙂 , but first something else I really like:

With NetWeaver 7.3 there is now the option to store stack traces together with the SQL calls in the SQL Performance trace (ST05).

Why is this really useful?

Think of well structured programs that encapsulate all DB access into a nice DB access ABAP class, like we have it with SAP BW.

If you review a SQL trace of such a program you may easily find, which SQL statement runs the longest, but finding the ABAP application logic that actually triggered it could become tricky.

Every time you click on ‘Display Call Position in ABAP programs’ you will always only end up in the DB access class.

Typically you now would have to set a break point in this class and wait until “your” statement comes along… not very efficient.

Today, you just activate the stack collection in the ‘Performance trace‘ menu of ST05 like this:

/wp-content/uploads/2013/09/st05_menu_280975.png

After that, you find the stack trace collection is active:

/wp-content/uploads/2013/09/st05_stack_active_280979.png

Now, run the trace as usually and display it:

/wp-content/uploads/2013/09/st05_display_call_stack_280980.png

Select the trace line you want to know the call stack for and click on the ‘stack’ icon marked in the picture above.

Then you’ll get a dialog window, containing the ABAP call stack that was active when this specific line of the trace had been written out:

/wp-content/uploads/2013/09/st05_call_stack_280981.png

If this wouldn’t be good enough, you can even double-click on the stack level you are interested in to navigate to the ABAP source:

ABAP source.png

Pretty cool, isn’t it?

Ok, but now back to the Plan Visualization…

Back in the trace list, you have to click on ‘EXPLAIN…‘ icon to display the explain plan for the statement of interest:

/wp-content/uploads/2013/09/st05_explain_planviz_280984.png

Clicking onto the obscure ‘Execution Trace‘ button, will trigger the creation of a XML trace file, that contains all information required for the Plan Visualization function. In fact it’s the same file format that SAP HANA studio uses to store PlanViz files in the file system.

Once finished you get a message box:

/wp-content/uploads/2013/09/st05_planviz_file_ready_280994.png

As the file name ‘xml.plv‘ indicates, it really is just a text file containing XML tags:

/wp-content/uploads/2013/09/st05_planviz_file_xml_280996.png

Visualize it!

Now, to actually get the graphical output, all you have to to is to open a SAP HANA studio and to drag and drop the ‘xml.plv‘ file into it.

Alternatively you can use the ‘File’ -> ‘File open…’ option.

/wp-content/uploads/2013/09/st05_final_planviz_280997.png

You don’t even have to be connected to the system to get the graphic output, as all information are in the XML file.

This means: no problems with permissions on DB level, no system access required.

Whatever you say, I like it! 🙂

But I’m pretty sure that you will agree…

There you go, now you know!

Thanks for taking your time again.

Cheers, Lars

Assigned Tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Lars,

      Great, Thank you for your good job and sharing.

      Regards,

      Jerry

      Author's profile photo Rama Shankar
      Rama Shankar

      Very informative Lars - thanks! 🙂

      Author's profile photo Former Member
      Former Member

      Nice blog ! Thank you for sharing this.!

      Author's profile photo Mandanna Mandechanda Uthappa
      Mandanna Mandechanda Uthappa

      Hi Lars,

      While i tried uploading the file from st05 into hana studio.

      Observed that an error appears

      "Could not display plan"

      Plan viz overhead is not valid Timeline type.

      Please let me know, what to do.

      Regards,

      Mandanna

      Author's profile photo Lars Breddemann
      Lars Breddemann
      Blog Post Author

      Hey Mandanna,

      did you check whether your SAP HANA studio fits to the HANA server you obtained the planviz from?

      Generally I'd say this kind of problem should rather find its way to a separate thread or into a support incident as it is not about the blog content.

      - Lars

      Author's profile photo Mandanna Mandechanda Uthappa
      Mandanna Mandechanda Uthappa

      Hi Lars,

      Thanks for the information.

      Currently :     Hana studio version is 85 and server is running on version 92.

      Regards,

      Mandanna

      Author's profile photo Lars Breddemann
      Lars Breddemann
      Blog Post Author

      Well, the recommendation is to have the SAP HANA studio (and all client software) at least on the same SP level (that would be SPS 9 in your case).

      That is stated very prominently in every SP release note...

      - Lars

      Author's profile photo SAMUELE BARZAGHI
      SAMUELE BARZAGHI

      Hi Lars,

      On S4H 1809 FPS01 (SAP_BASIS 753 0001 SAPK-75301INSAPBASIS SAP Basis Component)

      The menu “Execution Trace” seems renamed to “Execution Trace (Planviz)” but is disabled.

      Do you know how to activate it?

      Best Regards,

      Sam

      Author's profile photo SAMUELE BARZAGHI
      SAMUELE BARZAGHI

      Hi,

       

      Seems fixed in the code:

      Skip the source line and we get the button enabled and then the xml.plv file. Strange, why?

       

      Thank you.

       

      Best Regars,

      Sam