turning a 3d drawing in to a 2d

Many times a graphical nautical chart output is required by the clients since a graph is much more appealing to the user and enables a amend assay of data. Some accomplish this by exporting it to Excel and using the graph characteristic of Microsoft Excel. It is however quite simple to provide the functionality for building graphical charts in your ABAP report itself.

Including this feature in your ABAP study is an absolutely productive task since it could accept your program to a much more professional level with relatively very little effort required from your side.

At that place are mainly two function modules that are being used to achieve this.

  • Ø GFW_PRES_SHOW
  • Ø GRAPH_MATRIX_3D

There is too a class called CL_GFW whose methods are dedicated to drawing graphs. However, most of the basic graph requirements can be achieved using the above office modules.

GFW_PRES_SHOW

Suppose you lot desire to draw a line chart showing the revenue from a section over a few years.

These are the values for drawing the chart.

Year

Acquirement

2009

5000

2010

8000

2011

3000

2012

10000

The output that yous require would be :

To achieve this in ABAP

Pre-requisite : Create a custom screen say 100 and insert a custom control in it. Requite it the proper noun say 'CONTAINER'

The graph can be hands fatigued using the part GFW_PRES_SHOW.

Phone call Part 'GFW_PRES_SHOW'
EXPORTING
*                     CONTAINER               =
*                     Height                     =
*                     LEFT                    =
*                     HEIGHT                  =
*                     WIDTH                   =
PRESENTATION_TYPE       =
*                     HEADER                  =
*                     ORIENTATION             = ane
*                     PARENT                  =
*                     X_AXIS_TITLE            =
*                     Y_AXIS_TITLE            =
*                     FORMAT                  =
*                   IMPORTING
*                     RETVAL                  =
*                     CONTENT_TYPE            =
*                     CONTENT_LENGTH          =
TABLES
VALUES                  =
COLUMN_TEXTS            =
*                     ROW_LABELS              =
*                     COLUMN_LABELS           =
*                     CONTENT                 =
*                  EXCEPTIONS
*                     ERROR_OCCURRED          = one
*                     OTHERS                  = 2
.

The parameter presentation type determines the type of graph that needs to be drawn using the tabular array. Given below are the values of the parameter presentation type corresponding to the different kinds of graphs.

  1. Line charts  – gfw_prestype_lines
  2. Area Nautical chart – gfw_prestype_area
  3. Horizontal bar chart – gfw_prestype_horizontal_bars
  4. Vertical bar nautical chart  – gfw_prestype_vertical_bars
  5. Pie chart  – gfw_prestype_pie_chart
  6. Time axis nautical chart. – gfw_prestype_time_axis

The important concept that needs to be understood while using this function module is the logic backside populating the input tables of the function module. In one case yous understand that, you can easily depict any kind of chart co-ordinate to the requirement.

The 2 tables parameters values and column_texts are our messengers here.

If we consider the in a higher place case, column_texts contains the points along the x-axis. That is 2009, 2010, 2011.

The structure of the table column_texts is GPRTXT whichcontains but a single field COLTXT.

Append all the x-axis points into this table.

DATA :  X_TEXTS TYPE TABLE OF GPRTXT WITH HEADER LINE .

X_TEXTS-COLTXT = '2009' .
APPEND X_TEXTS.
X_TEXTS-COLTXT =
'2010' .
Append X_TEXTS.
X_TEXTS-COLTXT =
'2011' .
Suspend X_TEXTS.
X_TEXTS-COLTXT =
'2012' .
Append X_TEXTS.

The y-axis values corresponding to all x-axis co-ordinates is appended together equally a single row in the table VALUES.

Values is a table of structure GPRVAL, which contains the field name for that graph and the values respective to the different x-co-ordinates.

ROWTXT        GFWXVAL     CHAR 40        0          GFW: First dimension (X value)

VAL1  GFWYVAL     FLTP   16        16        GFW: 2nd dimension (Y value)

VAL2  GFWYVAL     FLTP   xvi        16        GFW: Second dimension (Y value)

VAL3  GFWYVAL     FLTP   16        xvi        GFW: 2d dimension (Y value)

