Skip to Content

I found that ABAP is quite poor in drawing graphic in an easy way; of course, there is plenty of tools which allow you to draw wonderful charts (Visual Composer, Web Dynpro, etc.) but few natively in ABAP, if you dont use the standard ABAP graphic (personally never used).

So, I tried to design some simple charts (lets me say Barchart and Pie chart) using only ABAP, HTML viewer class and SVG.

Below you see the results:

Image 1: Barchart example

image

 

Image 2: Pie chart example 

image

They are not, of course, the state of the art, but can be a base to develop something very interesting…the classes I used to draw could be easily adopted also in ABAP Web Dynpro, for instance…

 Here is the sample code, you need only to create the dynpro 100 with a custom control named HTML inside: 

 

Report ZTESTSVG

Of course, you need also the two classes ZZ_SVG_BASE and ZZ_SVG_GRAPH that you can download at http://code.google.com/p/svgabap/; you can load them by using the report  yrs_class_upload_xml as described here

To report this post you need to login first.

10 Comments

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

  1. Alvaro Tejada Galindo
    Paolo:

    This is just great! -:D When I give my Flex Crash Course someone ask me “Why should we use Flex with SAP?” My answer was…”Have you tried to do a chart on ABAP? You can’t right? That’s why”…

    Now, thanks to you, I’m forced give a different answer -:P Hope to find some time to test it…Wonderful work you have done here -:D

    Greetings,
    Blag.

    (0) 
      1. MF Z
        I got it!thanks!

        and if you want to show chinese fonts,just change the method DRAW_LEGEND,font-family:verdana to �gSimsun”‘v‘Ì.

        (0) 
  2. Rich Heilman
    You can create simple charts using ABAP and the integrated IGS.  See program GRAPHICS_IGS_CHART_TEST for a simple example.

    Regards,
    Rich Heilman

    (0) 
    1. Paolo Romano Post author
      You’re right Rich, the IGS works well for some use; let me say that SVG is indeed more powerful and flexible as well, for instance you could insert animation, transformation and other nice features in your chart (in my example program the pie’s slices detach when you pass on it with mouse).
      Thanks for the info, I didn’t know the existence of such sample program.
      Best Regards,
      Paolo Romano
      (0) 
    1. Paolo Romano Post author
      hello saurabh,

      if you browser is IE, you’ll need the Adobe SVG Plugin to display the chart.

      thanks and best regards,
      Paolo

      (0) 

Leave a Reply