‎2008 Jun 18 11:56 AM
Hi everybody,
I did some research into SAP's charting capabilities and I am a little confused about the different ways charts can be created.
One key feature I need in my charting application is event handling, for example when a user clicks on a pie wedge.
Right now I see three different ways of creating charts in ABAP
- Using the GRAPH_... function modules for example GRAPH_2D
- Using the Graphical Framework as in GFW_PROG_TUTORIAL
- Using the CL_GUI_CHART_ENGINE class
Is there any major difference between these three? I know that GFW and CL_GUI_CHART_ENGINE support event handling. Do the GRAPH_... FuBas so?
BTW, is it possible to use the xml file created in Chart Designer in one of the aforementioned solutions?
Thanks everybody,
Mane
‎2008 Jun 18 12:37 PM
you can use the XML along with cl_gui_chart_engine.
hope you would have seen the demo program
GRAPHICS_GUI_CE_DEMO
‎2008 Jun 18 12:37 PM
you can use the XML along with cl_gui_chart_engine.
hope you would have seen the demo program
GRAPHICS_GUI_CE_DEMO
‎2008 Jun 18 12:55 PM
Unfortunately I can't access this program. I am working on a 470 system and it looks like there is no such report.
‎2008 Jun 18 1:39 PM
sorry, that program is available only from WAS6.40. it uses the IGS engine
‎2008 Jun 18 2:15 PM
I created a test program using GFW but unfortunately I didn't find any help for the values of the constants defined in CL_CU_VALUES.
I know that I have to use IF_CUSTOMIZING->SET with the constants from CL_CU_VALUES, but nothing about the values to change those values, is there anything out there?
I also tried the CL_GUI_CHART_ENGINE and it works pretty fine, although the xml encoding for the data is a pretty ugly. Is there a way to provide the data as table?
‎2008 Jun 19 4:36 PM
Hi,
using the chart engine is definitely the right choice!
As the chart engine is shipped as a SAPGUI control and as part of the IGS it's up to you which technology fits your needs best.
If you do not want to struggle with XML coding I suggest that you implement a method once that simply converts your tables to an iXML document.
However, I do not want to hide that the attributes of the old technology GFW are documented in se24 directly. Just select the attribute and push F9.
Regards, Kai
‎2008 Jun 19 4:38 PM
This code snippet shows how to use function GFW_PRES_SHOW.
...data gathering
*__Make data format
DATA: lv_cnt(2), lv_text(30).
REFRESH values.
REFRESH column_texts.
SORT it_gra BY zcono.
*__Row definition
LOOP AT it_gra.
lv_cnt = sy-tabix.
CONCATENATE 'VALUES-VAL' lv_cnt INTO lv_text.
CONDENSE lv_text.
ASSIGN (lv_text) TO <fs>.
<fs> = it_gra-cnt.
ENDLOOP.
*___Row Text
values-rowtxt = '??????'.
APPEND values.
*__Column definition
LOOP AT it_gra.
column_texts-coltxt = it_gra-zcono.
APPEND column_texts.
ENDLOOP.
*___Call graph function
CALL FUNCTION 'GFW_PRES_SHOW'
EXPORTING
presentation_type = 31 "graph type 31 = pie type, 8 or 1 = bar chart
parent = contc "Custom Container
TABLES
values = values "row data(Maximun 32)
column_texts = column_texts " column definition
EXCEPTIONS
error_occurred = 1
OTHERS = 2.