Skip to Content
author's profile photo Former Member
Former Member

PIE CHART XML

Hello,

I try to create a pie chart, but it doesn't work. At least I tried this way: http://scn.sap.com/people/kai.gutenkunst/blog/2009/02/26/creating-charts-without-using-xml-classes .

But I don't know how the xml-file has to look like for a pie chart.

I also try to use the CHARTDESINGER (and the documentation), and I look up in the example GFW_PROG_PIE.

Can anyone help me please?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Apr 20, 2012 at 06:25 PM

    Hi Julia,

    Try GRAL ......... (T-Code) , there are loads of Sample programs .... hope something u might get helpful there. ...............

    In addition to GRAL, try using - FM => GRAPH_MATRIX_3D, GRAPH_3D ... these are easy to use... read documentation and try seeking online help.......

    Thanks and Regards,
    Ravindra Sonar.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 26, 2012 at 01:16 PM

    thanks for your efforts!

    after a lot of experiments I found a way with the above link. For all developer who have the save problem here the solution:

    (It's a 2D Pie Chart, if you want a 3D you have to modify xml file).

    TYPES values_type TYPE STANDARD TABLE OF i.

    MODULE pbo_0101 OUTPUT.

    * create some demo data in an internal table
    APPEND 'a' TO categories.
    APPEND 'b' TO categories.
    APPEND 'c' TO categories.
    series-label = 'Values'.
    series-id = 'Series1'.
    APPEND '10' TO series-values.
    APPEND '30' TO series-values.
    APPEND '40' TO series-values.
    APPEND series TO series_table.
    CLEAR series-values.

    DATA: customizing_xml TYPE xstring.
    * create some basic customizing settings
    CALL TRANSFORMATION ztest_t2xml
    SOURCE title = 'Text' chart_type = 'Pie'
    categories = categories series = series_table
    RESULT XML customizing_xml.

    CREATE OBJECT go_ce_container
    EXPORTING
    container_name = 'CONTAINER'.
    CREATE OBJECT go_ce_viewer
    EXPORTING
    parent = go_ce_container.

    go_ce_viewer->set_data( xdata = customizing_xml ).
    go_ce_viewer->set_customizing( xdata = customizing_xml ).
    CALL METHOD go_ce_viewer->render.

    ENDMODULE.

    XML FILE:

    <?sap.transformsimple?>

    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

    <tt:root name="CHART_TYPE"/>

    <tt:root name="TITLE"/>

    <tt:rootname="CATEGORIES"/>

    <tt:root name="SERIES"/>

    <tt:template>

    <SAPChartCustomizingversion="2.1">

    <GlobalSettings>

    <ColorPalette>Tradeshow</ColorPalette>

    <Defaults>

    <ChartType>

    <tt:valueref="CHART_TYPE"/>

    </ChartType>

    </Defaults>

    </GlobalSettings>

    <Elements>

    </Elements>

    <Categories>

    <tt:loop ref="CATEGORIES">

    <Category>

    <tt:value/>

    </Category>

    </tt:loop>

    </Categories>

    <tt:loop ref="SERIES">

    <Series>

    <tt:attribute name="label">

    <tt:valueref="LABEL"/>

    </tt:attribute>

    <tt:attribute name="customizing">

    <tt:value ref="ID"/>

    </tt:attribute>

    <tt:loopref="VALUES">

    <Point>

    <Value type="y">

    <tt:value/>

    </Value>

    </Point>

    </tt:loop>

    </Series>

    </tt:loop>

    </SAPChartCustomizing>

    </tt:template>

    </tt:transform>

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.