SAP BW获取数据

使用RRW3_GET_QUERY_VIEW_DATA

导言

最近在开发一个通过sqbbw jco取数的插件,其中核心部分就是使用RRW3_GET_QUERY_VIEW_DATA 来读取query desinger中的数据
You set default variables by parameterizing the URL. The variable values are separated from each other by different indexes. The index in the parameter is indicated in the following by _I.

类型

传入参数如下

I_INFOPROVIDER “信息提供商
I_QUERY “QUERY名称
I_VIEW_ID “可有可无
I_T_PARAMETER “参数列表

I_T_PARAMETER 参数列表相应格式如下

Characteristic Value Variables

特征值变量

Parameter variables or variables for several single values are predefined as follows:
对于单值性的变量使用以下形式:

Parameter Description
VAR_NAME_I Technical name of the variables
VAR_VALUE_EXT_I Attribute value in external display Key for characteristic value in external display

Interval variables

区间变量

Interval variables are predefined as in the following:
区间变量使用以下形式:

Parameter Description
VAR_NAME_I Technical name of the variables
VAR_VALUE_LOW_EXT_I “From” characteristic value in external display Key for characteristic value in external display
VAR_VALUE_HIGH_EXT_I “To” characteristic value in external display Key for characteristic value in external display

Selection option variables

选择选项变量

Selection option variables are predefined as in the following:
选择项型变量使用以下形式:

Parameter Description
VAR_NAME_I Technical name of the variables
VAR_OPERATOR_I An operator
‘EQ’ = Individual value
‘NE’ = Not the same value (后来我专门找到的,之前的文档都没有)
‘BT’ = Interval
‘LT’ = Less than
‘LE’ = Less than or equal to
‘GT’ = Greater than
‘GE’ = Greater than or equal to
‘NB’ = Not Between
‘CP’ = 模糊查询
VAR_VALUE_LOW_EXT_I “From” characteristic value in external display Key for characteristic value in external display
VAR_VALUE_HIGH_EXT_I ** “To” Key for characteristic value in external display This value must only be specified with VAR_OPERATOR='BT'.
VAR_SIGN_I ** “Row properties”
'I'found values are added,
'E' found values are removed.

需要注意的是一旦设置了VAR_VALUE_HIGH_EXT_I 那么 VAR_OPERATOR_I 设置为 BT否则会报错

Variables for precalculated value

预计算变量

Variables for precalculated value sets are preassigned as follows:
预计算变量使用以下形式:

Parameter Description
VAR_NAME_I Technical name of the variables
VAR_VALUE_EXT_I Name of value set

Hierarchy Nodes

层次结构类型

Variables for Single Hierarchy Nodes or Variables for Several Hierarchy Nodes
单个层次节点的变量或多个层次节点的变量:

Parameter Description
VAR_NAME_I Technical name of the variables
VAR_VALUE_EXT_I Key for hierarchy node
VAR_NODE_IOBJNM_I Node characteristic name With characteristic nodes and text nodes, you have to specify the characteristic name 例如(0HIER_NODE).

Hierarchy, Formula, and Text Variables

层级机构,公式和文本变量

Parameter Description
VAR_NAME_I Technical name of the variables
VAR_VALUE_EXT_I Hierarchy name, formula value, text

原文

为了防止这个链接丢失,我直接把原文复制了过来

hi,

select-options. Unlike parameters that are declared as elementary variables in ABAP programs, selection criteria are based on special internal tables, called selection tables.

To define a selection criterion, you must declare a selection table in the declaration part using the SELECT-OPTIONS statement You use the statement SELECT-OPTIONS for .

The row type of a selection table is a structure that consists of the following four components: SIGN, OPTION, LOW and HIGH.

Each row of a selection table that contains values represents a sub-condition for the complete selection criterion.

Description of the individual components: SIGN ‘ The data type of SIGN is C with length 1. The contents of SIGN determine for each row whether the result of the row condition is to be included in or excluded from the resulting set of all rows.

OPTION The data type of OPTION is C with length 2. OPTION contains the selection operator.

The following operators are available If HIGH is empty, you can use EQ, NE, GT, LE, LT,CP, and NP. These operators are the same as those that are used for logical expressions.

If HIGH is filled, you can use BT (BeTween) and NB (Not Between).

LOW The data type of LOW is the same as the column type of the database table, to which the selection criterion is linked.

HIGH The data type of HIGH is the same as the column type of the database table, to which the selection criterion is linked. The contents of HIGH specify the upper limit for a range selection.

To assign default values to a selection criterion, you use the following syntax: SELECT-OPTIONS FOR DEFAULT [TO ] ….

To allow the user to process only the first row of the selection table on the selection screen, you use the following syntax SELECT-OPTIONS FOR ….. NO-EXTENSION …..

To allow the user to process only single fields on the selection screen, you use the following syntax: SELECT-OPTIONS FOR ….. NO INTERVALS …..

SPA/GPA parameters as default values SELECT-OPTIONS FOR … MEMORY ID ……….

Upper and lower case for selection criteria: SELECT-OPTIONS FOR … LOWER CASE …………..

To make the From field a required field on the selection screen, use: SELECT-OPTIONS FOR … OBLIGATORY …………..

To hide input fields on the selection screen, use: SELECT-OPTIONS FOR … NO DISPLAY …………..

To modify input fields on the selection screen, use: SELECT-OPTIONS FOR … MODIF ID

regards,

Ashokreddy.

参考链接:

  1. 读取BW QUERY 到相应内表 RRW3_GET_QUERY_VIEW_DATA
  2. “option” in select-options