SAP Study Notes: BW Queriy-Variables(变量)
About Variable:
1.Variable 是和InfoObject绑定的,可用于任何含有该IO的query中。
2.Variable有以下几种类型:
Characteristic:用于限制Char。
Text:用于在报表动态显示文本。
Hierarchy:用于限制Hierarchy。
Hieararchy Node:用于限制Hierarchy Node。
Formula: 可以在公式中使用变量,让用户输入一个数,读取某个Char.的属性(例如Prduct的price属性)等来用于计算。
Offset的应用:设置偏移量
SAP BI Content内置了很多标准变量。当其无法满足需求时,有时仅仅需要设置下偏移量就可以满足需求了。
例如系统已经有了当前月份的变量,通过偏移就可以获得上N个月和下N个月的变量,无需增强。
定义Customer Exit Variables(BW 3.x ,BI7 类似)
客户出口变量可以通过程序来处理变量逻辑。定义过程如下:
1.在query designer中,右键单击要建立变量的characteristic,选择New variable.
2.设置为customer exit类型
3.进入CMOD,修改:Enhancement Exp RSR00001 BI: Enhancements for Global Variables in Reporting-->Function exit EXIT_SAPLRRS0_001-->INCLUDE ZXRSRU01 。该Function Module 将在query运行时被调用多次。
3-1:调用前,系统将其他变量的当前值保存在内表 I_T_VAR_RANGE中。The table type is RRS0_T_VAR_RANGE, and row type RRS0_S_VAR_RANGE references structure RRRANGEEXIT.This structure has the following fields:
Field Description
VNAM Variable name
IOBJNM InfoObject name
SIGN (I)ncluding [ ] or (E)xcluding ] [
OPT Operators: EQ =, BT [ ], LE <=, LT <, GE >=, GT >, CP, and so on
LOW Characteristic value
HIGH Characteristic value of upper limit for intervals or node InfoObject for hierarchy nodes
3-2:每次调用时,系统会传递参数值给Function Module。其中,比较重要的参数如下:
I_STEP 标识了该调用发生的时机:
I_STEP = 1: Call is made directly before variable entry.
I_STEP = 2: Call is made directly after variable entry. This step is only executed if the same variable is not input-ready and could not be filled for I_STEP = 1.
I_STEP = 3: In this call, you can check the values of the variables. When an exception (RAISE) is triggered, the variable screen appears again. I_STEP = 2 is then also called again.
I_STEP = 0: The enhancement is not called from the variable screen. The call can originate from the authorization check or from the monitor.
I_VNAM标识了当前要处理的变量。
3-3:完成变量的处理之后,应将变量的值写入E_T_RANGE。
Sample Code:
DATA: L_S_RANGE TYPE RSR_S_RANGESID.
DATA: L_S_VAR_RANGE TYPE RRRANGEEXIT.
CASE I_VNAM.
WHEN 'CUMMONTH'.
IF I_STEP = 2. "after the popup
READ TABLE I_T_VAR_RANGE INTO L_S_VAR_RANGE WITH KEY VNAM = 'MONTH'.
IF SY-SUBRC = 0.
CLEAR L_S_RANGE.
L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4)."low value, for example, 200601
L_S_RANGE-LOW+4(2) = '01'.
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW. "high value = input
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
ENDIF.
ENDCASE.
查看SAP Exit变量
SAP Exit变量为我们编写customer exit变量提供了很好的参考。
1. SE16 查看表 RSZGLOBV 可以得到系统全部变量的列表,选择process type=SAP Exit,即可获得所有的SAP Exit变量列表
2. SE37 查看 RREX_VARIABLE_EXIT 或RSVAREXIT_ * 可以找到SAP Exit变量的代码
相关文章
- 27 行代码开发一个最简单的 SAP ALV 报表
- 171. SAP UI5 响应式表格 sap.m.Table 根据不同宽度的屏幕动态决定显示或隐藏 Column 的实现源代码讲解
- SAP UI5 Table 控件数据进行 Excel 导出时如何进行格式控制
- 使用 SAP UI5 sap.ui.export.Spreadsheet API 进行 Excel 导出的一些限制
- SAP UI5 sap.ui.export.Spreadsheet API 介绍
- SAP UI5 sap.ui.core.Element 的概要介绍
- SAP UI5 应用 index.html 里定义的 data-sap-ui-theme 值的加载原理
- SAP UI5 sap.ui.vk 命名空间内的控件介绍
- SAP UI5 应用的 OData 元数据请求的发送原理分析
- SAP UI5 的 sap-ui-bootstrap script 脚本标签各属性解析
- SAP UI5 walkthrough第一第二部分解析:data-sap-ui-libs=“sap.ui.commons,sap.ui.table“
- SAP UI5 jQuery.sap.setObject
- SAP UI5应用的一个调试参数 - sap-ds-debug=true
- SAP UI5 sap.m.ListMode - ModesingleSelectMaster
- SAP ABAP字符和字符串变量隐式转换的一些规则
- SAP CDS view自学教程之二:当SAP CDS view被激活时,背后发生了什么
- 如何将SAP Document Builder的word控件设置成只读模式
- SAP CRM WebUI, CRM Fiori和C4C里的Direct Navigation
- where is flag GV_IMMEDIATE_RESTART marked in SAP CRM WebClient UI
- 在SAP ABAP和Hybris Commerce里启动后台作业
- SAP 电商云 Spartacus UI CheckoutDeliveryService 的单元测试设计
- 让 SAP Spartacus 某些 Component 不参与 SSR 的办法
- SAP Spartacus Theme 设置
- SAP Spartacus 如何获得当前渲染页面的 CMS 元数据
- SAP Spartacus里的place holder Component - CMSFlexComponent
- SAP Spartacus scss 变量--cx-spatial-base赋值的地方
- SAP Cloud for Customer图片渲染逻辑的调试
- 给具有SAP传统产品ABAP开发经验的朋友介绍SAP C4C
- SAP CRM IPM行业解决方案 - 如何创建IP Scope
- SAP成都研究院马洪波:提升学习力,增强竞争力,收获一生乐趣
- SAP S/4HANA销售订单的类型建模细节
- SAP BTP 平台 CloudFoundry 环境下的 Application Pattern
- sap.ui.core.IAsyncContentCreation 这个标记接口在 SAP UI5 框架中的应用
- SAP 电商云 Spartacus UI 产品明细页面路由确定后,加载的是 page template