Skip to Content

      data: ixml type ref to if_ixml,

            document type ref to if_ixml_document,

            root type ref to if_ixml_element.

  data: s type string.

  data: categories type ref to if_ixml_element.

  data: series type ref to if_ixml_element.

  data: series2 type ref to if_ixml_element.

  data: series3 type ref to if_ixml_element.

  data: streamfactory type ref to if_ixml_stream_factory,

        ostream type ref to if_ixml_ostream.

  • create document

  ixml = cl_ixml=>create( ).

  document = ixml->create_document( ).

  • create document root

  root = document->create_element( name = ‘SimpleChartData’ ).

  document->append_child( new_child = root ).

In this example chart you see that I could have a variable number of Categories. The application has the rule that I could have 1 to 5 categories. The Categories are then described on the bottom and unfortunately grayed out in my example. If you could read them you would see that they list the types of quality defects. The following is the code I use to add my categories:

  • append categories holder

  categories = document->create_simple_element(

      name = ‘Categories’

      parent = root ).

*For each Category in data append a Category Child

  data: ipareto like line of appl->pareto_data.

  loop at appl->pareto_data into ipareto.

    s = ipareto-description.

    document->create_simple_element(

      parent = categories

      name = ‘C’

      value = s ).

  endloop.

Looking at the example again we see that we have three series (or points of data for each Category). We have Cumulative, Rework, and Scrap as our three series. You will also note that each series has its own chart type. Rework and Scrap are Stacked Bars, while the Cumulative is Dotted Line. We will control this by adding the customizing attribute to each series. This will connect each series to its own area in the layout definition. The following shows the code to create one series. It just has to be repeated for the other two:

  • append series section, negative values should have a leading minus sign

  series = document->create_simple_element(

    parent = root

    name = ‘Series’ ).

  label_string = text-001.

  series->set_attribute(  name = ‘label’

                          value = label_string ).

  series->set_attribute(  name = ‘customizing’

                          value = ‘Series1’ ).

  loop at appl->pareto_data into ipareto.

    s = ipareto-percent_scrap.

    document->create_simple_element(

  parent = series

  name = ‘S’

  value = s ).

  endloop.

Now all we have to is render out XML into the returning parameter of our method:

  • write data into string

  streamfactory = ixml->create_stream_factory( ).

  ostream = streamfactory->create_ostream_xstring( xml ).

  document->render( ostream = ostream recursive = ‘X’ ).

I’m afraid I may have been a little long winded in this weblog.  I hope that I haven’t lost most of my audience.  I just can’t help but get excited by good, fun technology like the IGS.  Well if anyone is still with me, be sure to tune in next time for a look at Table View Iterators.

To report this post you need to login first.

