How to… Derive a Variable value from another variable

BUSINESS INFORMATION WAREHOUSE

ASAP “How to…” Paper

Applicable Releases: BW 2.0B, 2.1C May 2001

SAP (SAP America, Inc. and SAP AG) assumes no responsibility for errors or omissions in these materials. These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages.

You can use this step to fill your variable with default values. The customer exit for variables is called three times maximally. AND SAP AG 1 . The period should be entered by the user. Please note that you can not overwrite the user input values into a variable with this customer exit. You can only derive values for other variables or validate the user entries. The InfoCube contains only the InfoObject 0CALMONTH (Month/Year) and not single InfoObjects for the period and year. The first step (I_STEP = 1) is before the processing of the variable pop-up and gets called for every variable of the processing type “customer exit”. The second step (I_STEP = 2) is called after the processing of the variable pop-up.HOW TO … DERIVE A VARIABLE VALUE FROM ANOTHER VARIABLE 1 Business Scenario A query should show in one column the value for one period. These three steps are called I_STEP. INC. This step is called only for those variables that are not marked as “ready for input” and are set to “mandatory variable entry”. Here you can validate the user entries. 2 The Result For this scenario we need four variables. One of these period variables is defined as a variable with a customer exit. In the second column the accumulated value from the beginning of the year to the period from the first column should be displayed. Ó2001 SAP AMERICA. The third step (I_STEP = 3) is called after all variable processing and gets called only once and not per variable. two variables for the column text and two variables for the period values.

The variable is based on the InfoObject 0CALMONTH. AND SAP AG 2 . Set the following attributes: q q q Single Value Ready for input Mandatory variable entry 2. INC. The variable is based on the InfoObject 0CALMONTH. Set the following attributes: q q Interval Mandatory variable entry Ó2001 SAP AMERICA. Create an input variable. Create a variable with a customer exit as a processing type. 1.HOW TO … DERIVE A VARIABLE VALUE FROM ANOTHER VARIABLE 3 The Step By Step Solution This example is based on the InfoCube 0D_SD_C03 from the Demo Business Content.

Both variables use the “Replacement Path” as the processing type. The second variable is filled with the text from the ‘to value’. Create a new project. Ó2001 SAP AMERICA. Create two text variables. maintain the short text. 4. and assign a development class. INC. The first text variable is filled with the text from the ‘from value’. Call Transaction CMOD for the definition of the customer exit. Goto Enhancements Assignments and assign RSR00001. AND SAP AG 3 . Press the button components to continue.HOW TO … DERIVE A VARIABLE VALUE FROM ANOTHER VARIABLE 3.

7. If the include doesn’t exist you have to create it. Ó2001 SAP AMERICA. INC. AND SAP AG 4 . assign a development class and a transport request.HOW TO … DERIVE A VARIABLE VALUE FROM ANOTHER VARIABLE 5. Enter the coding (see also Appendix). For documentation place the cursor on RSR00001 and use the menu Goto -> Display documentation. Then double-click on ZXRSRU01. Double-click on EXIT_SAPLRRS0_001. 6. Save and activate the coding.

Create a new structure for the columns by using a right-mouse click on the columns. The details are described in the following steps. Define a query. Ó2001 SAP AMERICA. Activate the project. 10. 9.HOW TO … DERIVE A VARIABLE VALUE FROM ANOTHER VARIABLE 8. This is very important. AND SAP AG 5 . INC.

Add the text variable &TMONTHF& as the description.HOW TO … DERIVE A VARIABLE VALUE FROM ANOTHER VARIABLE 11. Create a second selection Ó2001 SAP AMERICA. 12. AND SAP AG 6 . Drag & drop the variable ‘MONTH’ to your selection. INC. 13. Make another right-mouse click on the columns and choose the option ‘New selection’.

embed the query in a workbook and execute the query. You can see in the first column the value for the period which was entered by the user. Now drag & drop the variable ‘CUMMONTH’ to your selection Add the text variable &TMONTHF& as the description. Save your query. AND SAP AG 7 . INC. 17. Both columns have the correct text.HOW TO … DERIVE A VARIABLE VALUE FROM ANOTHER VARIABLE 14. 16. 15. The second column shows the accumulated value from the beginning of the year. Ó2001 SAP AMERICA. Your Query should look like this now.

L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.200001 L_S_RANGE-LOW+4(2) = '01'. L_S_RANGE-OPT = 'BT'.HOW TO … DERIVE A VARIABLE VALUE FROM ANOTHER VARIABLE 4 Appendix *----------------------------------------------------------------------* * INCLUDE ZXRSRU01 * *----------------------------------------------------------------------* DATA: L_S_RANGE TYPE RSR_S_RANGESID. EXIT. "high value = input L_S_RANGE-SIGN = 'I'. ENDCASE. L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4). e. APPEND L_S_RANGE TO E_T_RANGE. WHEN 'CUMMONTH'. CLEAR L_S_RANGE. "after the popup LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'MONTH'. IF I_STEP = 2.g. INC. DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT. ENDLOOP."low value. ENDIF. Ó2001 SAP AMERICA. AND SAP AG 8 . CASE I_VNAM.

Sign up to vote on this title
UsefulNot useful