ABAP - 3D Graphs with SAP
2008-05-13 08:58
393 查看
在ABAP设计中,程序员经常需要用图形显示报表的统计结果,我们可以使用函数:GRAPH_MATRIX_3D来达到图形显示。
GRAPH_MATRIX_3D函数参数很多,但只有三个参数必须需要输入:
Table DATA
The first field of table DATA must be a C field of any length. The number values must then be passed in one or more numeric fields. These fields can have type P or F.
Table OPTS
Table OPTS is used to pass all the options which can be changed interactively. Table OPTS must always be passed to the function module, but you can pass an empty table. In this case the default settings are used.
One of the parameters COL1 to COL6
Parameters COL1 to COL6 are used to pass column titles and they also define whether the corresponding table columns should be represented graphically. If a value which is not equal to SPACE is passed, then the corresponding column is represented.
Make sure that at least one of these parameters is passed. A maximum of 6 columns can be represented.
All other paramters are optional.
样例代码:
REPORT ZPR_Graphs.
DATA: BEGIN OF ITAB_MAIN OCCURS 0,
DATANAME(15),
QUANTITY1 TYPE I,
QUANTITY2 TYPE I,
QUANTITY3 TYPE I,
QUANTITY4 TYPE I,
END OF ITAB_MAIN,
BEGIN OF ITAB_OPTIONS OCCURS 0,
OPTION(20),
END OF ITAB_OPTIONS.
ITAB_MAIN-DATANAME = 'Gas'.
ITAB_MAIN-QUANTITY1 = 52.
ITAB_MAIN-QUANTITY2 = 66.
ITAB_MAIN-QUANTITY3 = 0.
ITAB_MAIN-QUANTITY4 = 93.
APPEND ITAB_MAIN.
ITAB_MAIN-DATANAME = 'Electricity'.
ITAB_MAIN-QUANTITY1 = 18.
ITAB_MAIN-QUANTITY2 = 22.
ITAB_MAIN-QUANTITY3 = 19.
ITAB_MAIN-QUANTITY4 = 92.
APPEND ITAB_MAIN.
ITAB_MAIN-DATANAME = 'Fuel'.
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 = '2001'
COL2 = '2002'
COL3 = '2003'
COL4 = '2004'
TITL = 'Expenses - India(INR).'
TABLES
DATA = ITAB_MAIN
OPTS = ITAB_OPTIONS
EXCEPTIONS
OTHERS = 1.
GRAPH_MATRIX_3D函数参数很多,但只有三个参数必须需要输入:
Table DATA
The first field of table DATA must be a C field of any length. The number values must then be passed in one or more numeric fields. These fields can have type P or F.
Table OPTS
Table OPTS is used to pass all the options which can be changed interactively. Table OPTS must always be passed to the function module, but you can pass an empty table. In this case the default settings are used.
One of the parameters COL1 to COL6
Parameters COL1 to COL6 are used to pass column titles and they also define whether the corresponding table columns should be represented graphically. If a value which is not equal to SPACE is passed, then the corresponding column is represented.
Make sure that at least one of these parameters is passed. A maximum of 6 columns can be represented.
All other paramters are optional.
样例代码:
REPORT ZPR_Graphs.
DATA: BEGIN OF ITAB_MAIN OCCURS 0,
DATANAME(15),
QUANTITY1 TYPE I,
QUANTITY2 TYPE I,
QUANTITY3 TYPE I,
QUANTITY4 TYPE I,
END OF ITAB_MAIN,
BEGIN OF ITAB_OPTIONS OCCURS 0,
OPTION(20),
END OF ITAB_OPTIONS.
ITAB_MAIN-DATANAME = 'Gas'.
ITAB_MAIN-QUANTITY1 = 52.
ITAB_MAIN-QUANTITY2 = 66.
ITAB_MAIN-QUANTITY3 = 0.
ITAB_MAIN-QUANTITY4 = 93.
APPEND ITAB_MAIN.
ITAB_MAIN-DATANAME = 'Electricity'.
ITAB_MAIN-QUANTITY1 = 18.
ITAB_MAIN-QUANTITY2 = 22.
ITAB_MAIN-QUANTITY3 = 19.
ITAB_MAIN-QUANTITY4 = 92.
APPEND ITAB_MAIN.
ITAB_MAIN-DATANAME = 'Fuel'.
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 = '2001'
COL2 = '2002'
COL3 = '2003'
COL4 = '2004'
TITL = 'Expenses - India(INR).'
TABLES
DATA = ITAB_MAIN
OPTS = ITAB_OPTIONS
EXCEPTIONS
OTHERS = 1.
相关文章推荐
- ABAP - 3D Graphs with SAP
- ABAP - 3D Graphs with SAP
- ABAP - 3D Graphs with SAP
- ABAP - 3D Graphs with SAP
- ABAP - 3D Graphs with SAP
- ABAP - 3D Graphs with SAP
- SAP ABAP将大数据量排序后输入到内表 OPEN CURSOR [WITH HOLD] dbcur FOR
- Informatica PowerConnect for SAP R3——Integrating with SAP Using ABAP
- Working with EXIT, STOP, CONTINUE and RETURN in SAP ABAP
- Sending email with attachment in SAP ABAP
- SAP ABAP程序优化方法(搜集自论坛)
- (转)How to use MySQL with 3D Studio Max
- BAPI / RFC with Delphi(系列之三)--TSAPLogonControl使用(无对话框的登录sap的delphi源代码)
- SAP ABAP OLE 操作上传的EXCEL模板(转)
- SAP abap程序里面权限控制代码
- Exploring EDA Algorithms with the Boost Graph Library
- ABAP---SAP Data Archiving
- Deep Learning: Doubly Easy and Doubly Powerful with GraphLab Create
- ABAP--Field Symbol 的Example(来自SAP的样例)
- ABAP--How to use TEXTEDIT(SAP 的样例摘抄)