BW出口變量增強


英文好的可以直接看下面2個鏈接,第三個是經過翻譯的,本文中很多也是直接從第三篇拷貝過來的。

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htm

http://help.sap.com/saphelp_nw04s/helpdata/EN/1d/ca10d858c2e949ba4a152c44f8128a/frameset.htm

 

用戶出口增強,定義方法:

1.在query designer中,右鍵單擊要建立變量的characteristic,選擇New variable.
2.設置為customer exit類型
3.進入CMOD,修改:Enhancement 添加出口 RSR00001 BI: Enhancements for Global Variables in Reporting-->Function exit EXIT_SAPLRRS0_001-->INCLUDE ZXRSRU01 。該Function Module 將在query運行時被調用多次。
 

I_STEP 值說明: I_STEP = 1,Call is made directly before variable entry. 可用於預先填充選擇變量。如果在這里對變量進行了操作,就沒法在step2里邊對該變量做修改了。

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.

這句話的意思就是如果你想觸發step2,就必須在Bex Analyser上變量屬性中去掉“變量已准備輸入”,並且在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.

檢查變量,當拋出異常的時候,變量會被要求重新輸入,當然step2也會被再次觸發。

 

"I_STEP = 0,The enhancement is not called from the variable screen. The call can originate from the authorization check or from the monitor.

這個不會從變量輸入觸發,會被權限檢查或者監視器觸發。

 

 

When the enhancement RSR00001 is called,the system passes the current values of the other variables in table I_T_VAR_RANGE. The table type is RRS0_T_VAR_RANGE, and row type RRS0_S_VAR_RANGE references structure RRRANGEEXIT.
 
所有變量都回提前存放在 I_T_VAR_RANGE,類型是RRS0_T_VAR_RANGE,變量類型是RSR_S_RANGESID,提取結構是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

 
Sample Code:
In the following example, the current
month is taken from an input-ready variable MONTH; this is then used to generate
an interval that cumulates all months from January ('01') up to the current
month. The customer exit variable CUMMONTH contains the interval as the
value.
 
DATA: L_S_RANGE TYPE RSR_S_RANGESID. 修改以后替換用戶輸入的變量
DATA: L_S_VAR_RANGE TYPE RRRANGEEXIT.從I_T_VAR_RANGE讀取的變量保存到該變量
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)."將前4位付給low,比如200601的2006
L_S_RANGE-LOW+4(2) = '01'. 將01付給5,6位,就是用01替換以前的月份
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW. "high value = input
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'. 操作是between
APPEND L_S_RANGE TO E_T_RANGE. 將修改后的變量付給出口。
ENDIF. ENDIF. ENDCASE.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM