Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata
Error rendering macro 'code': Invalid value specified for parameter 'lang'
*Simple report to create graph in ABAP
*using GRAPH_MATRIX_3D function module
*The graph shows the performance of 3 companies for the Four
*quarters of a single year
*AUTHOR : Jijo.Jose.
REPORT Z_3DGRAPH.
*structure declaration for performance measurement
TYPES: BEGIN OF TY_PERFORMANCE,
COMPANY(15) TYPE C,
Q1 TYPE I,
Q2 TYPE I,
Q3 TYPE I,
Q4 TYPE I,
END OF TY_PERFORMANCE.
*structure declaration for options table
TYPES : BEGIN OF TY_OPTTABLE,
OPTIONS(30) TYPE C,
END OF TY_OPTTABLE.
*Internal table and work area declarations
DATA: IT_PERFORMANCE TYPE STANDARD TABLE OF TY_PERFORMANCE,
WA_PERFORMANCE TYPE TY_PERFORMANCE.
DATA : IT_OPTTABLE TYPE STANDARD TABLE OF TY_OPTTABLE,
WA_OPTTABLE TYPE TY_OPTTABLE.
*initialization event
INITIALIZATION.
*start of selection event
START-OF-SELECTION.
*clearing the work areas
  CLEAR WA_PERFORMANCE.
  CLEAR WA_OPTTABLE.
*appending values into the performance internal table
  WA_PERFORMANCE-COMPANY = 'Company A'.
  WA_PERFORMANCE-Q1 = 78.
  WA_PERFORMANCE-Q2 = 68.
  WA_PERFORMANCE-Q3 = 79.
  WA_PERFORMANCE-Q4 = 80.
  APPEND WA_PERFORMANCE TO IT_PERFORMANCE.
  WA_PERFORMANCE-COMPANY = 'Company B'.
  WA_PERFORMANCE-Q1 = 48.
  WA_PERFORMANCE-Q2 = 68.
  WA_PERFORMANCE-Q3 = 69.
  WA_PERFORMANCE-Q4 = 70.
  APPEND WA_PERFORMANCE TO IT_PERFORMANCE.
  WA_PERFORMANCE-COMPANY = 'Company C'.
  WA_PERFORMANCE-Q1 = 78.
  WA_PERFORMANCE-Q2 = 48.
  WA_PERFORMANCE-Q3 = 79.
  WA_PERFORMANCE-Q4 = 85.
  APPEND WA_PERFORMANCE TO IT_PERFORMANCE.
*appending values into the options internal table
  WA_OPTTABLE-OPTIONS = 'P3TYPE = TO'.
  APPEND WA_OPTTABLE TO IT_OPTTABLE.
  WA_OPTTABLE-OPTIONS = 'P2TYPE = VB'.
  APPEND WA_OPTTABLE TO IT_OPTTABLE.
  WA_OPTTABLE-OPTIONS = 'TISIZE = 1'.
  APPEND WA_OPTTABLE TO IT_OPTTABLE.
*calling the graph function module
  CALL FUNCTION 'GRAPH_MATRIX_3D'
    EXPORTING
      COL1      = 'Quarter 1'
      COL2      = 'Quarter 2'
      COL3      = 'Quarter 3'
      COL4      = 'Quarter 4'
      DIM1      = 'In Percentage%'
      SET_FOCUS = 'X'
      TITL      = 'Company Performances'
    TABLES
      DATA      = IT_PERFORMANCE
      OPTS      = IT_OPTTABLE
    EXCEPTIONS
      OTHERS    = 1.

2 Comments

  1. Guest

    what if i add onother record with same company as Company A ,will it add to existing record or will be repeated.

  2. Thanks Jijo Jose for sharing this (big grin)