Skip to Content
avatar image
Former Member

On implementing Graphs in Reports

Hello everyone,

I have a scenario where i have to display the few table values in graphical notations. For instance, if an employee is going on a business visit, then there are two things to be considered viz Budget Amount and Expenditure Amount. Now in my requirement i have to compare these two values and display them in Graphical notation.

Please help me out with code and step by step procedure.

Thanks & regards,

Abhishek.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 16, 2008 at 01:18 AM

    Hi,

    Following code will help you to create graphics.

    for 3d display:

    *&----


    *

    *& 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.

    For Pie-chart you have to use CALL FUNCTION 'GRAPH_2D'

    Thanks,

    Sree.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 11:31 AM

    Hi abhishek

    there is a lot of Demo programs for Graghix Reports

    check the programs

    BARCBO02

    BARCBO03

    BARCBO04

    for heirarchy display

    GFW_DEMO_HIER1

    GFW_DEMO_HIER2

    GFW_DEMO_HIER3

    Rewards if helpful

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 12:12 PM

    Hi abishek,

    Check the TCODE GRAL for getting demo programs on graphics.

    Regards

    Add comment
    10|10000 characters needed characters exceeded