Professional Documents
Culture Documents
Customer Exit For Char
Customer Exit For Char
Posted In: bex variables , bi variables , bw variables , customer exit , user exit , user exit 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.
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 with following 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 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.
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.