Displaying Graphics using an ABAP Program

By Raghava Vakada, Mouri Tech Solutions

“I would like to explain about a simple report program to display graphics. The SAP Graphics can be used for various business purposes”.

In this article I am explaining about a simple Sales analysis on a yearly basis.

*&---------------------------------------------------------------------*
*& Report  ZGRAPH_TEST
*&
*&---------------------------------------------------------------------*
REPORT  ZGRAPH_TEST.
DATA: BEGIN OF TAB OCCURS 5,
      CLASS(5) TYPE C,
      VAL1(2) TYPE I,
      VAL2(2) TYPE I,
      VAL3(2) TYPE I,
      END OF TAB.
DATA: BEGIN OF OPTTAB OCCURS 1,
        C(20),
      END OF OPTTAB.
MOVE: 'fan' TO TAB-CLASS,
      12 TO TAB-VAL1, 8 TO TAB-VAL2, 15 TO TAB-VAL3.
APPEND TAB.
CLEAR TAB.
MOVE: 'cool' TO TAB-CLASS,
      15 TO TAB-VAL1, 10 TO TAB-VAL2, 18 TO TAB-VAL3.
APPEND TAB.
CLEAR TAB.
MOVE: 'DA' TO TAB-CLASS,
      17 TO TAB-VAL1, 11 TO TAB-VAL2, 20 TO TAB-VAL3.
APPEND TAB.
CLEAR TAB.
OPTTAB = 'FIFRST = 3D'.     APPEND OPTTAB.      "// Grafik-Typ
OPTTAB = 'P3TYPE = TO'.     APPEND OPTTAB.      "// Objektart
OPTTAB = 'P3CTYP = RO'.     APPEND OPTTAB.      "// Farben der Objekte
OPTTAB = 'TISIZE = 2'.      APPEND OPTTAB.      "// Haupttitelgröße
OPTTAB = 'CLBACK = X'.      APPEND OPTTAB.      "// Background Color
CALL FUNCTION 'GRAPH_MATRIX_3D'
     EXPORTING
          COL1        = '1997'
          COL2        = '1998'
          COL3        = '1999'
          DIM2        = 'Products'
          DIM1        = 'Years'
          TITL        = 'Sales In Rs. Crores'
     TABLES
          DATA        = TAB
          OPTS        = OPTTAB
     EXCEPTIONS
          OTHERS      = 1.
LEAVE PROGRAM. 

Results :

Execute the report program for an output shown below. 

 

Click on Overview for detailed view.

 

To display more detailed view.   

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image