64 Comments

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

  1. Kai Gutenkunst
    Great weblog!
    I just want to add that the Chart Designer (as an external tool for defining your customizing XML) is now available in the download area of the SDN: Downloads – Developer or Administrator Tool – Web AS – SAP Chart Designer.
    (0) 
  2. Kai Gutenkunst
    Great weblog!
    I just want to add that the Chart Designer (as an external tool for defining your customizing XML) is now available in the download area of the SDN: Downloads – Developer or Administrator Tool – Web AS – SAP Chart Designer.
    (0) 
  3. Kai Gutenkunst
    Great weblog!
    I just want to add that the Chart Designer (as an external tool for defining your customizing XML) is now available in the download area of the SDN: Downloads – Developer or Administrator Tool – Web AS – SAP Chart Designer.
    (0) 
  4. saravanan vellaimunian
    Hi,

    Your XML handling is superb. I want to know how to give the x and y axis values to SCATTER chart.
    I tried with category and serious but i didn’t find any change in the chart area. Can you please help in this.

    (0) 
    1. Thomas Jung Post author
      I’ve never done a SCATTER chart, so I’m not aware of any specical formatting of the XML that might be necessary.  I suggest that you try the chart designer.  That is how I first studied the XML for my charts.  Create a SCATTER chart in the designer (even if it is simple) and then have a look at the generated XML to give you a starting point to create your own.
      (0) 
  5. saravanan vellaimunian
    Hi,

    Your XML handling is superb. I want to know how to give the x and y axis values to SCATTER chart.
    I tried with category and serious but i didn’t find any change in the chart area. Can you please help in this.

    (0) 
    1. Thomas Jung Post author
      I’ve never done a SCATTER chart, so I’m not aware of any specical formatting of the XML that might be necessary.  I suggest that you try the chart designer.  That is how I first studied the XML for my charts.  Create a SCATTER chart in the designer (even if it is simple) and then have a look at the generated XML to give you a starting point to create your own.
      (0) 
  6. saravanan vellaimunian
    Hi,

    Your XML handling is superb. I want to know how to give the x and y axis values to SCATTER chart.
    I tried with category and serious but i didn’t find any change in the chart area. Can you please help in this.

    (0) 
    1. Thomas Jung Post author
      I’ve never done a SCATTER chart, so I’m not aware of any specical formatting of the XML that might be necessary.  I suggest that you try the chart designer.  That is how I first studied the XML for my charts.  Create a SCATTER chart in the designer (even if it is simple) and then have a look at the generated XML to give you a starting point to create your own.
      (0) 
  7. Kerstin Fender
    Hi Thomas,

    I need a possibility to get a chart from IGS as *.gif, the I my application has to generate a pdf report and embedd the image.
    I have to do this from webdynpro for java , but SAP does not provide an interface to do this.

    Does the chart engine in IGS offer a way for http access ? If you can sent an XML stream from your ABAP code I could do the same from my Java code.

    Thanks
    Kerstin

    (0) 
    1. Thomas Jung Post author
      I have never tried to access the IGS from the Java world.  I can’t say if the IGS has an HTTP interface or not – but the ABAP interfaces does not use HTTP.  It uses RFC to communicate with the IGS (have a look at CL_IGS_DATA).

      It would seem like there must be some IGS interface to the Java World because the IGS is used by Web Dynpro Java – but I have no direct experience in that side of the world.

      It is a little indirect, but if you are desparate, there is no reason why you couldn’t build a Web Service interface around the ABAP implementation of the IGS.

      (0) 
  8. Kerstin Fender
    Hi Thomas,

    I need a possibility to get a chart from IGS as *.gif, the I my application has to generate a pdf report and embedd the image.
    I have to do this from webdynpro for java , but SAP does not provide an interface to do this.

    Does the chart engine in IGS offer a way for http access ? If you can sent an XML stream from your ABAP code I could do the same from my Java code.

    Thanks
    Kerstin

    (0) 
    1. Thomas Jung Post author
      I have never tried to access the IGS from the Java world.  I can’t say if the IGS has an HTTP interface or not – but the ABAP interfaces does not use HTTP.  It uses RFC to communicate with the IGS (have a look at CL_IGS_DATA).

      It would seem like there must be some IGS interface to the Java World because the IGS is used by Web Dynpro Java – but I have no direct experience in that side of the world.

      It is a little indirect, but if you are desparate, there is no reason why you couldn’t build a Web Service interface around the ABAP implementation of the IGS.

      (0) 
  9. Kerstin Fender
    Hi Thomas,

    I need a possibility to get a chart from IGS as *.gif, the I my application has to generate a pdf report and embedd the image.
    I have to do this from webdynpro for java , but SAP does not provide an interface to do this.

    Does the chart engine in IGS offer a way for http access ? If you can sent an XML stream from your ABAP code I could do the same from my Java code.

    Thanks
    Kerstin

    (0) 
    1. Thomas Jung Post author
      I have never tried to access the IGS from the Java world.  I can’t say if the IGS has an HTTP interface or not – but the ABAP interfaces does not use HTTP.  It uses RFC to communicate with the IGS (have a look at CL_IGS_DATA).

      It would seem like there must be some IGS interface to the Java World because the IGS is used by Web Dynpro Java – but I have no direct experience in that side of the world.

      It is a little indirect, but if you are desparate, there is no reason why you couldn’t build a Web Service interface around the ABAP implementation of the IGS.

      (0) 
  10. Ganesh Suryanarayan
    Hi Thomas,

    Thanks for the nice Weblog. I was able to download the customize XML from chart designer but I am not able to download the xml format of the data.
    I am keen on a few xml tags that are used on teh data side. I went through the documentation that comes along with IGS but they guve the very basic tags.

    Thanks again for this weblog

    (0) 
    1. Thomas Jung Post author
      During the migration process problems have been reported for this blog. The blog content may look corrupt due to not supported HTML code on this platform. Please adjust the blog content manually before moving it to an official community.
      (0) 
  11. Ganesh Suryanarayan
    Hi Thomas,

    Thanks for the nice Weblog. I was able to download the customize XML from chart designer but I am not able to download the xml format of the data.
    I am keen on a few xml tags that are used on teh data side. I went through the documentation that comes along with IGS but they guve the very basic tags.

    Thanks again for this weblog

    (0) 
    1. Thomas Jung Post author
      During the migration process problems have been reported for this blog. The blog content may look corrupt due to not supported HTML code on this platform. Please adjust the blog content manually before moving it to an official community.
      (0) 
  12. Ganesh Suryanarayan
    Hi Thomas,

    Thanks for the nice Weblog. I was able to download the customize XML from chart designer but I am not able to download the xml format of the data.
    I am keen on a few xml tags that are used on teh data side. I went through the documentation that comes along with IGS but they guve the very basic tags.

    Thanks again for this weblog

    (0) 
    1. Thomas Jung Post author
      During the migration process problems have been reported for this blog. The blog content may look corrupt due to not supported HTML code on this platform. Please adjust the blog content manually before moving it to an official community.
      (0) 
  13. Ivan Galkin
    Hello Thomas, Hello All.

    This blog is very helpful. Just a little suggestion:

    For conversion of a w3htmltabtype in xstring you convert a table to a string and then convert a string to a xstring.

    Maybe this way would be easier:

    include lscms_convf01.     “here you find a lot of useful functions for conversion

    perform binary_to_xstring
      tables
        binary_tab  “w3htmltabtype
      using
        value(first_line) type i “-1
        value(last_line) type i  “-1
        binary_size type any     “table size
        xbuffer type xstring.    “your xstring

    Thanks again,
    Ivan Galkin

    (0) 
  14. Ivan Galkin
    Hello Thomas, Hello All.

    This blog is very helpful. Just a little suggestion:

    For conversion of a w3htmltabtype in xstring you convert a table to a string and then convert a string to a xstring.

    Maybe this way would be easier:

    include lscms_convf01.     “here you find a lot of useful functions for conversion

    perform binary_to_xstring
      tables
        binary_tab  “w3htmltabtype
      using
        value(first_line) type i “-1
        value(last_line) type i  “-1
        binary_size type any     “table size
        xbuffer type xstring.    “your xstring

    Thanks again,
    Ivan Galkin

    (0) 
  15. Ivan Galkin
    Hello Thomas, Hello All.

    This blog is very helpful. Just a little suggestion:

    For conversion of a w3htmltabtype in xstring you convert a table to a string and then convert a string to a xstring.

    Maybe this way would be easier:

    include lscms_convf01.     “here you find a lot of useful functions for conversion

    perform binary_to_xstring
      tables
        binary_tab  “w3htmltabtype
      using
        value(first_line) type i “-1
        value(last_line) type i  “-1
        binary_size type any     “table size
        xbuffer type xstring.    “your xstring

    Thanks again,
    Ivan Galkin

    (0) 
  16. Matthias Kabel
    Thanks for all the information. But I think you don’t need an z-table for storing the xml-customizing, just use the mime-repository. Create an new folder an use the import function. To retrieve the customizinbg you can use class cl_wb_mime_repository=>load_mime

    Matthias

    (0) 
    1. Thomas Jung Post author
      >But I think you don’t need an z-table for storing the xml-customizing, just use the mime-repository.

      There are lots of places you can store it.  I choose to use my own DB table.  MIME repository is another option. 

      (0) 
  17. Matthias Kabel
    Thanks for all the information. But I think you don’t need an z-table for storing the xml-customizing, just use the mime-repository. Create an new folder an use the import function. To retrieve the customizinbg you can use class cl_wb_mime_repository=>load_mime

    Matthias

    (0) 
    1. Thomas Jung Post author
      >But I think you don’t need an z-table for storing the xml-customizing, just use the mime-repository.

      There are lots of places you can store it.  I choose to use my own DB table.  MIME repository is another option. 

      (0) 
  18. Matthias Kabel
    Thanks for all the information. But I think you don’t need an z-table for storing the xml-customizing, just use the mime-repository. Create an new folder an use the import function. To retrieve the customizinbg you can use class cl_wb_mime_repository=>load_mime

    Matthias

    (0) 
    1. Thomas Jung Post author
      >But I think you don’t need an z-table for storing the xml-customizing, just use the mime-repository.

      There are lots of places you can store it.  I choose to use my own DB table.  MIME repository is another option. 

      (0) 
  19. Anil Mishra
    Hi,
    This is great blog and very useful.
    I would like to know, how to download PDF using CL_GUI_CHART_ENGINE & CL_IGS_CHART_ENGINE.

    Is there anywayout ?

    Thanks
    Anil

    (0) 
    1. Thomas Jung Post author
      PDF is not one of the output file formats supported by the IGS.

      The only way to product a PDF would be to render the graphic and recieve it back into an XSTRING.  Then pass that XSTRING into an Adobe Form and output it on the form as an Image. 

      (0) 
          1. Anil Mishra
            Hi Thomas,

            Thanks for your quick reply.
            How to pass the image into an Adobe Form ? Would appreciate if you will send me piece of sample code.
            Thanks
            Anil

            (0) 
              1. Anil Mishra
                Hi I gone through following url you provided,
                http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3c/a670692dbc494fb5416fdaa93ee1a9/frameset.htm

                My client requirement is to download chart to pdf in abap report GRAPHICS_GUI_CE_DEMO (not webdynpro). I am not using webdynpro, or abap life cycle designer.

                I tried a lot searching webblog, forums. however i didnot find useful solution.

                Can you advice me correct direction to proceed with ? Is it possible to generate spool using cl_gui, or cl_igs class. or covert image/xml to pdf directly ?

                Thanks for your all help.

                (0) 
                1. Thomas Jung Post author
                  My answer hasn’t changed – passing the image into a form is the only way to get it converted to PDF on the server. Using an Adobe forum doesn’t require the use of Web Dynpro. You can process a forum via function module from any type of ABAP program.
                  (0) 
                  1. Anil Mishra
                    Thank you for your great help.
                    Now i would like to download updated pdf file after user change the chart like chart type or dimensions in global settings ? How to generate updated xstring ?

                    Please assist.

                    Thanks a ton again.

                    (0) 
                    1. Anil Mishra
                      I went through your nice blog, it really a great blog, I am using GRAPHICS_GUI_CE_DEMO. I am able to generate pdf form using  cl_igs_chart_engine .

                      Now i would like to download updated pdf file after user change the chart like chart type or dimensions in global settings ? How to generate updated xstring  and pass it to pdf? Any idea..

                      Please assist.

                      Thanks a ton in advance.

                      Regards,
                      Anee Mishra
                      SAP ABAP

                      (0) 
  20. Anil Mishra
    Hi,
    This is great blog and very useful.
    I would like to know, how to download PDF using CL_GUI_CHART_ENGINE & CL_IGS_CHART_ENGINE.

    Is there anywayout ?

    Thanks
    Anil

    (0) 
    1. Thomas Jung Post author
      PDF is not one of the output file formats supported by the IGS.

      The only way to product a PDF would be to render the graphic and recieve it back into an XSTRING.  Then pass that XSTRING into an Adobe Form and output it on the form as an Image. 

      (0) 
          1. Anil Mishra
            Hi Thomas,

            Thanks for your quick reply.
            How to pass the image into an Adobe Form ? Would appreciate if you will send me piece of sample code.
            Thanks
            Anil

            (0) 
              1. Anil Mishra
                Hi I gone through following url you provided,
                http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3c/a670692dbc494fb5416fdaa93ee1a9/frameset.htm

                My client requirement is to download chart to pdf in abap report GRAPHICS_GUI_CE_DEMO (not webdynpro). I am not using webdynpro, or abap life cycle designer.

                I tried a lot searching webblog, forums. however i didnot find useful solution.

                Can you advice me correct direction to proceed with ? Is it possible to generate spool using cl_gui, or cl_igs class. or covert image/xml to pdf directly ?

                Thanks for your all help.

                (0) 
                1. Thomas Jung Post author
                  My answer hasn’t changed – passing the image into a form is the only way to get it converted to PDF on the server. Using an Adobe forum doesn’t require the use of Web Dynpro. You can process a forum via function module from any type of ABAP program.
                  (0) 
                  1. Anil Mishra
                    Thank you for your great help.
                    Now i would like to download updated pdf file after user change the chart like chart type or dimensions in global settings ? How to generate updated xstring ?

                    Please assist.

                    Thanks a ton again.

                    (0) 
                    1. Anil Mishra
                      I went through your nice blog, it really a great blog, I am using GRAPHICS_GUI_CE_DEMO. I am able to generate pdf form using  cl_igs_chart_engine .

                      Now i would like to download updated pdf file after user change the chart like chart type or dimensions in global settings ? How to generate updated xstring  and pass it to pdf? Any idea..

                      Please assist.

                      Thanks a ton in advance.

                      Regards,
                      Anee Mishra
                      SAP ABAP

                      (0) 
  21. Anil Mishra
    Hi,
    This is great blog and very useful.
    I would like to know, how to download PDF using CL_GUI_CHART_ENGINE & CL_IGS_CHART_ENGINE.

    Is there anywayout ?

    Thanks
    Anil

    (0) 
    1. Thomas Jung Post author
      PDF is not one of the output file formats supported by the IGS.

      The only way to product a PDF would be to render the graphic and recieve it back into an XSTRING.  Then pass that XSTRING into an Adobe Form and output it on the form as an Image. 

      (0) 
          1. Anil Mishra
            Hi Thomas,

            Thanks for your quick reply.
            How to pass the image into an Adobe Form ? Would appreciate if you will send me piece of sample code.
            Thanks
            Anil

            (0) 
              1. Anil Mishra
                Hi I gone through following url you provided,
                http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3c/a670692dbc494fb5416fdaa93ee1a9/frameset.htm

                My client requirement is to download chart to pdf in abap report GRAPHICS_GUI_CE_DEMO (not webdynpro). I am not using webdynpro, or abap life cycle designer.

                I tried a lot searching webblog, forums. however i didnot find useful solution.

                Can you advice me correct direction to proceed with ? Is it possible to generate spool using cl_gui, or cl_igs class. or covert image/xml to pdf directly ?

                Thanks for your all help.

                (0) 
                1. Thomas Jung Post author
                  My answer hasn’t changed – passing the image into a form is the only way to get it converted to PDF on the server. Using an Adobe forum doesn’t require the use of Web Dynpro. You can process a forum via function module from any type of ABAP program.
                  (0) 
                  1. Anil Mishra
                    Thank you for your great help.
                    Now i would like to download updated pdf file after user change the chart like chart type or dimensions in global settings ? How to generate updated xstring ?

                    Please assist.

                    Thanks a ton again.

                    (0) 
                    1. Anil Mishra
                      I went through your nice blog, it really a great blog, I am using GRAPHICS_GUI_CE_DEMO. I am able to generate pdf form using  cl_igs_chart_engine .

                      Now i would like to download updated pdf file after user change the chart like chart type or dimensions in global settings ? How to generate updated xstring  and pass it to pdf? Any idea..

                      Please assist.

                      Thanks a ton in advance.

                      Regards,
                      Anee Mishra
                      SAP ABAP

                      (0) 
  22. Guillaume GARCIA

    Hi,

    Would it be possible to simply render text as an image (I would like to be able to render an image containing employee’s initials if he/she has not uploaded his/her photo).

    I managed to do it by using the title of an empty chart but it is more a hack than anything else…

    Thx.

    Best regards,

    Guillaume

    (0) 

Leave a Reply