_______________________________________________________________________________________________________________________

Home :: Sample Code :: Tutorials :: Interview FAQs :: Material :: SAP Books :: About :: Contact :: Links :: Disclaimer
_______________________________________________________________________________________________________________________

Sep 6, 2007

Program to Generate Graphs

*&---------------------------------------------------------------------*
*& Report ZKAR_GRAPHS
*&---------------------------------------------------------------------*
*& This program demonstrates how easy it is to generate 3D or 2D graphs,
*& simply by populating the statistical data into an internal table and
*& passing it to a Function Module.
*&
*& The Example has no imput parameters, but they can be added based on
*& the requirement
*&---------------------------------------------------------------------*
*& Written by: Karthik Potharaju
*& URL: http://allaboutsap.blogspot.com
*&---------------------------------------------------------------------*


REPORT ZKAR_GRAPHS.


*----------------------------------------------------------------------*

*INTERNAL TABLES AND STRUCTURES
*----------------------------------------------------------------------*
*** Internal table to hold Statistical data
DATA:
BEGIN OF IT_DATA OCCURS 0,
DATANAME(15),
QUANTITY1 TYPE I,
QUANTITY2 TYPE I,
QUANTITY3 TYPE I,
END OF IT_DATA.


*** Internal table to hold Options
DATA:
BEGIN OF IT_OPTIONS OCCURS 0,
OPTION(20),
END OF IT_OPTIONS.

*----------------------------------------------------------------------*
* Populating statistics data
IT_DATA-DATANAME = 'India'.
IT_DATA-QUANTITY1 = 55.
IT_DATA-QUANTITY2 = 62.
IT_DATA-QUANTITY3 = 59.
APPEND IT_DATA.


IT_DATA-DATANAME = 'UK'.
IT_DATA-QUANTITY1 = 35.
IT_DATA-QUANTITY2 = 80.
IT_DATA-QUANTITY3 = 44.
APPEND IT_DATA.

IT_DATA-DATANAME = 'USA'.
IT_DATA-QUANTITY1 = 18.
IT_DATA-QUANTITY2 = 80.
IT_DATA-QUANTITY3 = 19.
APPEND IT_DATA.


* Call FM to generate graph for the stats
CALL FUNCTION 'GRAPH_MATRIX_3D'
EXPORTING
COL1 = 'IT Professionals'
COL2 = 'Doctors'
COL3 = 'Engineers'
TITL = 'Professional Statistics'
TABLES
DATA = IT_DATA
OPTS = IT_OPTIONS
EXCEPTIONS
OTHERS = 1.

No comments:

Subscribe to posts via email

Enter your email address:

Delivered by FeedBurner

Blog Owner

Karthik P
Certified SAP Netweaver Consultant

View Karthik Potharaju's profile on LinkedIn