SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Demo: Business Graphics with GFW



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming -> Graphics
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Mon Nov 05, 2007 3:39 pm    Post subject: Demo: Business Graphics with GFW Reply with quote

Code:
 
REPORT GFW_DEMO_PRES1 .
***********************************************************************
* This is a program to demonstrate the functionality of the
* Graphical Framework (GFW).
* This is not a programming example. If you want to learn how to
* use the GFW in your own programs please take a closer look at our
* programming examples (with prefix GFW_PROG_).
***********************************************************************

* texts for example programs of GFW
INCLUDE GFW_PROG_TEXT.

* data container (DC)
INCLUDE GFW_DC_PRES.

DATA: OK_CODE          TYPE SY-UCOMM,
      ID               TYPE DOKHL-ID,
      LANGU            TYPE DOKHL-LANGU,
      OBJECT           TYPE DOKHL-OBJECT,
      FIRSTCALL        TYPE I,
      CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
      DC_INST          TYPE REF TO LCL_DC_PRES,
      DC_MANAGE        TYPE REF TO IF_DC_MANAGEMENT,
      MY_ID_AT_DC      TYPE I,
      RETVAL           TYPE SYMSGNO,
      GP_INST          TYPE REF TO CL_GUI_GP_PRES,
      EVTCODE_LIST     TYPE CNTL_SIMPLE_EVENTS,
      SIMPLE_EVENT     type CNTL_SIMPLE_EVENT.

* main class needed to catch gui events
CLASS LCL_MAIN DEFINITION.
  PUBLIC SECTION.
    METHODS: ON_CLOSED FOR EVENT IF_GRAPHIC_PROXY~GRAPHIC_CLOSED
                       OF CL_GUI_GP_PRES IMPORTING EVENT.
ENDCLASS.
CLASS LCL_MAIN IMPLEMENTATION.
METHOD ON_CLOSED.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~FREE
                         IMPORTING RETVAL = RETVAL.
  LEAVE PROGRAM.
ENDMETHOD.
ENDCLASS.
DATA: MAIN TYPE REF TO LCL_MAIN.

START-OF-SELECTION.

* fill table of event codes for graphics proxy (optional)
* use application event (PAI/PBO processing to reach distribute_changes)
* for value changes:
simple_event-appl_event = 'X'.
simple_event-EVENTID = IF_GRAPHIC_PROXY=>CO_EVT_VALUE_CHANGED.
APPEND simple_event TO EVTCODE_LIST.
* use system event (no PAI processing) for customizing changes:
*simple_event-appl_event = space.
simple_event-EVENTID = IF_GRAPHIC_PROXY=>CO_EVT_CUSTOM_CHANGED.
APPEND simple_event TO EVTCODE_LIST.

CREATE OBJECT MAIN.
SET HANDLER MAIN->ON_CLOSED FOR ALL INSTANCES.

* USAGE allowed in SAP internal test reports, only
include applg_auto_test_init.

CALL SCREEN 100.

* USAGE allowed in SAP internal test reports, only
include applg_auto_test_form.

*&---------------------------------------------------------------------*
*&      Module  PBO_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE PBO_0100 OUTPUT.
  SET PF-STATUS '100'.
  RETVAL = CL_GFW=>OK.
  IF FIRSTCALL IS INITIAL.
*   create, initialize and fill data container
    CREATE OBJECT DC_INST.
    DC_MANAGE = DC_INST.
    CALL METHOD DC_MANAGE->INIT IMPORTING ID = MY_ID_AT_DC
                                          RETVAL = RETVAL.
    IF RETVAL <CL_GFW>OK.
      CALL METHOD CL_GFW=>SHOW_MSG EXPORTING MSGNO = RETVAL.
      CLEAR DC_INST.
      CLEAR DC_MANAGE.
    ELSE.
      PERFORM FILL_DC CHANGING RETVAL.
      IF RETVAL <CL_GFW>OK.
        CALL METHOD CL_GFW=>SHOW_MSG EXPORTING MSGNO = RETVAL.
      ELSE.
*       create container in which to place graphic
*       (place it in the custom control named CONTAINER
*        defined using screenpainter in dynpro 100)
        CREATE OBJECT CUSTOM_CONTAINER
          EXPORTING
            CONTAINER_NAME = 'CONTAINER'. "use uppercase letters!
"       there will be a RABAX here if any error occured while creating
"       the container
*       create, initialize and activate graphics proxy
        CREATE OBJECT GP_INST.
        CALL METHOD GP_INST->IF_GRAPHIC_PROXY~INIT
                 EXPORTING parent  = CUSTOM_CONTAINER
                           DC      = DC_INST
                           PROD_ID = CL_GUI_GP_PRES=>CO_PROD_CHART
*                          prod_id = cl_gui_gp_pres=>co_prod_sapocx
*                          prod_id = cl_gui_gp_pres=>co_prod_sap
                           EVTCODE_LIST = EVTCODE_LIST
                 IMPORTING RETVAL  = RETVAL.
        IF RETVAL = CL_GFW=>OK.
*         set dc attributes
          CALL METHOD GP_INST->SET_DC_NAMES
                    EXPORTING
                       OBJ_ID    = 'OBJID'
                       DIM1      = 'X_VAL'
                       DIM2      = 'Y_VAL'
                       GRP_ID    = 'GRPID'
                       TEXT      = 'TEXT'
                       OBJREF_ID = 'CU_REFOBJ'
                    IMPORTING RETVAL = RETVAL.
        ENDIF. "// set dc attributes

*       set customizing objects
        IF RETVAL = CL_GFW=>OK.
          perform set_customizing.
        ENDIF.

        IF RETVAL = CL_GFW=>OK.
          CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ACTIVATE
                               IMPORTING RETVAL = RETVAL.
        ENDIF.
        IF RETVAL <CL_GFW>OK.
          CALL METHOD CL_GFW=>SHOW_MSG EXPORTING MSGNO = RETVAL.
        ENDIF.
      ENDIF. "//fill_dc ok
      FIRSTCALL = 1.
    ENDIF. "//create and init dc ok
  ENDIF.

* **** distribute changes (to all subscribed graphics proxies)
  IF NOT DC_MANAGE IS INITIAL.
    CALL METHOD DC_MANAGE->DISTRIBUTE_CHANGES
                         IMPORTING RETVAL = RETVAL.
    IF RETVAL <CL_GFW>OK.
      CALL METHOD CL_GFW=>SHOW_MSG EXPORTING MSGNO = RETVAL.
    ENDIF.
  ENDIF.
* **** activate mux (handling of external graphics and synchronizations)
  CALL METHOD CL_GFW_MUX=>ACTIVATE IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK.
    CALL METHOD CL_GFW=>SHOW_MSG EXPORTING MSGNO = RETVAL.
  ENDIF.

* USAGE allowed in SAP internal test reports, only
  perform auto_test_pbo USING 'EXIT'.

ENDMODULE.                 " PBO_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  PAI_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE PAI_0100 INPUT.
  OK_CODE = SY-UCOMM.
* activate event analysis of object-oriented Control Framework
  CALL METHOD CL_GUI_CFW=>DISPATCH.
* handle other events
  CASE OK_CODE.
    WHEN 'BACK'.
      CALL METHOD GP_INST->IF_GRAPHIC_PROXY~FREE
                           IMPORTING RETVAL = RETVAL.
      LEAVE PROGRAM.
    WHEN 'EXIT'.
      CALL METHOD GP_INST->IF_GRAPHIC_PROXY~FREE
                           IMPORTING RETVAL = RETVAL.
      LEAVE PROGRAM.
    WHEN 'DOCU'.
      ID = 'RE'. LANGU = SY-LANGU. OBJECT = 'GFW_DEMO_PRES1'.
*     display program documentation
      CALL FUNCTION 'DOCU_CALL'
        EXPORTING
          DISPL             = 'X' "//show mode
          DISPL_MODE        = '2' "//like F1 help
          ID                = ID
          LANGU             = LANGU
          OBJECT            = OBJECT.
    WHEN 'SAVECU'.
      CALL METHOD GP_INST->IF_GRAPHIC_PROXY~SAVE_CUSTOMIZING
                           IMPORTING RETVAL = RETVAL.
  ENDCASE.

ENDMODULE.                 " PAI_0100  INPUT
*&---------------------------------------------------------------------*
*&      Form  FILL_DC
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <p2>E_GP_DCHANDLE.
    EXIT.
  ENDIF.
  RETVAL = CL_GFW=>OK.

* insert first group (corresponding customizing class: cl_cu_values)
  obj-objid = '100'.
  obj-grpid = co_gfw_prog_series1.
  obj-x_val = co_gfw_prog_category1.
  obj-y_val = 50.
  call method dc_inst->set_obj_values
    exporting id     = my_id_at_dc
              obj    = obj
    importing retval = retval.
  if retval <cl_gfw>ok. exit. endif.

  obj-objid = '200'.
  obj-grpid = co_gfw_prog_series1.
  obj-x_val = co_gfw_prog_category2.
  obj-y_val = 100.
  call method dc_inst->set_obj_values
    exporting id     = my_id_at_dc
              obj    = obj
    importing retval = retval.
  if retval <cl_gfw>ok. exit. endif.

  obj-objid = '300'.
  obj-cu_refobj = CO_GFW_PROG_POINT1.
  obj-text  = CO_GFW_PROG_RECORD.
  obj-grpid = co_gfw_prog_series1.
  obj-x_val = co_gfw_prog_category3.
  obj-y_val = 190.
  call method dc_inst->set_obj_values
    exporting id     = my_id_at_dc
              obj    = obj
    importing retval = retval.
  if retval <cl_gfw>ok. exit. endif.

  obj-objid = '400'.
  clear obj-cu_refobj.
  clear obj-text.
  obj-grpid = co_gfw_prog_series1.
  obj-x_val = co_gfw_prog_category4.
  obj-y_val = 70.
  call method dc_inst->set_obj_values
    exporting id     = my_id_at_dc
              obj    = obj
    importing retval = retval.
  if retval <cl_gfw>ok. exit. endif.

  obj-objid = '500'.
  obj-grpid = co_gfw_prog_series1.
  obj-x_val = co_gfw_prog_category5.
  obj-y_val = 60.
  call method dc_inst->set_obj_values
    exporting id     = my_id_at_dc
              obj    = obj
    importing retval = retval.
  if retval <cl_gfw>ok. exit. endif.


* insert second group (corresponding customizing class: cl_cu_values)
  obj-objid = '101'.
  obj-cu_refobj = CO_GFW_PROG_POINT2.
  obj-grpid = co_gfw_prog_series2.
  obj-x_val = co_gfw_prog_category1.
  obj-y_val = 100.
  call method dc_inst->set_obj_values
    exporting id     = my_id_at_dc
              obj    = obj
    importing retval = retval.
  if retval <cl_gfw>ok. exit. endif.

  obj-objid = '201'.
  clear obj-cu_refobj.
  obj-grpid = co_gfw_prog_series2.
  obj-x_val = co_gfw_prog_category2.
  obj-y_val = 170.
  call method dc_inst->set_obj_values
    exporting id     = my_id_at_dc
              obj    = obj
    importing retval = retval.
  if retval <cl_gfw>ok. exit. endif.

  obj-objid = '301'.
  obj-grpid = co_gfw_prog_series2.
  obj-x_val = co_gfw_prog_category4.
  obj-y_val = 140.
  call method dc_inst->set_obj_values
    exporting id     = my_id_at_dc
              obj    = obj
    importing retval = retval.
  if retval <cl_gfw>ok. exit. endif.

  obj-objid = '401'.
  obj-grpid = co_gfw_prog_series2.
  obj-x_val = co_gfw_prog_category5.
  obj-y_val = 0.
  call method dc_inst->set_obj_values
    exporting id     = my_id_at_dc
              obj    = obj
    importing retval = retval.
  if retval <cl_gfw>ok. exit. endif.
ENDFORM.                    " FILL_DC

*&---------------------------------------------------------------------*
*&      Form  SET_CUSTOMIZING
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <p2>IF_CUSTOMIZING~SET
     EXPORTING ATTR_ID = CL_CU_DISPLAY_CONTEXT=>CO_BL_STYLE
                       VALUE = 1. " no border line
  CALL METHOD BUNDLE_DISPLAY->IF_CUSTOMIZING~SET
     EXPORTING ATTR_ID = CL_CU_DISPLAY_CONTEXT=>CO_TF_SIZE
                       VALUE = 7. " font size 7 points
  CALL METHOD BUNDLE_DISPLAY->IF_CUSTOMIZING~SET
    EXPORTING ATTR_ID = CL_CU_DISPLAY_CONTEXT=>CO_BG_CLR_PLT_ID
                       VALUE = 9.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
             EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_DIAGRAM
                        BUNDLE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.

*drawing area
  CREATE OBJECT BUNDLE_DRAWING EXPORTING INSTANCE_ID = 'GFW1T'.
  CALL METHOD BUNDLE_DRAWING->IF_CUSTOMIZING~LOAD.
  CALL METHOD BUNDLE_DRAWING->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID = CL_CU_DRAWING_AREA=>CO_TITLE
                        VALUE = CO_GFW_PROG_BREAKFAST
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
              EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART
                        BUNDLE = BUNDLE_DRAWING
              IMPORTING RETVAL = RETVAL.
* **** prepare display context for da->dc
* get existing context from bundle_drawing
  CALL METHOD BUNDLE_DRAWING->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_DRAWING_AREA=>CO_DISPLAY_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
* add display context to bundle_drawing
  CALL METHOD BUNDLE_DRAWING->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_DRAWING_AREA=>CO_DISPLAY_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
* **** prepare display context for title
* get existing title context from bundle_drawing
  CALL METHOD BUNDLE_DRAWING->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_DRAWING_AREA=>CO_TITLE_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
* ### set something special (optional)
* add title context to bundle_drawing
  CALL METHOD BUNDLE_DRAWING->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_DRAWING_AREA=>CO_TITLE_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
* **** prepare display context for legend
* get existing legend context from bundle_drawing
  CLEAR BUNDLE_DISPLAY.
  CALL METHOD BUNDLE_DRAWING->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_DRAWING_AREA=>CO_LEGEND_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
* ### set something special (optional)
* add legend context to bundle_drawing
  CALL METHOD BUNDLE_DRAWING->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_DRAWING_AREA=>CO_LEGEND_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore

**** values/general
  CREATE OBJECT BUNDLE_VALUES EXPORTING INSTANCE_ID = 'GFW1T'.
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~LOAD.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
              EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART
                        BUNDLE = BUNDLE_VALUES
              IMPORTING RETVAL = RETVAL.
* **** prepare display context for values
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>CO_CURVE_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>CO_CURVE_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
* **** prepare up area context for values
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>co_up_area_context
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>co_up_area_context
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
* **** prepare down area context for values
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>co_down_area_context
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>co_down_area_context
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
**** values for second group
  CREATE OBJECT BUNDLE_VALUES EXPORTING INSTANCE_ID = 'GFW1T_2'.
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~LOAD.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
              EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART
                        KEY  = co_gfw_prog_series2
                        BUNDLE = BUNDLE_VALUES
              IMPORTING RETVAL = RETVAL.
* **** prepare display context for values
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>CO_CURVE_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>CO_CURVE_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
* **** prepare up area context for values
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>co_up_area_context
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>co_up_area_context
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
* **** prepare down area context for values
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>co_down_area_context
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_VALUES->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_VALUES=>co_down_area_context
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore

**** diagram
  CREATE OBJECT BUNDLE_DIAGRAM EXPORTING INSTANCE_ID = 'GFW1T'.
  CALL METHOD BUNDLE_DIAGRAM->IF_CUSTOMIZING~LOAD.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
              EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_DIAGRAM
                        BUNDLE = BUNDLE_DIAGRAM
              IMPORTING RETVAL = RETVAL.
* **** prepare display context for diagram
  CALL METHOD BUNDLE_DIAGRAM->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_DIAGRAM=>CO_DISPLAY_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_DIAGRAM->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_DIAGRAM=>CO_DISPLAY_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore

**** data sheet
  CREATE OBJECT BUNDLE_SHEET EXPORTING INSTANCE_ID = 'GFW1T'.
  CALL METHOD BUNDLE_SHEET->IF_CUSTOMIZING~LOAD.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
              EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART
                        BUNDLE = BUNDLE_SHEET
              IMPORTING RETVAL = RETVAL.
* **** prepare display context for data sheet
  CALL METHOD BUNDLE_SHEET->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_DATA_SHEET=>CO_DISPLAY_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_SHEET->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_DATA_SHEET=>CO_DISPLAY_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore

**** x-axis
  CREATE OBJECT BUNDLE_AXIS_X EXPORTING INSTANCE_ID = 'GFW1T_X'.
  CALL METHOD BUNDLE_AXIS_X->IF_CUSTOMIZING~LOAD.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
    EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART_X_PRIM_AXIS
                        BUNDLE = BUNDLE_AXIS_X
              IMPORTING RETVAL = RETVAL.
