Customer Exit for Char
-
Upload
hariprasad-devi -
Category
Documents
-
view
218 -
download
0
Transcript of Customer Exit for Char
-
7/29/2019 Customer Exit for Char
1/2
Customer Exit to Restrict a Characteristic withValues Containing Certain PatternPosted In: bex variables , bi variables , bw variables , customer exit , user exit , userexit variables . By Srinivas Neelam
Ref: SDN Wiki
Author: Ramakrishna Gattikoppula
Scenario
In BW Queries very often there is a requirement to restrict a characteristic with some values
to get the correct result. Let us say we have a requirement where we need to restrict the
query to only those Departments for which the Department ID starts with D1 or D2. This will
be very simple task when there are limited number of Departments IDs starting with D1 or
D2, but what if there are many Departments whose ID starts with D1 or D2.
Solution
This Can be achieved using a Customer Exit Variable.
Following are the steps you need to perform to restrict the characteristic with values having
certain pattern.
Step1: Create a New Variable(say ZVAR_DEPT) on the Characteristic Department withfollowing properties.
Type of Variable: Characteristic Value.
Processing By: Customer Exit.
Variable Represents: Multiple Single Values.
Variable Entry is: Mandatory, Not Ready for Input and Cannot be changed in Query
Navigation
Step 2: Restrict the Characteristic with the variable ZVAR_DEPT.
Step 3: Go to Transaction SE37 and enter "EXIT_SAPLRRS0_001". In the next screen double
click on "ZXRSRU01", this will take you to the screen where you can define Customer exit code
for Global Variables in Reporting.
http://sapbwneelam.blogspot.com/2009/11/customer-exit-to-restrict.htmlhttp://sapbwneelam.blogspot.com/2009/11/customer-exit-to-restrict.htmlhttp://sapbwneelam.blogspot.com/search/label/bex%20variableshttp://sapbwneelam.blogspot.com/search/label/bi%20variableshttp://sapbwneelam.blogspot.com/search/label/bw%20variableshttp://sapbwneelam.blogspot.com/search/label/customer%20exithttp://sapbwneelam.blogspot.com/search/label/user%20exithttp://sapbwneelam.blogspot.com/search/label/user%20exit%20variableshttp://sapbwneelam.blogspot.com/search/label/user%20exit%20variableshttp://sapbwneelam.blogspot.com/search/label/bex%20variableshttp://sapbwneelam.blogspot.com/search/label/bi%20variableshttp://sapbwneelam.blogspot.com/search/label/bw%20variableshttp://sapbwneelam.blogspot.com/search/label/customer%20exithttp://sapbwneelam.blogspot.com/search/label/user%20exithttp://sapbwneelam.blogspot.com/search/label/user%20exit%20variableshttp://sapbwneelam.blogspot.com/search/label/user%20exit%20variableshttp://sapbwneelam.blogspot.com/2009/11/customer-exit-to-restrict.htmlhttp://sapbwneelam.blogspot.com/2009/11/customer-exit-to-restrict.html -
7/29/2019 Customer Exit for Char
2/2
Step 4: Include the following code in the Customer Exit code.
WHEN 'ZVAR_DEPT'.
IF I_STEP = 1.
DATA: ITAB1 TYPE STANDARD TABLE OF /BI0/SDEPT_ID WITH HEADER LINE.
SELECT * FROM /BI0/SDEPT_ID INTO TABLE ITAB1 WHERE DEPT_ID LIKE 'D1%' OR DEPT_ID
LIKE 'D2%'.
CLEAR: L_S_RANGE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
LOOP AT ITAB1.
L_S_RANGE-LOW = ITAB1-DEPT_ID.
APPEND L_S_RANGE TO E_T_RANGE.ENDLOOP.
CLEAR L_S_RANGE.
ENDIF.