VAL4  GFWYVAL     FLTP   sixteen        sixteen        GFW: Second dimension (Y value)

VAL5  GFWYVAL     FLTP   16        16        GFW: Second dimension (Y value)

Yous tin enter up to 32 values, ie, upto 32 points on the x co-ordinate is allowed in the Texts table , the y value for each beingness provided in the Values table.

Report   ZGRAPHICS.

Type -POOLS: GFW.

Information : Y_VALUES TYPE TABLE OF GPRVAL WITH HEADER LINE ,
X_TEXTS
Blazon TABLE OF GPRTXT WITH HEADER LINE .
data Ok_code similar sy-ucomm.

REFRESH Y_VALUES.
REFRESH X_TEXTS.

Y_VALUES-ROWTXT = 'Sales' .
Y_VALUES-VAL1 =
5000 .
Y_VALUES-VAL2 =
8000 .
Y_VALUES-VAL3 =
3000 .
Y_VALUES-VAL4 =
10000 .
Append Y_VALUES.

X_TEXTS-COLTXT = '2009' .
APPEND X_TEXTS.
X_TEXTS-COLTXT =
'2010' .
APPEND X_TEXTS.
X_TEXTS-COLTXT =
'2011' .
APPEND X_TEXTS.
X_TEXTS-COLTXT =
'2012' .
APPEND X_TEXTS.

telephone call screen 100 .
*&———————————————————————*
*&      Module  STATUS_0100  OUTPUT
*&———————————————————————
MODULE STATUS_0100 OUTPUT .
Set up PF-Condition 'PF_100' .
SET TITLEBAR 'GRAPHICS' .
*
Call FUNCTION 'GFW_PRES_SHOW'
EXPORTING
CONTAINER         =
'CONTAINER' "A screen with an empty container must be defined
PRESENTATION_TYPE = GFW_PRESTYPE_LINES
*        PRESENTATION_TYPE =  gfw_prestype_time_axis
*        PRESENTATION_TYPE = gfw_prestype_area
*        PRESENTATION_TYPE = gfw_prestype_horizontal_bars
TABLES
VALUES            = Y_VALUES
COLUMN_TEXTS      = X_TEXTS
EXCEPTIONS
ERROR_OCCURRED    =
1
OTHERS             = 2 .

ENDMODULE . " STATUS_0100  OUTPUT
*&———————————————————————*
*&      Module  USER_COMMAND_0100  INPUT
*&———————————————————————
MODULE USER_COMMAND_0100 INPUT .
example ok_code.
when 'Back' .
leave Programme .

endcase .

ENDMODULE

The output is the graph above.

Multiple Line Charts

Now suppose  you lot want to compare the revenues of two different departments. You need a line chart, i for each department. To achieve this simply insert ane more row to the y values tables.

DATA : Y_VALUES TYPE TABLE OF GPRVAL WITH HEADER LINE ,
X_TEXTS
TYPE TABLE OF GPRTXT WITH HEADER LINE .
data Ok_code like sy-ucomm.

REFRESH Y_VALUES.
REFRESH X_TEXTS.

Y_VALUES-ROWTXT = 'Acquirement – Dept1' .
Y_VALUES-VAL1 =
5000 .
Y_VALUES-VAL2 =
8000 .
Y_VALUES-VAL3 =
3000 .
Y_VALUES-VAL4 =
10000 .
APPEND Y_VALUES.

Y_VALUES-ROWTXT = 'Revenue – Dept2' .
Y_VALUES-VAL1 =
6000 .
Y_VALUES-VAL2 =
7000 .
Y_VALUES-VAL3 =
6000 .
Y_VALUES-VAL4 =
5000 .
APPEND Y_VALUES.

X_TEXTS-COLTXT = '2009' .
APPEND X_TEXTS.
X_TEXTS-COLTXT =
'2010' .
APPEND X_TEXTS.
X_TEXTS-COLTXT =
'2011' .
Suspend X_TEXTS.
X_TEXTS-COLTXT =
'2012' .
APPEND X_TEXTS.

Horizontal bar chart.

To view the same comparison in bar charts, just change the parameter passed to the presentation type parameter of the function module.

