Escolar Documentos
Profissional Documentos
Cultura Documentos
BW
Skip to end of metadata
Added by Guest, last edited by Martin Grob on Sep 16, 2013 (view change)
show comment
Go to start of metadata
Applies to:
SAP BW 3.5, SAP BW 7.0
Summary
This WIKI provides the sample code for various user exits.
SINGLE VARIABLE
WHEN 'VAR_SINGLE'.
CLEAR L_S_RANGE.
L_S_RANGE-LOW = '40'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
INTERVAL VARIABLE
WHEN 'VAR_INTERVAL'.
L_S_RANGE-LOW = '10'.
L_S_RANGE-HIGH = '40'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
HIERARCHY VARIABLE
WHEN 'VAR_HIER'.
L_S_RANGE-LOW = 'REPORTING_HIER'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
WHEN 'VAR_HNODE'.
L_S_RANGE-LOW = 'MAYURI'.
L_S_RANGE-HIGH = '0HIER_NODE'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
VARIABLE IN A VARIABLE
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZMONTH1'.
CLEAR L_S_RANGE.
L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
L_S_RANGE-LOW+6(2) = '01'. e.g.200001
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW. "high value = input
L_S_RANGE-HIGH+6(2) = '10'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE. EXIT. ENDLOOP. ENDIF
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.
CASE I_VNAM.
WHEN 'CUMMONTH'.
IF SY-SUBRC = 0.
CLEAR L_S_RANGE.
L_S_RANGE-LOW+4(2) = '01'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
ENDIF.
ENDIF.
ENDCASE.