Professional Documents
Culture Documents
Applies to:
SAP ERP
Summary
SAP Business Graphics is a graphics program for generating two- and three-dimensional graphs. SAP support for 2D and 3D reports are very nice, but they are hardly used by programmers. There are many standard functions for graphical display especially for making MIS reports more friendly. Here the function modules GRAPH_MATRIX_2D and GRAPH_MATRIX_2D are used to generate 2D and 3D reports. Sample code is also provided.
Author:
Author Bio
Abyson Joseph Chavara is working as an SAP ABAP consultant at Applexus Technologies (P) LTD. He has around 3 year experience in ABAP programming and mainly focuses on report generation.
Table of Contents
Introduction ......................................................................................................................................................... 3 Data input ........................................................................................................................................................ 3 Graphing Options ............................................................................................................................................ 3 The GRAPH_MATRIX_2D Function Module ...................................................................................................... 4 The GRAPH_MATRIX_2D Function Module sample program. .......................................................................... 5 The GRAPH_MATRIX_3D Function Module. ..................................................................................................... 6 The GRAPH_MATRIX_3D Function Module sample program........................................................................... 7 Switching Between Graphics Views. .................................................................................................................. 9 Selecting Parts of the Input Data for Display. ................................................................................................... 10 Formatting Graphs. ........................................................................................................................................... 11 Disclaimer and Liability Notice .......................................................................................................................... 12
Introduction
SAP Business Graphics is a graphics program for generating two- and three-dimensional graphs. The program offers you a variety of graphing options, data interfaces and various file manipulation commands. Data input You can input data to the program in either of the following ways: Data input by means of an ABAP program You create input data in an ABAP program. The input data must have a tabular format: o o o Simple list (for 2D graphs only) Table consisting of various rows and columns Various tables consisting of various rows and columns each
An ABAP function module calls up the SAP Business Graphics). The ABAP program sends the input data to the graphics program. Data input by means of an SAP screen capture You capture an SAP transaction window containing tabular data. Then you mark the data you want graphed. You can call up the SAP screen capture program from any SAP transaction window via menu (also from an R/2 transaction window of SAPs CUA Interface). The input data must have a tabular format: o o Simple list (for 2D graphs only) Table consisting of various rows and columns
You cannot capture input data contained in various SAP tables. Only an ABAP program can send such data to SAP Business Graphics. If the input data do not meet the format requirements, you can edit them on the captured screen. Graphing Options A number of display options are provided. You can: display two- or three-dimensional graphs display single graphs or group views choose graph types (bars, columns, etc.) set colors
I, I, I, I,
END OF ITAB_OPTIONS.
ITAB_MAIN-DATANAME = 'Country1'. ITAB_MAIN-QUANTITY1 = 52. ITAB_MAIN-QUANTITY2 = 66. ITAB_MAIN-QUANTITY3 = 0. ITAB_MAIN-QUANTITY4 = 93. APPEND ITAB_MAIN. ITAB_MAIN-DATANAME = 'Country2'. ITAB_MAIN-QUANTITY1 = 18. ITAB_MAIN-QUANTITY2 = 22. ITAB_MAIN-QUANTITY3 = 19. ITAB_MAIN-QUANTITY4 = 92. APPEND ITAB_MAIN. ITAB_MAIN-DATANAME = 'Contry3'. ITAB_MAIN-QUANTITY1 = 50. ITAB_MAIN-QUANTITY2 = 65. ITAB_MAIN-QUANTITY3 = 59. ITAB_MAIN-QUANTITY4 = 99. APPEND ITAB_MAIN.
CALL FUNCTION 'GRAPH_MATRIX_3D' EXPORTING COL1 = '2007' COL2 = '2008' COL3 = '2009' COL4 = '2010' TITL = 'Economic growth of south Asian countries' TABLES DATA = ITAB_MAIN
OPTS = ITAB_OPTIONS
EXCEPTIONS OTHERS = 1.
To switch from the Selection View to another view, (for example the 3D view), proceed as follows: Select 3D view by clicking on the pushbutton or choose Goto 3D view. 1. The Selection view goes away, and is replaced by the 3D view. This view contains a single 3D graph 2. Try the above steps to call up the 2D view and Groups view, to see what these views look like.
Formatting Graphs.
SAP Business Graphics provides you with four options menus for formatting the graphs. These four options menus are available through the Options main menu (in the menu bar) and they all work in the same way. As an example, follow the steps below to try out the 3D Options menu. To begin, return to the Selection view, if you are not already there. 1. Click on Options in the menu bar and further select 3D Options. 2. Re-position the Selection view and the menu (by clicking on each window's title bar and dragging) so you can see both at the same time. 3. In the 3D Options menu, the current graph type (the default) is Towers. Select the graph type Pyramids. (If there is no immediate change in the 3D graph, click on the Apply button below). The objects in the 3D graph change to pyramids, while the 2D graph remains the same. 4. Click on the various 3D Colors entries to observe how the coloring pattern changes in the 3D graph. Try out several combinations of options to observe the effects. Bear in mind that not all options can be used with all graph types. The section Formatting Graphs provides more details on individual options menus. Setting Options and Indicators To set a menu option, click on the option. If no change is visible in the relevant graph (the 2D or 3D graph to which the option applies), click on the Apply button as well. The results of your changes appear in the graph. Menu indicators work slightly differently. If they have up- and down-arrows attached, you can click on the arrows to add or subtract one to the indicator's value. You can also just type new values in. Click on the box where the indicator's current value is displayed, delete the value and type in a new one. If you type a value that is too large or too small, the indicator's maximum or minimum value is automatically used.