Phone call FUNCTION 'GFW_PRES_SHOW'
EXPORTING
CONTAINER         =
'CONTAINER'

PRESENTATION_TYPE = gfw_prestype_horizontal_bars
TABLES
VALUES            = Y_VALUES
COLUMN_TEXTS      = X_TEXTS
EXCEPTIONS
ERROR_OCCURRED    =
ane
OTHERS             = ii .

\Vertical Bar Nautical chart

CALL FUNCTION 'GFW_PRES_SHOW'
EXPORTING
CONTAINER         =
'CONTAINER'

         PRESENTATION_TYPE = gfw_prestype_vertical_bars
TABLES
VALUES            = Y_VALUES
COLUMN_TEXTS      = X_TEXTS
EXCEPTIONS
ERROR_OCCURRED    =
1
OTHERS             = 2 .

Pie Charts.

In that location is slight variation in the input table contents of pie charts for the very reason that the purpose of pie chart is different.

Suppose your requirement is to know the contribution of each section to the full revenue, the reply is a pie chart.

To draw pie chart, the different departments are added to the text table X_TEXTS (which will be the input to parameter column_texts of the part module ) and the values, that is acquirement, contributed past each department goes to the values table Y_VALUES (input table to parameter values of the tabular array. There can be simply 1 row for the Y_VALUES tabular array for the pie chart.

Information : Y_VALUES TYPE TABLE OF GPRVAL WITH HEADER LINE ,
X_TEXTS
Blazon TABLE OF GPRTXT WITH HEADER LINE .
data Ok_code like sy-ucomm.

REFRESH Y_VALUES.
REFRESH X_TEXTS.

X_TEXTS-COLTXT = 'Dept A' .
APPEND X_TEXTS.
X_TEXTS-COLTXT =
'Dept B' .
Append X_TEXTS.
X_TEXTS-COLTXT =
'Dept C' .
APPEND X_TEXTS.
X_TEXTS-COLTXT =
'Dept Due east' .
Suspend X_TEXTS.
X_TEXTS-COLTXT =
'Dept F' .
APPEND X_TEXTS.
X_TEXTS-COLTXT =
'Dept G' .
Append X_TEXTS.

Y_VALUES-VAL1 = 5000 .
Y_VALUES-VAL2 =
5500 .
Y_VALUES-VAL3 =
3000 .
Y_VALUES-VAL4 =
4000 .
Y_VALUES-VAL5 =
5000 .
Y_VALUES-VAL6 =
6000 .
Y_VALUES-VAL7 =
7000 .
Suspend Y_VALUES.

Call FUNCTION 'GFW_PRES_SHOW'
EXPORTING
CONTAINER         =
'CONTAINER'

          PRESENTATION_TYPE =  gfw_prestype_pie_chart
HEADER             = 'Departmental Assay of Acquirement'
TABLES
VALUES            = Y_VALUES
COLUMN_TEXTS      = X_TEXTS
EXCEPTIONS
ERROR_OCCURRED    =
1
OTHERS             = 2 .

GRAPH_3D / GRAPH_MATRIX* Series

The main function modules used in this serial are

  • Ø GRAPH_MATRIX
  • Ø GRAPH_MATRIX_2D
  • Ø GRAPH_MATRIX_3D
  • Ø GRAPH_MATRIX_4D

All these function modules are similar. These FM may appear more than circuitous, yet, they offer more features than the previous FM, similar sending graph as mail service, setting window size etc. An advantage in using these function modules is that you don't have to create a container in screen painter to see the output.

'GRAPH_MATRIX_3D' "Structure of 3D graphics (user-friendly version)

* EXPORTING

*   auto_cmd_1 = SPACE          "               Practice Not USE

*   auto_cmd_2 = Infinite          "               Do Not USE

*   col1 = Infinite                "               Column one

*   col2 = SPACE                "               Column 2

*   col3 = Space                "               Column iii

*   col4 = Space                "               Column 4

*   col5 = SPACE                "               Cavalcade 5

*   col6 = Infinite                "               Column six

*   dim1 = SPACE                "               Name of dimension 1

*   dim2 = SPACE                "               Name of dimension 2

*   inbuf = Space               "               DO Non Employ

*   inform = SPACE              "               Allows dialog functions

*   mail_allow = SPACE          "               Allows sending the graphic as post in SAPoffice

*   pwdid = Infinite               "               Dialog parameters

*   set_focus = 'x'             "               Set focus during reload

*   smfont = Space              "               Use smaller fonts = 'Ten'

*   so_contents = Infinite         "               Subtitle of generated SAPoffice document

*   so_receiver = SPACE         "               Recipient of generated SAPoffice object

*   so_send = SPACE             "               Graphic storage in SAPoffice instead of display

*   so_title = SPACE            "               Title of the generated SAPoffice document

*   stat = Infinite                "               Dialog parameters

*   super = Space               "               Dialog parameters

*   timer = Space               "

*   timer = Infinite               "

*   titl = SPACE                "

*   titl = SPACE                "               Title

*   valt = SPACE                "               Scale name

*   valt = SPACE                "

*   wdid = SPACE                "

*   wdid = SPACE                "               run into WINID

*   winid = Space               "               Dialog parameters

*   winid = Infinite               "

*   winpos = Infinite              "               Window position

*   winpos = SPACE              "

*   winszx = '50'               "

*   winszx = '50'               "               Window size in % / 10

*   winszy = '50'               "               Window size in % / Y

*   winszy = '50'               "

*   x_opt = SPACE               "

*   x_opt = SPACE               "

*   notify = Infinite              "               Actuate 'Save settings'

  IMPORTING

    b_key =                     "               Pressed key

    b_typ =                     "               Course for Business organization Graphics feedback

    cua_id =                    "               Not yet

    mod_col =                   "               Column of selected/modified object

    mod_row =                   "               Line of selected/modified object

    mod_val =                   "               New value of modified object

    m_typ =                     "               Dialog parameters

    rbuff =                     "               Do Not Utilize

    rwnid =                     "               Dialog parameters

  TABLES

    data =                      "   Table with text fields and value fields

    opts =                      "             Options table

    .  "  GRAPH_MATRIX_3D

All the role modules in this series have more than or less the aforementioned parameters with slight variations. Amidst the parameters, only the cols parameter, information table and opts tabular array is compulsory.  Rest is all additional features including setting the size of window (to change the default setting), sending graphic as mail etc.

The information table contains the input data for the graph while the 'opts' table defines the various settings that you crave for your graph. Y'all tin can pass an empty opts tabular array when the graph will exist displayed co-ordinate to default settings.

The opts table will be a grapheme table of the post-obit construction.

information : begin of opts occurs one ,
c ( lxxx ) type c ,
end
of opts.

Depending on the blazon of chart required, you lot demand to populate this table. This parameter has a huge potential and near whatsoever setting can exist appended as a row in this table parameter.

Example :

The following example outputs a 3D chart for the sales by state for three years.

It uses the FM GRAPH_MATRIX_3D

Written report   ZGRAPHICS.
*
DATA : BEGIN OF ITAB_DATA OCCURS 0 ,
Year(
15 ),
SALES1
Type I ,
SALES2
TYPE I ,
SALES3
Type I ,
Stop OF ITAB_DATA,

BEGIN OF ITAB_OPT OCCURS 0 ,
Selection(
20 ),
Cease OF ITAB_OPT.

ITAB_DATA-twelvemonth = '2010' .
ITAB_DATA-SALES1 =
55 .
ITAB_DATA-SALES2 =
62 .
ITAB_DATA-SALES3 =
39 .
Append ITAB_DATA.

ITAB_DATA-Twelvemonth = '2011' .
ITAB_DATA-SALES1 =
65 .
ITAB_DATA-SALES2 =
52 .
ITAB_DATA-SALES3 =
44 .
Append ITAB_DATA.

ITAB_DATA-Year = '2012' .
ITAB_DATA-SALES1 =
38 .
ITAB_DATA-SALES2 =
22 .
ITAB_DATA-SALES3 =
19 .
APPEND ITAB_DATA.

Call Office 'GRAPH_MATRIX_3D'
EXPORTING

     DIM1   = 'Country'
     DIM2   =
'Years'
      COL1   =
'Bharat'
      COL2   =
'United states of america'
      COL3   =
'UAE'
      TITL   =
'Sales across Countries in Dollars.'
TABLES
DATA    = ITAB_DATA
      OPTS   = ITAB_OPT
EXCEPTIONS
OTHERS = ane .

Output

This is the default output with an empty option tabular array.

On the top left is the three D graph. All the three dimensions, namely Country, Year and Sales quantity can be seen together in the 3D graph. To get a bigger view of the iii D graph, click on the '3D View' push on the peak.

The principal graph in the lower correct corner is the 2d vertical bar graph.  You can change the view of the 2nd graph by clicking on the button 'Left' or 'Correct'. The 2 D graph stack alternates between Years and Country on doing so.

You can make the graph more specific past clicking on the Sel Down or Sel up Button. If 2D graph is grouped by country, information technology volition show the graphs for each country one by i. You tin can besides attain this by navigating along the stack shown on the left side of the graph.

The sales output for the three years only for US is shown on navigating along the stack on the left side to US, or clicking the Sel Down Push Twice.

If the graph was grouped by Countries, nosotros would take been able to see the graphs for each year for all countries.

Showtime choice push button alternates between the overall view and specialized view.

The Group Button gives a magnified view of 2D graph with each country/ year grouped as an contained graph.

This was the output for the FM with the default parameters in the OPT tab.

You tin change the appearance of the 2d chart (the color or type of chart) by passing appropriate parameters to the opt tabular array.

The post-obit are the dissimilar values allowed in the opt parameter for 2D graphs.

Parameter for Type of 2D Graph

Parameter Output

P2TYPE = VB

Vertical Confined

P2TYPE = VS

Stacked Vertical Bars

P2TYPE = HB

Horizontal Bars

P2TYPE = HS

Stacked Horizontal. Bars

P2TYPE = TD

Perspective Bars

P2TYPE = VT

Vertical Triangles

P2TYPE = ST

Stepped Lines

P2TYPE = MS

Stepped Areas

P2TYPE = LN

Lines

P2TYPE = SA

Stacked Areas

P2TYPE = MA

Shaded Areas

P2TYPE = PI

Pie Chart

P2TYPE = TP

Perspective Pie Chart

P2TYPE = PO

Polar Diagram

P2TYPE = PP

Relative Polar

The different type of 3D charts possible in the FM module are as below.

Parameter for Blazon of 3D Graph

Parameter Output

P3TYPE = TO

Towers

P3TYPE = PY

Pyramids

P3TYPE = ED

Walls

P3TYPE = WE

WEDGES

P3TYPE = LI

Strips

P3TYPE = NT

Surface

Now permit the states change the in a higher place programme to output a Pie chart for the 2nd graph, and a Pyramid chart for the 3D nautical chart.

The only departure is that we populate the options table in addition to the above code. with the settings required.

itab_opt-option = 'P3TYPE = PY' . " 3D Graph type – Pyramid
APPEND ITAB_OPT.
itab_opt-option =
'P2TYPE = PI' . " 2D Graph type – Pie chart
Append ITAB_OPT.

*itab_opt-option = 'FIFRST = 3D '." First graph to brandish- 3D View

*APPEND ITAB_OPT.


Phone call Role 'GRAPH_MATRIX_3D'
EXPORTING
COL1   =
'India'
COL2   =
'US'
COL3   =
'UAE'
TITL   =
'Sales across Countries in Dollars.'
TABLES
DATA    = ITAB_DATA
OPTS   = ITAB_OPT
EXCEPTIONS
OTHERS = one .

Output

We can also set the parameter for the first screen to be displayed. In the default settings, the Overview screen was displayed. Passing one of the following parameters, we can set a item graph output to exist displayed first. For example when nosotros laissez passer the parameter, 'FIFRST = 3D', it'due south the magnified 3D view that is shown outset on executing the transaction and nosotros can encounter the other graphs by pressing the overview push.

Parameter for the First Graph to exist displayed.

Parameter Output

FIFRST = 2D

2d View  (The output for 2D View push button on the Overview Screen)

FIFRST = 3D

3D View  (The output for 3D view button on the Overview Screen)

FIFRST = PU

Graph for the first component on the electric current stack is displayed first ( In the example, 2010, ie, the output on clicking the Sel upwardly/ Sel Downward push on the Over view screen.)

FIFRST = GP

Groups (Output for Groups Push on the Overview Screen)

DTDORD = 2134

The graphs on the right stack will be displayed starting time. (In the instance, the stack with Countries would be displayed, ie the output on Clicking the Right or Left button on the Overview Screen.)

The color of the graphs can as well be inverse with the following parameters

Parameter Output

CLPALT = A

Blueish

CLPALT = B

Yellowish

CLPALT = C

Greenish

CLPALT = D

Grey

CLPALT = E

Dot Matrix Printer

CLPALT = F

PostScript

In that location are various other options available similar the coloring scheme for the 3D graphs, background, iii D effects, title, window size, which can be prepare by passing appropriate parameters in the tabular array.

For more options available in this, refer the following link.

http://wiki.scn.sap.com/wiki/display/Snippets/Graph+Parameters

Note : The 2D graph options and 3D graph options can exist used if y'all are calling GRAPH_MATRIX_3D FM, still but the options for 2d graph tin be passed as parameters when GRAPH_MATRIX_2D FM is used.

GRAPH_MATRIX_4D.

With Graph_MATRIX_4D role module, I can add one more dimension to the graph. So I tin can navigate the 2D and 3D graph for each value in the ivth Dimension by clicking on the Up and Downwardly button.

The output looks similar to the output from the previous function with 3D graph at the elevation and 2D graph at the lesser

In the 3D graph, the time is shown with colors.

In the previous plan, if nosotros want to requite the sales comparing based on products also, I use this function module.

The output would be

Here in the 2nd graph (bottom-correct), the p z roduct Cosmetics is selected on the stack. The X axis, shows the Countries, the years are differentiated past the three colors. To come across the graph for other products, just navigate along the products on the stack or click on the 'Sel Up' or 'Sel Down' Button above. It appears as if you are turning the pages of the volume.

The y axis shows the sales for that particular combination.

The Ten axis and the color parameters can be alternated using the 'Left' or 'Correct' Push at the tiptop. On clicking them, the colors shows sales based on country and the years would be regulated along the x axis and vice-versa

The Groups button will bear witness all the groups at on shot.

The 3D graph can be magnified on clicking the 3D push.

A

As tin be seen, all the four dimensions are visible in this graph, using the x, y and z co-ordinates and the color code.

The colors on the graph tin be enable or disabled past clicking the Stack On/Off Button.

Again, equally was mention for the previous function module, using the advisable parameters in the opts table, you can change the second graph to pie nautical chart, horizontal bar chart etc. 3D chart type tin also exist changed according to the requirements. (Refer the parameter list provided above).

Now to go the above output, there are very few changes that demand to exist fabricated to the function module compared to the 3D function.

When declaring the internal tabular array, we obviously need to enter more values since at that place are four dimensions. Yet for the start dimension, a minimum of six fields must be entered in the internal tabular array type, whether we crave information technology or not.

types : Begin OF ITAB_type,
PROD(
fifteen ),
IN10
TYPE I ,
IN11
TYPE I ,

IN12 Blazon I ,
IN13
TYPE I ,
IN14
TYPE I ,
IN15
Type I ,
US10
TYPE I ,
US11
Type I ,
US12
Type I ,
US13
Type I ,
US14
Blazon I ,
US15
TYPE I ,
UA10
TYPE I ,
UA11
Type I ,
UA12
Blazon I ,
UA13
TYPE I ,
UA14
TYPE I ,
UA15
TYPE I ,
Terminate OF ITAB_type.

data : itab_data blazon tabular array of itab_type with HEADER LINE ,

Begin OF ITAB_OPT OCCURS 0 ,
Selection(
xx ),
END OF ITAB_OPT.

ITAB_DATA-prod = 'Cosmetics' .
ITAB_DATA-IN10 =
55 .
ITAB_DATA-IN11 =
twenty .
ITAB_DATA-IN12  =
40 .
ITAB_DATA-US10  =
xxx .
ITAB_DATA-US11  =
15 .
ITAB_DATA-US12  =
54 .
ITAB_DATA-UA10  =
18 .
ITAB_DATA-UA11  =
26 .
ITAB_DATA-UA12  =
35 .
APPEND ITAB_DATA.

ITAB_DATA-prod = 'Confectionaries' .
ITAB_DATA-IN10 =
35 .
ITAB_DATA-IN11 =
40 .
ITAB_DATA-IN12  =
50 .
ITAB_DATA-US10  =
twenty .
ITAB_DATA-US11  =
13 .
ITAB_DATA-US12  =
51 .
ITAB_DATA-UA10  =
12 .
ITAB_DATA-UA11  =
24 .
ITAB_DATA-UA12  =
85 .
APPEND ITAB_DATA.

ITAB_DATA-prod = 'Stationery' .
ITAB_DATA-IN10 =
25 .
ITAB_DATA-IN11 =
sixty .
ITAB_DATA-IN12  =
twenty .
ITAB_DATA-US10  =
forty .
ITAB_DATA-US11  =
15 .
ITAB_DATA-US12  =
64 .
ITAB_DATA-UA10  =
78 .
ITAB_DATA-UA11  =
16 .
ITAB_DATA-UA12  =
15 .
APPEND ITAB_DATA.
* Grpah options
*itab_opt-selection = 'P3TYPE = PY'.  " 3D Graph type – Pyramid
*APPEND ITAB_OPT.
*itab_opt-option = 'P2TYPE = PI'.  " 2D Graph type – Pie chart
*APPEND ITAB_OPT.
*itab_opt-option = 'FIFRST = PU '. " First graph to brandish – Offset graph on stack
*APPEND ITAB_OPT.
*itab_opt-option = 'DTDORD = 2134'. " The graphs on the right stack will exist displayed first.
*APPEND ITAB_OPT.
*itab_opt-pick = 'FISTK3 = X'.
*APPEND ITAB_OPT.


Telephone call FUNCTION 'GRAPH_MATRIX_4D'
EXPORTING
*   AUTO_CMD_1        = ' '
*   AUTO_CMD_2        = ' '
DIM1              =
'Country '
DIM1_1            =
'Bharat '
DIM1_2            =
'Usa'
DIM1_3            =
'Great britain '
*   DIM1_4            = ' '
*   DIM1_5            = ' '
*   DIM1_6            = ' '
DIM2              =
'YEAR'
DIM2_1            =
'2010'
DIM2_2            =
'2011'
DIM2_3            =
'2012'
*   DIM2_4            = ' '
*   DIM2_5            = ' '
*   DIM2_6            = ' '
DIM3              =
'Products'
*   MAIL_ALLOW        = ' '
TITL              =
' Sales Comparing'
TABLES
DATA               = ITAB_DATA
OPTS              = ITAB_OPT.

In the function module, DIM1, DIM2, and DIM3, defines the three dimensions of the graph, namely Country, Year and Products. The 4th dimension, Sales, is reflected from the Title of the Graph. The values for DIM1 (State) are provided in the function modules as parameters, DIM1_1, DIM_2, DIM_3. The values in DIM2 (Twelvemonth) is also similarly provided in the module. The Values in Dimension iii (Products) is provided in the data table as the start column in each row appended .

To know about function module STAT_GRAPH_REF which is also used to depict graphs, refer the comment beneath from Ramesh T.

Drawing Graphical Charts with ABAP. | SCN

More than advanced features can be achieved through the course CL_GFW.

Use transaction GRAL to explore into the diverse possibilities and features available in ABAP for graphical chart .

I hope that makes cartoon graphs with ABAP consummate and easily achievable. You can now confidently tell the customer, 'You say information technology, nosotros got information technology!'

Savor drawing graphs on ABAP!

williamsupolkinsuct.blogspot.com

Source: https://blogs.sap.com/2013/09/18/drawing-graphical-charts-with-abap/

Related Posts

0 Response to "turning a 3d drawing in to a 2d"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel