Warning: include_once(http://erpgenie.com/_borders/topabap.htm) [function.include-once]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/templates/rhuk_solarflare_ii/index.php on line 52

Warning: include_once() [function.include]: Failed opening 'http://erpgenie.com/_borders/topabap.htm' for inclusion (include_path='.:') in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/templates/rhuk_solarflare_ii/index.php on line 52

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Poll

What is your relationship with SAP?
 
Home
Inserting Charts PDF Print E-mail
User Rating: / 1
PoorBest 
Written by Dany Charbonneau   
Tuesday, 05 June 2007
It's a known fact that customers are very sensitive to the appeal of charts. Creating graphical charts (bar, pie char, lines graphs) in ABAP is simple. There are two main methods for creating charts in ABAP
  • Using the class CL_GFW
  • Using the function module GFW_PRES_SHOW
There are also other classes and function modules derived from these ones. Use transaction GRAL to explore all possibilities provided by this class and this FM.

The following are two short examples of the huge potential of function module GFW_PRES_SHOW :
Code:
* Contain the constants for the graph type
TYPE-POOLS: GFW.

DATA: VALUES TYPE TABLE OF GPRVAL WITH HEADER LINE,
COLUMN_TEXTS TYPE TABLE OF GPRTXT WITH HEADER LINE.


REFRESH VALUES.
REFRESH COLUMN_TEXTS.

VALUES-ROWTXT = 'Salary'.
VALUES-VAL1 = 50000.
VALUES-VAL2 = 51000.
APPEND VALUES.

VALUES-ROWTXT = 'Life cost'.
VALUES-VAL1 = 49000.
VALUES-VAL2 = 51200.
APPEND VALUES.

COLUMN_TEXTS-COLTXT = '2003'.
APPEND COLUMN_TEXTS.
COLUMN_TEXTS-COLTXT = '2004'.
APPEND COLUMN_TEXTS.

* Call a chart into a standard container, this function could be used for many
* different graphic types depending on the presentation_type field :
* gfw_prestype_lines
* gfw_prestype_area
* gfw_prestype_horizontal_bars
* gfw_prestype_pie_chart
* gfw_prestype_vertical_bars
* gfw_prestype_time_axis

CALL FUNCTION 'GFW_PRES_SHOW'
EXPORTING
CONTAINER = 'CONTAINER' "A screen with an empty container must be defined
PRESENTATION_TYPE = GFW_PRESTYPE_LINES
TABLES
VALUES = VALUES
COLUMN_TEXTS = COLUMN_TEXTS
EXCEPTIONS
ERROR_OCCURRED = 1
OTHERS = 2.
Resulting in this:



The following uses the EXACT same function with a different presentation type


Code:
    REFRESH VALUES.
REFRESH COLUMN_TEXTS.

VALUES-ROWTXT = ''.
VALUES-VAL1 = 10.
VALUES-VAL2 = 35.
VALUES-VAL3 = 45.
VALUES-VAL4 = 8.
VALUES-VAL5 = 2.
APPEND VALUES.

COLUMN_TEXTS-COLTXT = 'Fun'.
APPEND COLUMN_TEXTS.
COLUMN_TEXTS-COLTXT = 'Cars'.
APPEND COLUMN_TEXTS.
COLUMN_TEXTS-COLTXT = 'House'.
APPEND COLUMN_TEXTS.
COLUMN_TEXTS-COLTXT = 'Services'.
APPEND COLUMN_TEXTS.
COLUMN_TEXTS-COLTXT = 'Others'.
APPEND COLUMN_TEXTS.



CALL FUNCTION 'GFW_PRES_SHOW'
EXPORTING
CONTAINER = 'CONTAINER'
PRESENTATION_TYPE = GFW_PRESTYPE_PIE_CHART
X_AXIS_TITLE = 'Expenses'
Y_AXIS_TITLE = 'Expenses2'
TABLES
VALUES = VALUES
COLUMN_TEXTS = COLUMN_TEXTS
EXCEPTIONS
ERROR_OCCURRED = 1
OTHERS = 2

Related Items:

 
< Prev   Next >

Google Search

Statistics

Contribution Activity
Utilities: 38
Tips and Tricks: 333
Sample Code: 164
Total Contributions: 550

Member Activity
Members: 6244 since 2/1/2007!
New: 0 since yesterday!
Visitors: 1080610
We have 1 guest online

Newest Members

Welcome our newest members:

Google Ads


Warning: include(http://erpgenie.com/_borders/bottom.htm) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/includes/footer.php on line 22

Warning: include() [function.include]: Failed opening 'http://erpgenie.com/_borders/bottom.htm' for inclusion (include_path='.:') in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/includes/footer.php on line 22