2008 Feb 20 1:10 PM
Hi. I've got a huge problems with ABAP charts. There's a demo programm GFW_PROG_GET_CU_BUNDLE of which copy I made. There's a button change_customizing in the screen.
When You click that colors of chart bars will be changed. The chart label is changing too. The subprogram that stands behind that action is CHANGE_CUSTOMIZING
*&---------------------------------------------------------------------*
*& Form CHANGE_CUSTOMIZING
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM CHANGE_CUSTOMIZING.
DATA: cuobj TYPE REF TO IF_CUSTOMIZING,
BUNDLE_DISPLAY TYPE REF TO CL_CU_DISPLAY_CONTEXT,
title TYPE GFWLABEL,
color TYPE I.
* get customizing object for drawing area
CALL METHOD GP_INST->IF_GRAPHIC_PROXY~GET_CU_BUNDLE
EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART
BUNDLE_TYPE = CL_CU=>CO_CLSID_DRAWING_AREA
IMPORTING BUNDLE = cuobj.
* toggle title
if not cuobj is initial.
* get current title
CALL METHOD cuobj->GET
EXPORTING ATTR_ID = CL_CU_DRAWING_AREA=>CO_TITLE
IMPORTING VALUE = title.
if title = CO_GFW_PROG_TITLE1.
title = CO_GFW_PROG_TITLE2.
else.
title = CO_GFW_PROG_TITLE1.
endif.
* set new title
CALL METHOD cuobj->SET
EXPORTING ATTR_ID = CL_CU_DRAWING_AREA=>CO_TITLE
VALUE = title.
endif.
* get customizing object for value
CALL METHOD GP_INST->IF_GRAPHIC_PROXY~GET_CU_BUNDLE
EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART
KEY = co_gfw_prog_series1
BUNDLE_TYPE = CL_CU=>CO_CLSID_VALUES
IMPORTING BUNDLE = cuobj.
if not cuobj is initial.
* get display context
CALL METHOD cuobj->GET
EXPORTING ATTR_ID = CL_CU_VALUES=>CO_CURVE_CONTEXT
IMPORTING VALUE = bundle_display.
* toggle color
if not bundle_display is initial.
* get current color
call method bundle_display->if_customizing~get
EXPORTING ATTR_ID = CL_CU_DISPLAY_CONTEXT=>co_bg_clr_plt_id
IMPORTING VALUE = color.
if color = 5.
color = 8.
else.
color = 5.
endif.
* set new color
call method bundle_display->if_customizing~set
EXPORTING ATTR_ID = CL_CU_DISPLAY_CONTEXT=>co_bg_clr_plt_id
VALUE = color.
call method cuobj->set
EXPORTING ATTR_ID = CL_CU_VALUES=>CO_CURVE_CONTEXT
VALUE = bundle_display.
endif.
endif.
ENDFORM. " CHANGE_CUSTOMIZING
And now my problem is: how should I modify that Form to change bar's height too (that is update source data for that chart). I see accessing to chart component is done like that:
* set new color
call method bundle_display->if_customizing~set
EXPORTING ATTR_ID = CL_CU_DISPLAY_CONTEXT=>co_bg_clr_plt_id
VALUE = color.
and what should I do to have access to the Y dimension value of each chart bar?
I just want to achieve such effect when user change some values in the screen - the chart will fit new data automatically .
I'd be very thankful for help . Greetings . P
2008 Feb 20 3:36 PM
Hi,
changing the customizing is definitely the wrong direction to go.
You have to change the content of the data container instead!
Run the demo report GFW_DEMO_PRES and push the graphics button on the right hand side to enable the chart. Then change a number within the table and press return. In debugging mode you will see that the modified table cell is written to the GFW data container (see MODIFIED_TAB_DC_100 INPUT).
Regards, Kai
Hi,
changing the customizing is definitely the wrong direction to go.
You have to change the content of the data container instead!
Run the demo report GFW_DEMO_PRES and push the graphics button on the right hand side to enable the chart. Then change a number within the table and press return. In debugging mode you will see that the modified table cell is written to the GFW data container (see MODIFIED_TAB_DC_100 INPUT).
Regards, Kai
2008 Feb 20 3:36 PM
Hi,
changing the customizing is definitely the wrong direction to go.
You have to change the content of the data container instead!
Run the demo report GFW_DEMO_PRES and push the graphics button on the right hand side to enable the chart. Then change a number within the table and press return. In debugging mode you will see that the modified table cell is written to the GFW data container (see MODIFIED_TAB_DC_100 INPUT).
Regards, Kai
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |