Graphical representation of report

hi  ..
How do we  provide  graphical representation of  report  output.

Hi
1st example
report GRAPHICS_GUI_CE_DEMO.
global data
data: G_CE_CONTAINER type ref to CL_GUI_CUSTOM_CONTAINER.
data: G_CE_NEW_CONTAINER type ref to CL_GUI_CUSTOM_CONTAINER.
data: G_CE_VIEWER type ref to CL_GUI_CHART_ENGINE.
data: G_CE_VIEWER_NEW type ref to CL_GUI_CHART_ENGINE.
data: G_IXML type ref to IF_IXML.
data: G_IXML_SF type ref to IF_IXML_STREAM_FACTORY.
data: G_DESIGN_MODE type C.
data: G_VALUE_CHANGE type C.
data: G_SAVE_OKCODE like SY-UCOMM.
dynpro data
data: OKCODE like SY-UCOMM,
GT_SFLIGHT type table of SFLIGHT,
G_REPID like SY-REPID,
G_MAX type I value 100,
MYCONTAINER type SCRFNAME value 'NEW_CONTAINER',
reference to custom container: neccessary to bind ALV Control
CUSTOM_CONTAINER type ref to CL_GUI_CUSTOM_CONTAINER,
GRID1 type ref to CL_GUI_ALV_GRID.
'x_save' contains a flag to control which kind of a layout the user
can save (see below).
'gs_layout' identifies a layout. It must contain
at least the report-id.
§ 1.Declare a structure of type DISVARIANT to identify a layout
and a variable to define the saving options for users.
data: X_SAVE, "for Parameter I_SAVE
GS_LAYOUT type DISVARIANT. "for parameter IS_VARIANT
event handler
class LCL_CE_VIEWER_EH definition.
public section.
methods ON_CLICK for event CLICK of CL_GUI_CHART_ENGINE
importing
ELEMENT SERIES POINT.
methods ON_VALUE_CHANGE for event VALUE_CHANGE of
CL_GUI_CHART_ENGINE
importing
SERIES POINT VALUE.
methods ON_PROPERTY_CHANGE for event PROPERTY_CHANGE of
CL_GUI_CHART_ENGINE
importing
ELEMENT NAME VALUE.
endclass. "lcl_ce_viewer_eh DEFINITION
data: G_CE_VIEWER_EH type ref to LCL_CE_VIEWER_EH.
data: G_CE_VIEWER_EH_NEW type ref to LCL_CE_VIEWER_EH.
entry point
start-of-selection.
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
start-of-selection.
select * from SFLIGHT into table GT_SFLIGHT up to G_MAX rows.
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clear GS_LAYOUT.
create global objects
G_IXML = CL_IXML=>CREATE( ).
G_IXML_SF = G_IXML->CREATE_STREAM_FACTORY( ).
G_REPID = SY-REPID.
§ 2.At least field REPORT of this structure has to be filled!
GS_LAYOUT-REPORT = G_REPID.
X_SAVE = 'A'. "The user may save all types of a layout
call screen '100'.
ENDREPORT GRAPHICS_GUI_CE_DEMO.
*& Module STATUS_0100 OUTPUT
text
module STATUS_0100 output.
data: L_IXML_DATA_DOC type ref to IF_IXML_DOCUMENT,
L_IXML_CUSTOM_DOC type ref to IF_IXML_DOCUMENT,
L_OSTREAM type ref to IF_IXML_OSTREAM,
L_XSTR type XSTRING.
set pf-status '100'.
if G_CE_CONTAINER is initial.
create object G_CE_CONTAINER
exporting
CONTAINER_NAME = 'CONTAINER'.
create object G_CE_VIEWER
exporting
PARENT = G_CE_CONTAINER.
create object G_CE_VIEWER_EH.
set handler G_CE_VIEWER_EH->ON_CLICK for G_CE_VIEWER.
set handler G_CE_VIEWER_EH->ON_VALUE_CHANGE for G_CE_VIEWER.
set handler G_CE_VIEWER_EH->ON_PROPERTY_CHANGE for G_CE_VIEWER.
perform CREATE_DATA_DEMO using L_IXML_DATA_DOC.
L_OSTREAM = G_IXML_SF->CREATE_OSTREAM_XSTRING( L_XSTR ).
call method L_IXML_DATA_DOC->RENDER
exporting
OSTREAM = L_OSTREAM.
G_CE_VIEWER->SET_DATA( XDATA = L_XSTR ).
clear L_XSTR.
perform CREATE_CUSTOM_DEMO using L_IXML_CUSTOM_DOC.
L_OSTREAM = G_IXML_SF->CREATE_OSTREAM_XSTRING( L_XSTR ).
call method L_IXML_CUSTOM_DOC->RENDER
exporting
OSTREAM = L_OSTREAM.
G_CE_VIEWER->SET_CUSTOMIZING( XDATA = L_XSTR ).
endif.
call method G_CE_VIEWER->RENDER.
if CUSTOM_CONTAINER is initial.
create a custom container control for our ALV Control
create object CUSTOM_CONTAINER
exporting
CONTAINER_NAME = MYCONTAINER
exceptions
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
if SY-SUBRC ne 0.
add your handling, for example
call function 'POPUP_TO_INFORM'
exporting
TITEL = G_REPID
TXT2 = SY-SUBRC
TXT1 = 'The control could not be created'(510).
endif.
create object GRID1
exporting I_PARENT = CUSTOM_CONTAINER.
§ 4.Transfer your structure and your variable using parameters
IS_VARIANT and I_SAVE of method set_table_for_first_display.
call method GRID1->SET_TABLE_FOR_FIRST_DISPLAY
exporting
I_STRUCTURE_NAME = 'SFLIGHT'
IS_VARIANT = GS_LAYOUT "&see below
I_SAVE = X_SAVE "&see below
I_DEFAULT = 'X'
changing
IT_OUTTAB = GT_SFLIGHT.
& If you leave out the these parameters, the menu beneath
the layout icon disappears.
endif.
endmodule. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
module USER_COMMAND_0100 input.
G_SAVE_OKCODE = OKCODE.
clear OKCODE.
case G_SAVE_OKCODE.
when 'DESIGN'.
perform TOGGLE_DESIGN_MODE.
when 'VALUE'.
perform TOGGLE_VALUE_CHANGE.
when 'SAVE'.
perform SAVE_CUSTOMIZING.
when 'PRINT'.
perform PRINT.
when 'EXIT'.
leave program.
when 'BACK'.
leave program.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
*& IMPLEMENTATION
text
class CL_ABAP_CHAR_UTILITIES definition load.
*& Form create_data_demo
text
form CREATE_DATA_DEMO using P_IXML_DOC type ref to IF_IXML_DOCUMENT.
data: L_SIMPLECHARTDATA type ref to IF_IXML_ELEMENT,
L_CATEGORIES type ref to IF_IXML_ELEMENT,
L_SERIES type ref to IF_IXML_ELEMENT,
L_ELEMENT type ref to IF_IXML_ELEMENT,
L_ENCODING type ref to IF_IXML_ENCODING.
P_IXML_DOC = G_IXML->CREATE_DOCUMENT( ).
L_ENCODING = G_IXML->CREATE_ENCODING(
BYTE_ORDER = IF_IXML_ENCODING=>CO_LITTLE_ENDIAN
CHARACTER_SET = 'utf-8' ).
P_IXML_DOC->SET_ENCODING( L_ENCODING ).
L_SIMPLECHARTDATA = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'SimpleChartData' PARENT = P_IXML_DOC ).
L_CATEGORIES = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Categories' PARENT = L_SIMPLECHARTDATA ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'C' PARENT = L_CATEGORIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '1st quarter' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'C' PARENT = L_CATEGORIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '2nd quarter' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'C' PARENT = L_CATEGORIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '3rd quarter' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'C' PARENT = L_CATEGORIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '4th quarter' ).
L_SERIES = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Series' PARENT = L_SIMPLECHARTDATA ).
L_SERIES->SET_ATTRIBUTE( NAME = 'label' VALUE = 'Coffee' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'S' PARENT = L_SERIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '94' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'S' PARENT = L_SERIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '110' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'S' PARENT = L_SERIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '139' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'S' PARENT = L_SERIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '192' ).
L_SERIES = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Series' PARENT = L_SIMPLECHARTDATA ).
L_SERIES->SET_ATTRIBUTE( NAME = 'label' VALUE = 'Espresso' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'S' PARENT = L_SERIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '35' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'S' PARENT = L_SERIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '39' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'S' PARENT = L_SERIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '38' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'S' PARENT = L_SERIES ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '59' ).
endform. " create_data_demo
*& Form create_custom_demo
text
form CREATE_CUSTOM_DEMO using P_IXML_DOC type ref to IF_IXML_DOCUMENT.
data: L_ROOT type ref to IF_IXML_ELEMENT,
L_GLOBALSETTINGS type ref to IF_IXML_ELEMENT,
L_DEFAULT type ref to IF_IXML_ELEMENT,
L_ELEMENTS type ref to IF_IXML_ELEMENT,
L_CHARTELEMENTS type ref to IF_IXML_ELEMENT,
L_TITLE type ref to IF_IXML_ELEMENT,
L_ELEMENT type ref to IF_IXML_ELEMENT,
L_ENCODING type ref to IF_IXML_ENCODING.
P_IXML_DOC = G_IXML->CREATE_DOCUMENT( ).
L_ENCODING = G_IXML->CREATE_ENCODING(
BYTE_ORDER = IF_IXML_ENCODING=>CO_LITTLE_ENDIAN
CHARACTER_SET = 'utf-8' ).
P_IXML_DOC->SET_ENCODING( L_ENCODING ).
L_ROOT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'SAPChartCustomizing' PARENT = P_IXML_DOC ).
L_ROOT->SET_ATTRIBUTE( NAME = 'version' VALUE = '1.1' ).
L_GLOBALSETTINGS = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'GlobalSettings' PARENT = L_ROOT ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'FileType' PARENT = L_GLOBALSETTINGS ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( 'PNG' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Dimension' PARENT = L_GLOBALSETTINGS ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( 'PseudoThree' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Width' PARENT = L_GLOBALSETTINGS ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '640' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Height' PARENT = L_GLOBALSETTINGS ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( '360' ).
L_DEFAULT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Defaults' PARENT = L_GLOBALSETTINGS ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'FontFamily' PARENT = L_DEFAULT ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( 'Arial' ).
L_ELEMENTS = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Elements' PARENT = L_ROOT ).
L_CHARTELEMENTS = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'ChartElements' PARENT = L_ELEMENTS ).
L_TITLE = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Title' PARENT = L_CHARTELEMENTS ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Extension' PARENT = L_TITLE ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( 'href="sapevent:onclick?Title"' ).
L_ELEMENT = P_IXML_DOC->CREATE_SIMPLE_ELEMENT(
NAME = 'Caption' PARENT = L_TITLE ).
L_ELEMENT->IF_IXML_NODE~SET_VALUE( 'Caffeine Consumption' ).
endform. " create_custom_demo
*& Form toggle_design_mode
text
form TOGGLE_DESIGN_MODE .
data: L_WIN_CHART type ref to CL_GUI_CHART_ENGINE_WIN.
catch system-exceptions MOVE_CAST_ERROR = 1.
L_WIN_CHART ?= G_CE_VIEWER->GET_CONTROL( ).
endcatch.
if SY-SUBRC is initial.
if G_DESIGN_MODE is initial.
G_DESIGN_MODE = 'X'.
else.
G_DESIGN_MODE = ' '.
endif.
L_WIN_CHART->SET_DESIGN_MODE( FLAG = G_DESIGN_MODE EVENT = 'X' ).
L_WIN_CHART->RESTRICT_CHART_TYPES( CHARTTYPES = 'Columns|Lines' ).
L_WIN_CHART->RESTRICT_PROPERTY_EVENTS( EVENTS = 'ChartType' ).
endif.
endform. " toggle_design_mode
*& Form toggle_value_change
text
form TOGGLE_VALUE_CHANGE .
data: L_WIN_CHART type ref to CL_GUI_CHART_ENGINE_WIN.
catch system-exceptions MOVE_CAST_ERROR = 1.
L_WIN_CHART ?= G_CE_VIEWER->GET_CONTROL( ).
endcatch.
if SY-SUBRC is initial.
if G_VALUE_CHANGE is initial.
G_VALUE_CHANGE = 'X'.
L_WIN_CHART->ENABLE_VALUE_CHANGE( ).
else.
G_VALUE_CHANGE = ' '.
L_WIN_CHART->DISABLE_VALUE_CHANGE( ).
endif.
endif.
endform. " toggle_value_change
*& Form save_customizing
text
form SAVE_CUSTOMIZING .
data: L_XML_CUSTOMIZING type W3HTMLTABTYPE,
L_WIN_CHART type ref to CL_GUI_CHART_ENGINE_WIN,
L_FILENAME type STRING,
L_FILEPATH type STRING,
L_FILESIZE type I,
L_PATH type STRING.
catch system-exceptions MOVE_CAST_ERROR = 1.
L_WIN_CHART ?= G_CE_VIEWER->GET_CONTROL( ).
endcatch.
if SY-SUBRC is initial.
L_WIN_CHART->GET_CUSTOMIZING(
importing
DATA_TABLE = L_XML_CUSTOMIZING
describe table L_XML_CUSTOMIZING lines L_FILESIZE.
multiply L_FILESIZE by 255.
L_FILENAME = 'customizing.xml'.
call method CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
exporting
DEFAULT_FILE_NAME = L_FILENAME
changing
FILENAME = L_FILENAME
PATH = L_PATH
FULLPATH = L_FILEPATH.
if not L_FILEPATH is initial.
call method CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
exporting
FILETYPE = 'BIN'
FILENAME = L_FILEPATH
BIN_FILESIZE = L_FILESIZE
changing
DATA_TAB = L_XML_CUSTOMIZING
exceptions
FILE_WRITE_ERROR = 1
others = 22.
endif.
endif.
endform. " save_customizing
*& Form print
text
form PRINT .
data: L_WIN_CHART type ref to CL_GUI_CHART_ENGINE_WIN,
L_S_PRINT_PARAMETERS type PRI_PARAMS.
call function 'GET_PRINT_PARAMETERS'
exporting
DESTINATION = 'LOCL'
MODE = 'CURRENT'
NO_DIALOG = ''
importing
OUT_PARAMETERS = L_S_PRINT_PARAMETERS
VALID = L_VALID
exceptions
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
others = 4.
if SY-SUBRC <> 0.
BREAK USCGXS22.
endif.
catch system-exceptions MOVE_CAST_ERROR = 1.
L_WIN_CHART ?= G_CE_VIEWER->GET_CONTROL( ).
endcatch.
if SY-SUBRC is initial.
new-page print on parameters L_S_PRINT_PARAMETERS no dialog.
L_WIN_CHART->PRINT( ).
new-page print off.
endif.
endform. " print
*& Clas lcl_ce_viewer_eh
text
class LCL_CE_VIEWER_EH implementation.
method ON_CLICK.
data: L_MSG type STRING,
L_SERIES type STRING,
L_POINT type STRING.
L_SERIES = SERIES.
L_POINT = POINT.
concatenate 'Element clicked:'(M01) ELEMENT
'Series:'(T01) L_SERIES
'Point:'(T02) L_POINT
into L_MSG separated by SPACE.
message L_MSG type 'S'.
endmethod. "on_click
method ON_VALUE_CHANGE.
data: L_MSG type STRING,
L_SERIES type STRING,
L_POINT type STRING,
L_VALUE type STRING.
L_SERIES = SERIES.
L_POINT = POINT.
L_VALUE = VALUE.
concatenate 'Value changed:'(M02)
'Series:'(T01) L_SERIES
'Point:'(T02) L_POINT
'Value:'(T03) L_VALUE
into L_MSG separated by SPACE.
message L_MSG type 'S'.
endmethod. "on_value_change
method ON_PROPERTY_CHANGE.
data: L_MSG type STRING.
concatenate 'Property changed:'(M03)
'Element:'(T04) ELEMENT
'Name:'(T05) NAME
'Value:'(T03) VALUE
into L_MSG separated by SPACE.
message L_MSG type 'S'.
endmethod. "on_property_change
endclass. "lcl_ce_viewer_eh IMPLEMENTATION
2nd Example:
REPORT zmar_graphics .
This program illustrates a call to SAP Business Graphics. *
Each row in the DATA table contains one text label and a *
single numeric value. *
DATA: BEGIN OF data OCCURS 1,
text(25),
value TYPE p,
END OF data.
DATA: tcol1(5) VALUE '#1991'.
DATA: title(25) VALUE 'Sales'.
SET PF-STATUS 'GRAF'.
data-text = 'Product_1'.
data-value = 153470.
APPEND data.
data-text = 'Product_2'.
data-value = 253150.
APPEND data.
data-text = 'Product_3'.
data-value = 53470.
APPEND data.
data-text = 'Product_4'.
data-value = 182000.
APPEND data.
data-text = 'Product_5'.
data-value = 92410.
APPEND data.
WRITE: / 'Products',22 tcol1.
SKIP 2.
LOOP AT data.
  WRITE: / data-text, 12 data-value.
ENDLOOP.
PF11: Put out a 2D graphic *
AT PF11.
  CALL FUNCTION 'GRAPH_2D'
       EXPORTING
            titl = title
       TABLES
            data = data.
2nd Example:
REPORT zmar_graphics1.
Data for 2D-Modification
DATA: BEGIN OF data OCCURS 1,
text(25),
value TYPE p,
END OF data.
DATA: tcol1(5) VALUE '#1993'.
DATA: title(25) VALUE 'Merchandise 1993'.
DATA: tit2(10) VALUE 'Product'.
DATA: mod_row(5), mod_col(5), mod_val(20).
DATA: m_typ, b_typ, busg_stat.
FIELD-SYMBOLS: .
data-text = 'Refrigerators'.
data-value = 12345.
APPEND data.
data-text = 'Freezers'.
data-value = 22222.
APPEND data.
data-text = 'Ovens'.
data-value = 11111.
APPEND data.
data-text = 'Dishwashers'.
data-value = 54321.
APPEND data.
PERFORM output_2d.
AT PF08.
  busg_stat = space. "// start and wait
Event-Loop
  DO.
    CALL FUNCTION 'GRAPH_2D'
         EXPORTING
              stat       = busg_stat
              inform     = '7'  "// allow modify
              mail_allow = 'X'  "// allow mail
         IMPORTING
              m_typ      = m_typ
              b_typ      = b_typ
              mod_row    = mod_row
              mod_col    = mod_col
              mod_val    = mod_val
         TABLES
              data       = data.
    busg_stat = '4'. "// Just wait next time
    CASE m_typ.
      WHEN 'D'. "// Programm ended
        EXIT.
      WHEN 'I'. "// Valid message
        IF b_typ = 'M'. "// Modify-event
          READ TABLE data INDEX mod_row.
          ASSIGN COMPONENT mod_col OF STRUCTURE data TO  = mod_val.
          MODIFY data INDEX mod_row.
        ENDIF.
        IF b_typ = 'S'. "// Select-event (ignored)
        ENDIF. "// For element (MOD_ROW-MOD_COL)
    ENDCASE.
  ENDDO.
  PERFORM output_2d.
FORM OUTPUT_2D (Show the actual data)
FORM output_2d.
  WRITE: / 'Products',22 tcol1.
  SKIP 2.
  LOOP AT data.
    WRITE: / data-text, 22 data-value.
  ENDLOOP.
ENDFORM.
3rd Example:
REPORT zmar_graphics3.
DATA: BEGIN OF hpgl OCCURS 1,
entry(128),
END OF hpgl.
hpgl = 'SP6;PUPA0,0;'. APPEND hpgl.
hpgl = 'PDPA100,100,100,200,200,200,200,100,100,100;'. APPEND hpgl.
hpgl = 'SP1;PUPA100,150;'. APPEND hpgl.
hpgl = 'PDPA100,150,150,200,200,150,150,100,100,150;'. APPEND hpgl.
CALL FUNCTION 'GRAPH_HPGL'
     TABLES
          data = hpgl.
4th Example:
REPORT zmar_graphics4.
DATA: BEGIN OF objt OCCURS 1. "// Object Attributes
        INCLUDE STRUCTURE gpoobjt.
DATA: END OF objt.
DATA: BEGIN OF area_tab OCCURS 1. "// Areas (unused)
        INCLUDE STRUCTURE gpoarea.
DATA: END OF area_tab.
DATA: BEGIN OF col_text OCCURS 1, "// Value columns
c(40),
END OF col_text.
DATA: BEGIN OF values OCCURS 1, "// Object fields
p1 TYPE p,
p2 TYPE p,
p3 TYPE p,
p4 TYPE p,
p5 TYPE p,
p6 TYPE p,
p7 TYPE p,
p8 TYPE p,
p9 TYPE p,
END OF values.
DATA: BEGIN OF axis OCCURS 4.
        INCLUDE STRUCTURE gpoaxis.
DATA: END OF axis.
DATA save LIKE sy-tabix.
SET PF-STATUS 'GRAF'.
Constraints: Number of VALUES rows == Number of OBJT rows
: Num of VALUES columns == Number of COL_TEXT rows
Column title for $OBJD::VALTIT
col_text = '% Market share'. APPEND col_text.
col_text = '% Growth'. APPEND col_text.
col_text = 'Sales'. APPEND col_text.
col_text = 'Market share trend'. APPEND col_text.
col_text = 'Growth trend'. APPEND col_text.
col_text = 'Fixed costs'. APPEND col_text.
col_text = 'Overhead costs'. APPEND col_text.
col_text = 'Admin. costs'. APPEND col_text.
col_text = 'Estimated profits'. APPEND col_text.
Attributes for $AXIS
axis-pos = 'RIGHT'.
axis-backclr = 'DARKGRAY'.
axis-textclr = 'WHITE'.
axis-scalclr = 'WHITE'.
axis-shadow = 'N'.
axis-ticks = '50'.
axis-start = '0'.
axis-end = '100'.
APPEND axis.
axis-pos = 'TOP'.
axis-backclr = 'DARKGRAY'.
axis-textclr = 'WHITE'.
axis-scalclr = 'WHITE'.
axis-shadow = space.
axis-ticks = '50'.
axis-start = '0'.
axis-end = '100'.
APPEND axis.
axis-pos = 'LEFT'.
axis-backclr = 'DARKGRAY'.
axis-textclr = 'WHITE'.
axis-scalclr = 'WHITE'.
axis-shadow = 'N'.
axis-ticks = '10'.
axis-start = '0'.
axis-end = '100'.
APPEND axis.
axis-pos = 'BOTTOM'.
axis-backclr = 'DARKGRAY'.
axis-textclr = 'WHITE'.
axis-scalclr = 'WHITE'.
axis-shadow = 'N'.
axis-ticks = '50'.
axis-start = '0'.
axis-end = '100'.
APPEND axis.
Objects
*BJT-LINECLR = 'WHITE'.
1. Trend line
objt-form = 'RECTANGLE'.
objt-fillclr = 'YELLOW'.
objt-textclr = 'BLUE'.
objt-title = 'Clarion 1990'.
objt-info = 'Sales in 1990'.
values-p1 = 10.
values-p2 = 20.
values-p3 = 10000.
values-p4 = 22.
values-p5 = 22.
values-p6 = 400.
values-p7 = 300.
values-p8 = 200.
values-p9 = 100.
APPEND objt.
APPEND values.
objt-form = 'RECTANGLE'.
objt-fillclr = 'YELLOW'.
objt-textclr = 'BLUE'.
objt-title = 'Clarion 1991'.
objt-info = 'Sales in 1991'.
values-p1 = 22.
values-p2 = 22.
values-p3 = 15000.
values-p4 = 45.
values-p5 = 35.
values-p6 = 100.
values-p7 = 200.
values-p8 = 300.
values-p9 = 400.
APPEND objt.
APPEND values.
objt-form = 'RECTANGLE'.
objt-fillclr = 'YELLOW'.
objt-textclr = 'BLUE'.
objt-title = 'Clarion 1992'.
objt-info = 'Sales in 1992'.
values-p1 = 45.
values-p2 = 35.
values-p3 = 22000.
values-p4 = 62.
values-p5 = 33.
values-p6 = 20.
values-p7 = 40.
values-p8 = 80.
values-p9 = 160.
APPEND objt.
APPEND values.
objt-form = 'RECTANGLE'.
objt-fillclr = 'YELLOW'.
objt-textclr = 'BLUE'.
objt-title = 'Clarion 1993'.
objt-info = 'Sales in 1993'.
values-p1 = 62.
values-p2 = 33.
values-p3 = 12000.
values-p4 = 62.
values-p5 = 33.
values-p6 = 600.
values-p7 = 700.
values-p8 = 600.
values-p9 = 700.
APPEND objt.
APPEND values.
2. Trend line
objt-form = 'CIRCLE'.
objt-fillclr = 'GREEN'.
objt-textclr = 'BLUE'.
objt-title = 'Sony 1988'.
objt-info = 'Sony UX400/CD, Sales in 1988'.
values-p1 = 2.
values-p2 = 50.
values-p3 = 2500.
values-p4 = 26.
values-p5 = 57.
values-p6 = 100.
values-p7 = 700.
values-p8 = 20.
values-p9 = 50.
APPEND objt.
APPEND values.
objt-form = 'CIRCLE'.
objt-fillclr = 'GREEN'.
objt-textclr = 'BLUE'.
objt-title = 'Sony 1989'.
objt-info = 'Sony UX400/CD, Sales in 1989'.
values-p1 = 26.
values-p2 = 57.
values-p3 = 3500.
values-p4 = 58.
values-p5 = 70.
values-p6 = 100.
values-p7 = 600.
values-p8 = 20.
values-p9 = 70.
APPEND objt.
APPEND values.
objt-form = 'CIRCLE'.
objt-fillclr = 'GREEN'.
objt-textclr = 'BLUE'.
objt-title = 'Sony 1990'.
objt-info = 'Sony UX400/CD, Sales in 1990'.
values-p1 = 58.
values-p2 = 70.
values-p3 = 11000.
values-p4 = 79.
values-p5 = 68.
values-p6 = 100.
values-p7 = 500.
values-p8 = 25.
values-p9 = 90.
APPEND objt.
APPEND values.
objt-form = 'CIRCLE'.
objt-fillclr = 'GREEN'.
objt-textclr = 'BLUE'.
objt-title = 'Sony 1991'.
objt-info = 'Sony UX400/CD, Sales 1991'.
values-p1 = 79.
values-p2 = 68.
values-p3 = 13000.
values-p4 = 87.
values-p5 = 54.
values-p6 = 100.
values-p7 = 430.
values-p8 = 45.
values-p9 = 120.
APPEND objt.
APPEND values.
objt-form = 'CIRCLE'.
objt-fillclr = 'GREEN'.
objt-textclr = 'BLUE'.
objt-title = 'Sony 1992'.
objt-info = 'Sony UX400/CD, Sales in 1992'.
values-p1 = 87.
values-p2 = 54.
values-p3 = 13500.
values-p4 = 80.
values-p5 = 34.
values-p6 = 90.
values-p7 = 390.
values-p8 = 44.
values-p9 = 150.
APPEND objt.
APPEND values.
objt-form = 'CIRCLE'.
objt-fillclr = 'GREEN'.
objt-textclr = 'BLUE'.
objt-title = 'Sony 1993'.
objt-info = 'Sony UX400/CD, Sales in 1993'.
values-p1 = 80.
values-p2 = 34.
values-p3 = 23000.
values-p4 = 80. "// Line to itself
values-p5 = 34.
values-p6 = 90.
values-p7 = 370.
values-p8 = 47.
values-p9 = 165.
APPEND objt.
APPEND values.
area_tab-form = 'RECTANGLE'.
area_tab-fillclr = 'RED'.
area_tab-xfrom = '10'.
area_tab-yfrom = '70'.
area_tab-xto = '40'.
area_tab-yto = '90'.
area_tab-title = 'Winner takes all'.
APPEND area_tab.
LOOP AT objt.
  WRITE: / objt-title(20).
  save = sy-tabix.
  READ TABLE values INDEX save.
  WRITE 25 values-p3.
ENDLOOP.
AT PF11.
  CALL FUNCTION 'GRAPH_PORT'
       EXPORTING
            title_title   = 'Trend-Portfolio for Sony and Clarion Radio'
            title_info    = 'The two objects over several years'
            title_textclr = 'YELLOW'
            title_backclr = 'DARKGRAY'
            title_size    = '2'
            frm_backclr   = 'GRAY'
            frm_cordclr   = 'WHITE'
            frm_scalclr   = 'WHITE'
            frm_scalmod   = 'LONGDASH'
            frm_gridx     = '10'
            frm_gridy     = '10'
            frm_shadow    = 'X'
            obj_xval      = '0'
            obj_yval      = '1'
            obj_sval      = '2'
            obj_xarr      = '3'
            obj_yarr      = '4'
       TABLES
            axis          = axis
            col_text      = col_text
            objt          = objt
            values        = values
            area_tab      = area_tab.[/code]
Reward if usefull

Similar Messages

  • Graphical representation of standard SAP reports

    Hi,
    Can we get graphical representation of Standard SAP CO Reports? Is there any setting that has to be activated to get these? We are using FI, CO & MM.
    Regards,
    Sangeeta

    Dear Sangeeta,
    This refered report is prepared through report painter. Transaction code GRR1-2-3. Graphical representation facility is available only in drilldown reporting which was used in FI module but not in CO.e.g. to see & modify  GL related  repots transaction code is FSI2.Where in you can go to output type tab & you will find the option.
    As your query is relating to CO you can try transaction code GR11where you design the layout for report painter reports.This might help you.
    Else if your requirement is such that you want each details through graphycal representation you can use report interface which will direct to graphycaly represented report.
    Regards,
    Abhijit

  • List of Standard QM reports with Graphical Representation

    Dear Users
    Does any one have the list of Standard Quality Module Reports which have Graphical Representations also.
    Regards
    SAM

    Use T.codes QM10 To QM15 transaction codes.
    If you want to know more about QM reports
    Goto SAP easy access-->Information Systems -->Logistics -->Quality management
    here you will get list of standard reports
    Edited by: Sridhar Jayavarapu on Apr 2, 2009 8:42 AM

  • Graphical representation of Cisco Agent Desktop info

    I have a weird request of me. Someone want to have a more graphical representation of the real-time data on their Cisco Agent Desktop. I don;t know where to begin to be honest.
    Does anyone know of third party plug-in or something that I can be pointed to?
    Thanks!

    Assuming this is UCCX, with version 10 you will get CUIC real time reporting, which might solve the problem.
    Chris

  • Sales Representative Commission Report

    Hi,
    Is there any standard report for Sales Representative Commission Report for Professional services.
    regards
    ravi

    to my knowledge there is no standard report as such....u need to gather the requirements and develop a new report in SE38.

  • How can I run graphic object on report. ( I got REP-1246 Chart not found)

    Hi All,
    I made a report that consists a chart object. When I run it on report builder, it works well. But When I call the report from client side, I got "Rep-1246 Char Document not found" . I tried to solve it , I couldn't solve the problem . If I delete chart object from report , then report works well on client side. I didn't use graphics builder to create graphs I used only report builder to do it. I read the threads about it , but I couldn't find the solution. All solutions are about path of graphic file. I don't understand it. Because I only have *.rdf *.rep file. There is no any graph file in my system. I can create it in graphic builder but I don't know how can I deploy the graph object into report layout and run ?
    I need urgent help ..
    Thanks in advice
    Suleyman

    Hi again , I used developer 2000. In order to show graphic object on report firstly
    I created my graphic object on oracle graph builder.After that I save it like mygraph.OGD . Then I added graphic object on report builder by using graphic object on report builder. When you click the graphic object you will see CHART FILENAME part in part of CHART. In this field , you should add graphic file path that you created on graphic builder. I added mygraph.OGD into this filename part. I worked well.
    Good LUck !

  • Graphical Representation in Abap

    Hi Abappers,
                      How to show Graphical Representation in Abap.If is possible plz send by showing examples.
    Regards,
    vani.

    Hi,
    The following FM's are  used to create graphs in SAP...
    You can execute them and check the paramters to be passed
    BUSG                           SAP Business Graphics
    GRAPH_2D                       Calling up the 2D business graphics
    GRAPH_2D_MENUE                 DO NOT USE (use 'GRAPH_2D' and 'GRAPH_BUSG_MENU_SET')
    GRAPH_3D                       Calling up the 3D presentation graphics
    GRAPH_BUSG_COLOR_SET           Definition of color pallets for business graphics
    GRAPH_BUSG_MENU_SET            Pushbutton menu (tool bar) for all BUSG modules
    GRAPH_MATRIX                   Calling up SAP Business Graphics (2D, 3D and 4D)
    GRAPH_MATRIX_2D                Calling up the 2D graphics (user-friendly version)
    GRAPH_MATRIX_3D                Structure of 3D graphics (user-friendly version)
    GRAPH_MATRIX_4D                Calling up a 3D graphic (4th dimension stacked representation)
    Regards
    Sk

  • Graphical representation for ME1P

    Hi
    I need to create a line graph between date and price of a material using transaction ME1P.
    For this i need to add a button on the application toolbar (PF Status) for choosing graphical representation and then display the result as a graph.
    Are their any screen exits or enhancement points for this?

    hi
    I am using transaction ME1P. MY requirement is that on executing this transaction, the data i get as output i need to download that into an excel file on the applicatin server. When I open the excel file, I should automatically get a graph between date and price.
    Downloading the data is possible through GUI_DOWNLOAD FM.
    How can i make the excel automatically show the data in graphical form?

  • Org Management graphical representation

    Hi
    I am trying to create org structure using expert mode method. created the realtionship to department wise position wise. But i am not able to view the graphical structure of the org chart.
    I have checked with my seniors as well. They are also unable to resolve the issue. I am not getting any error message but when i click on graphical view method. it automatically logsoff from the SAP.

    Hi Rashee,
    Use transction code PPOS _old _display then select the infotype you want to see graphically and click on graph (which is on top of your screen in Tool bar). You will get the graphical representation.

  • Graphical Representation

    Hi Experts,
    I have a discrete manufacturing scenario. What are the transactions in which I will be able to see the graphical representations of the production orders? Also, is the MF50 transaction limited only to the repetitive manufacturing scenario?
    Regards,
    Sachin

    Hi,
    Not sure if my interpretation of your query is correct, but if you want to do capacity leveling, then
    Work Center View
    CM21 (planning table - graphical)
    CM22 (planning table - tabular)
    Individual Capacity View
    CM27 (planning table - graphical)
    CM28 (planning table - tabular)
    Order View
    CM31 (planning table - graphical)
    CM23 (planning table - tabular)
    Also you may use CM25 - online & CM40 for background.
    Check if the above meets your need.
    Regards,
    Vivek

  • Print Graphical Representation of Binary Search Tree

    I need to print out a graphical representation of a binary search tree. Here is the source code I'm working with but it doesn't display the children correctly sometimes, especially with large trees.
    Stack globalStack = new Stack();
    globalStack.push(root);
    int nBlanks = 32;
    boolean isRowEmpty = false;
    System.out.println("************************************************");
    while (isRowEmpty == false) {
    Stack localStack = new Stack();
    isRowEmpty =true;
    for (int i=0; i < nBlanks; i ++);
    System.out.print(' ');
    while (globalStack.isEmpty()==false) {
    Node temp = (Node)globalStack.pop();
    if (temp != null) {
    System.out.print(temp.data);
    localStack.push(temp.leftChild);
    localStack.push(temp.rightChild);
    if (temp.leftChild != null || temp.rightChild != null)
    isRowEmpty = false;
    } else {
    System.out.print(" -- ");
    localStack.push(null);
    localStack.push(null);
    for (int i = 0 ; i < nBlanks*2-2; i++)
    System.out.print(' ');
    } //end while loop isEmpty is false
    System.out.println();
    nBlanks /= 2;
    while (localStack.isEmpty()==false)
    globalStack.push (localStack.pop());
    }//end while loop isRowEmpty is false
    System.out.println("************************************************");
    Here is an example (here the bottom children aren't aligned correctly)
                                    4
                    3                              20
             --                --               11              23
         --        --        --        --        --       15       --        --

    Well, using System.out is not really the best way for a Graphical representation...
    May be java.awt.Graphics would be far better, both for the programmer and the user of your application. And please use  tags when you post code, - makes it readable.

  • Graphical representation order progress

    Hi
    where i can get graphical representation of prodcution order progress........

    Hi,
    After Executing in MD4C go to Menu -
    > LIst -
    > Graphic.
    So you will be able to have graphical view of the same.
    Hope this helps.
    Regards,
    Tejas

  • Scale of the graphic in interactive report doesn't work in french

    Dear all,
    I created a calculation column in an interactive report an put the format 9999999D99. When I displayed the information everything is ok.
    After that I tried to create a graphic with this column.
    The graphic is the type line
    The value is this new column
    The function is SUM
    order by label ascending
    The graphic show the good information, when I click on the dot the right number is displayed (19459,10). But if I look on the scale on the left the numbers are not good, we see 25,00000 instead of 25000,00.
    The application use the navigator information the first language use is french. If I use english the numbers are ok.
    What I need to do to use french and have the right decimal ?
    Thanks for your help
    Eric

    Hi Pranay and Mohd,
    here is the screenshot:
    If I logon as Admin user (or I grant user Admin rights), it looks like this:
    So the prompt is visible but is empty. I changed privileges in CMC / Applications / Web Intelligence, so normal user has same right as Admin, but it still doesn't work. I also tried change user security in Connections and Universes, but none of them work.
    Please, do you have any idea what i miss?
    Thank you

  • Graphics Display in Report

    Hi,
    I put a graphics display in a report. I always got 'Floating exception r25desm (core dumped)'. I am using Reports 2.5 and Graphics 2.5 on Unix. What is the problem?
    Lu

    What error did you get? Please give the original error code and message to help us diagnose the problem.
    In order to run OGD, you definitely need Oracle Graphics installed on the same oracle home as reports.
    Thanks,
    -Shaun

  • Represent hierarchical structure in graphical structure (by reports?)

    Hi
    I have a parent child relationship where I am using sys conect by path to represent the relationship. Can I display this relationship in graphical structure in Orace Reports?

    Why does Java follow the hierarchical structure i.e
    Object class is the root class which is extended by
    all classes by default..
    Can anybody tell the reason for this.It's for technical reasons. In this way any class and class hierarchy always have a known super-superclass namely Object. This means that API's can be written assuming this class only and they will then work with objects of any class. Examples of this are the Collections and Swing.

Maybe you are looking for

  • Code page to language assignment

    Hello everyone I have the following problem: I generate email attachement in pdf format converting the smartform. As input parameters for smartform FM I pass language. smartform engine choose specific code page depending on language I passed? The pro

  • Use of Java packages in Java stored procedures? (Oracle 10.2)

    Hi all- Does Oracle's Java stored procedures support Java packages? In all the examples I've seen, packages are never used, and when I added one to a test file, it compiled it just fine, but referencing the class from the package itself resulted in a

  • Collect Merge Patten using BPM in XI

    Hi I want 3 files to be sending data and only one file receiver. How is it possible using BPM in XI? Can anybody provide pdf on end to end Scenario of this type. Points will be given?

  • Java Project migration from Eclipse (3.2+) to JDeveloper (11.x)

    I want to import/modify an Eclipse's java project into JDeveloper and use it. I see that there are some fundamental differences between the Eclipse and JDeveloper projects. Some of the differences like plugin.xml vs extension.xml, non-existance of .c

  • Need to create a button through personalization

    Hi I have an oracle seeded page where in one region i need to add a button thru personalization.I followed this steps: 1. I went that region and personalized that region. 2. Clicked on the Crete Item and selected item type as button. 3. Here what all