* **** prepare title context for axis
  CALL METHOD BUNDLE_AXIS_X->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_AXIS=>CO_TITLE_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_AXIS_X->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_AXIS=>CO_TITLE_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore

**** x-axis/scale 1
  CREATE OBJECT BUNDLE_SCALE1_X EXPORTING INSTANCE_ID = 'GFW1T_X1'.
  CALL METHOD BUNDLE_SCALE1_X->IF_CUSTOMIZING~LOAD.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
    EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART_X_PRIM_AXIS
                        BUNDLE = BUNDLE_SCALE1_X
              IMPORTING RETVAL = RETVAL.
* **** prepare context for scale
  CALL METHOD BUNDLE_SCALE1_X->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_SCALE=>CO_DISPLAY_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_SCALE1_X->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_SCALE=>CO_DISPLAY_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore

**** x-axis/scale 2
 CREATE OBJECT BUNDLE_SCALE2_X EXPORTING INSTANCE_ID = 'GFW1T_X2'.
    CALL METHOD BUNDLE_SCALE2_X->IF_CUSTOMIZING~LOAD.
    CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
      EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART_X_PRIM_AXIS
                          BUNDLE = BUNDLE_SCALE2_X
                IMPORTING RETVAL = RETVAL.

**** y-axis
  CREATE OBJECT BUNDLE_AXIS_Y EXPORTING INSTANCE_ID = 'GFW1T_Y'.
  CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~LOAD.
* set all range titles
  CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID = CL_CU_AXIS=>CO_MIN_RANGE_TITLE
                        VALUE   = CO_GFW_PROG_HUNGRY.
  CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID = CL_CU_AXIS=>CO_OPT_RANGE_TITLE
                        VALUE   = CO_GFW_PROG_SATISFIED.
  CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID = CL_CU_AXIS=>CO_MAX_RANGE_TITLE
                        VALUE   = CO_GFW_PROG_FULL.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
    EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART_Y_PRIM_AXIS
                        BUNDLE = BUNDLE_AXIS_Y
              IMPORTING RETVAL = RETVAL.
* **** prepare title context for axis
  CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_AXIS=>CO_TITLE_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_AXIS=>CO_TITLE_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore

**** y-axis/scale 1
 CREATE OBJECT BUNDLE_SCALE1_Y EXPORTING INSTANCE_ID = 'GFW1T_Y1'.
    CALL METHOD BUNDLE_SCALE1_Y->IF_CUSTOMIZING~LOAD.
    CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
      EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART_Y_PRIM_AXIS
                          BUNDLE = BUNDLE_SCALE1_Y
                IMPORTING RETVAL = RETVAL.
*   **** prepare context for scale
    CALL METHOD BUNDLE_SCALE1_Y->IF_CUSTOMIZING~GET
                EXPORTING ATTR_ID =
                          CL_CU_SCALE=>CO_DISPLAY_CONTEXT
                IMPORTING VALUE = BUNDLE_DISPLAY
                          RETVAL = RETVAL.
    IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
      CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
    ENDIF.
    CALL METHOD BUNDLE_SCALE1_Y->IF_CUSTOMIZING~SET
                EXPORTING ATTR_ID =
                          CL_CU_SCALE=>CO_DISPLAY_CONTEXT
                          VALUE = BUNDLE_DISPLAY
                IMPORTING RETVAL = RETVAL.
    IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore

**** y-axis/scale 2
 CREATE OBJECT BUNDLE_SCALE2_Y EXPORTING INSTANCE_ID = 'GFW1T_Y2'.
    CALL METHOD BUNDLE_SCALE2_Y->IF_CUSTOMIZING~LOAD.
    CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
      EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART_Y_PRIM_AXIS
                          BUNDLE = BUNDLE_SCALE2_Y
                IMPORTING RETVAL = RETVAL.

*   **** prepare range context for axis
    CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~GET
                EXPORTING ATTR_ID =
                          CL_CU_AXIS=>CO_RANGE_CONTEXT
                IMPORTING VALUE = BUNDLE_DISPLAY
                          RETVAL = RETVAL.
    IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
      CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
    ENDIF.
    CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~SET
                EXPORTING ATTR_ID =
                          CL_CU_AXIS=>CO_RANGE_CONTEXT
                          VALUE = BUNDLE_DISPLAY
                IMPORTING RETVAL = RETVAL.
    IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore


