Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with CL_GUI_GP_PRES and Customizing

Hello,

i made a ABAP for displaying a grahpic chart which works fine. But the chart is without any color.

[Screenshot|http://www.home.vr-web.de/markus.Marb/sap_problem.jpg]

I did the following coding in the customizing form.

FORM SET_CUSTo_auftrags_monitor.

data:

cuobj TYPE REF TO IF_CUSTOMIZING,

BUNDLE_DISPLAY TYPE REF TO CL_CU_DISPLAY_CONTEXT,

BUNDLE_SHEET TYPE REF TO CL_CU_DATA_SHEET,

BUNDLE_VALUES TYPE REF TO CL_CU_VALUES,

titel_auftrags_monitor(50) type c,

hilfsfeld_uhrzeit(15) type c,

hilfsfeld_datum(15) type c.

  • compiler needs them:

class cl_cu definition load.

class cl_cu_drawing_area definition load.

class cl_cu_display_context definition load.

class cl_cu_values definition load.

  • 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.

if not cuobj is initial.

  • set the title

write: sy-datum to hilfsfeld_datum.

write: sy-uzeit to hilfsfeld_uhrzeit.

concatenate 'Stand:' hilfsfeld_datum hilfsfeld_uhrzeit into

titel_auftrags_monitor separated by space.

CALL METHOD cuobj->SET

EXPORTING ATTR_ID = CL_CU_DRAWING_AREA=>CO_TITLE

VALUE = titel_auftrags_monitor.

  • get title context of drawing area

call method cuobj->get

exporting attr_id = cl_cu_drawing_area=>co_title_context

importing value = BUNDLE_DISPLAY.

  • set visibility of title

CALL METHOD BUNDLE_DISPLAY->IF_CUSTOMIZING~SET

EXPORTING ATTR_ID = CL_CU_DISPLAY_CONTEXT=>co_visibility

VALUE = gfw_true.

  • copy display context into drawing area (title)

CALL METHOD cuobj->SET

EXPORTING ATTR_ID = CL_CU_drawing_area=>CO_title_CONTEXT

VALUE = BUNDLE_DISPLAY.

endif.

  • Settings for column 1

CALL METHOD GP_INST->IF_GRAPHIC_PROXY~GET_CU_BUNDLE

EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART

BUNDLE_TYPE = CL_CU=>CO_CLSID_VALUES

KEY = text_zeile1

IMPORTING BUNDLE = cuobj.

if not cuobj is initial.

  • prepare display context for values

call method cuobj->get

exporting attr_id = cl_cu_values=>co_curve_context

importing value = BUNDLE_DISPLAY.

  • set color of data series

CALL METHOD bundle_display->IF_CUSTOMIZING~SET

EXPORTING ATTR_ID = cl_cu_display_context=>co_bg_clr_plt_id

VALUE = 5. " green

  • copy display context into values

CALL METHOD cuobj->SET

exporting ATTR_ID = cl_cu_values=>co_curve_context

VALUE = BUNDLE_DISPLAY.

endif.

ENDFORM.

Thanks for your help

Kind regards

Markus

Not what you were looking for? View more on this topic or Ask a question