**** grid of the y-axis
  CREATE OBJECT BUNDLE_GRID EXPORTING INSTANCE_ID = 'GFW1T_Y'.
  CALL METHOD BUNDLE_GRID->IF_CUSTOMIZING~LOAD.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
    EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART_Y_PRIM_AXIS
                        BUNDLE = BUNDLE_GRID
              IMPORTING RETVAL = RETVAL.
* **** prepare major line context for grid
  CALL METHOD BUNDLE_GRID->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_GRID=>CO_MAJOR_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_GRID->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_GRID=>CO_MAJOR_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
* **** prepare minor line context for grid
  CALL METHOD BUNDLE_GRID->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_GRID=>CO_MINOR_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_GRID->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_GRID=>CO_MINOR_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore

*  *** point 'Point1'
  CREATE OBJECT BUNDLE_POINT1 EXPORTING INSTANCE_ID = 'GFW1T_1'.
  CALL METHOD BUNDLE_POINT1->IF_CUSTOMIZING~LOAD.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
              EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART
                        KEY  = CO_GFW_PROG_POINT1
                        BUNDLE = BUNDLE_POINT1
              IMPORTING RETVAL = RETVAL.
*  show text from DC
  CALL METHOD BUNDLE_POINT1->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID = CL_CU_POINT=>CO_AUTO
                        VALUE = GFW_FALSE.
*  **** prepare display context for point
  CALL METHOD BUNDLE_POINT1->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_POINT=>CO_DISPLAY_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_POINT1->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_POINT=>CO_DISPLAY_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
*  **** prepare label context for point
  CALL METHOD BUNDLE_POINT1->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_POINT=>CO_LABEL_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_POINT1->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_POINT=>CO_LABEL_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore

**** point 'Point2'
  CREATE OBJECT BUNDLE_POINT2 EXPORTING INSTANCE_ID = 'GFW1T_2'.
  CALL METHOD BUNDLE_POINT2->IF_CUSTOMIZING~LOAD.
  CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
              EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART
                        KEY  = CO_GFW_PROG_POINT2
                        BUNDLE = BUNDLE_POINT2
              IMPORTING RETVAL = RETVAL.
* **** prepare display context for point
  CALL METHOD BUNDLE_POINT2->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_POINT=>CO_DISPLAY_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_POINT2->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_POINT=>CO_DISPLAY_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK. RETVAL = CL_GFW=>OK. ENDIF."//ignore
* **** prepare label context for point
  CALL METHOD BUNDLE_POINT2->IF_CUSTOMIZING~GET
              EXPORTING ATTR_ID =
                        CL_CU_POINT=>CO_LABEL_CONTEXT
              IMPORTING VALUE = BUNDLE_DISPLAY
                        RETVAL = RETVAL.
  IF RETVAL <CL_GFW>OK OR BUNDLE_DISPLAY IS INITIAL.
    CREATE OBJECT BUNDLE_DISPLAY EXPORTING INSTANCE_ID = 'dummy'.
  ENDIF.
  CALL METHOD BUNDLE_POINT2->IF_CUSTOMIZING~SET
              EXPORTING ATTR_ID =
                        CL_CU_POINT=>CO_LABEL_CONTEXT
                        VALUE = BUNDLE_DISPLAY
              IMPORTING RETVAL = RETVAL.
ENDFORM.                    " SET_CUSTOMIZING


****************************************************************
* This file was generated by Direct Download Enterprise. *
* Please do not change it manually. *
****************************************************************
%_DYNPRO
GFW_DEMO_PRES1
0100
620
40
%_HEADER
GFW_DEMO_PRES1 0100 0100 29 95192 35 0 0 29 96 0G E 20001113152508
%_DESCRIPTION
Main Screen
%_FIELDS
CONTAINER 94 00 30 00 30 00 1 2 0 0 0 28 U 1 1 102
CHAR 20 80 10 00 00 00 255 1 O 0 0 0 0 0 0 ____________________
%_FLOWLOGIC
PROCESS BEFORE OUTPUT.
MODULE PBO_0100.
*
PROCESS AFTER INPUT.
MODULE PAI_0100.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming -> Graphics All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.