SAP BW - Virtual Characteristic Exit (RSR00002) Applies to: Applies to SAP BI 7.0 Consultants who are accustomed with SAP ABAP Skills. For more information, visit the EDW Homepage. Summary Document explains to use the Virtual Characteristic Enhancement (RSR00002) - Virtual Characteristics and Key Figures in Reporting. Author: Suraj Tigga Company: Capgemini Consulting India Pvt. Ltd. Created on: 30 July 2010 Author Bio Suraj Tigga is a Senior SAP BI / ABAP consultant at Capgemini Consulting, India. Suraj joined Capgemini Consulting in 2008 and has worked on multiple SAP BI implementation and support projects. 2010 SAP AG 1
Table of Contents Scenario... 3 Step-by-Step Solution... 3 Project-CMOD... 3 Enhancement (RSR00002)... 3 Execution... 7 Related Content... 8 Disclaimer and Liability Notice... 9 2010 SAP AG 2
Scenario Calculate the 0EXCHG_RATE (Exchange rate of pricing) for each material whose values are not loaded in BW and their values are based on different values of 0KNART (Condition type). Step-by-Step Solution Above requirement would be implemented using the concept of Virtual Characteristic. Complete scenario is explained in three steps: Project-CMOD Create a project for enhancement RSR00002 Enhancement (RSR00002) Details about the function modules involved. Execution Execute the BEx report. Project-CMOD Query Design: Query is built on DSO (0SD_O05): Order: Condition Data Virtual Key Figure: 0EXCHG_RATE Assign the Enhancement RSR00002 to Project TABW2001 Enhancement (RSR00002) Query is built on DSO (0SD_O05): Order: Condition Data Enhancement includes three Includes (Under Function Group: XRSR): 2010 SAP AG 3
ZXRSRTOP (Declaration of Variables) ZXRSRU02 (Populate the internal tables for Characteristic and Key Figures) ZXRSRZZZ(Logic to populate the value for Virtual Characteristic or Key Figure) Include (ZXRSRTOP) Variable declaration should always prefixed with G_POS_(Infoprovider Name)_(Infoobject). For the above scenario, variables are declared for the following: 0MATERIAL (Material) 0DOC_NUMBER (Sales document) 0S_ORD_ITEM (Sales document item) 0KNART (Condition type) 0KNCOUNTER (Condition Counter) 0KPRICE (Condition Rate) 0EXCHG_RATE (Exchange rate for pricing) Include (ZXRSRU02) 2010 SAP AG 4
a) Populate the internal table e_t_kyfnm for Key Figures. b) Populate the internal table e_t_chanm for Characteristic. Include (ZXRSRZZZ) FORM USER_0SD_O05 USING I_S_RKB1D TYPE RSR_S_RKB1D CHANGING C_S_DATA TYPE ANY. FIELD-SYMBOLS <L_0CALMONTH>. FIELD-SYMBOLS <L_0DOC_NUMBER>. 2010 SAP AG 5
FIELD-SYMBOLS <L_0S_ORD_ITEM>. FIELD-SYMBOLS <L_0KNART>. FIELD-SYMBOLS <L_0KNCOUNTER>. FIELD-SYMBOLS <L_0MATERIAL>. FIELD-SYMBOLS <L_0KPRICE>. FIELD-SYMBOLS <L_0EXCHG_RATE>. ASSIGN COMPONENT G_POS_0SD_O05_0CALMONTH of STRUCTURE C_S_DATA TO <L_0CALMONTH>. ASSIGN COMPONENT G_POS_0SD_O05_0DOC_NUMBER of STRUCTURE C_S_DATA TO <L_0DOC_NUMBER>. ASSIGN COMPONENT G_POS_0SD_O05_0S_ORD_ITEM of STRUCTURE C_S_DATA TO <L_0S_ORD_ITEM>. ASSIGN COMPONENT G_POS_0SD_O05_0MATERIAL of STRUCTURE C_S_DATA TO <L_0MATERIAL>. ASSIGN COMPONENT G_POS_0SD_O05_0KNCOUNTER of STRUCTURE C_S_DATA TO <L_0KNCOUNTER>. ASSIGN COMPONENT G_POS_0SD_O05_0KNART of STRUCTURE C_S_DATA TO <L_0KNART>. ASSIGN COMPONENT G_POS_0SD_O05_0KPRICE of STRUCTURE C_S_DATA TO <L_0KPRICE>. ASSIGN COMPONENT G_POS_0SD_O05_0EXCHG_RATE of STRUCTURE C_S_DATA TO <L_0EXCHG_RATE>. CASE <L_0KNART>. * IF condition Type EQ 'MWST', then exch rate EQ 10. WHEN 'MWST'. <L_0EXCHG_RATE> = '10'. WHEN 'PR00'. * IF condition Type EQ 'PR00', then exch rate EQ 20. <L_0EXCHG_RATE> = '20'. WHEN 'SKTO'. * IF condition Type EQ 'SKTO', then exch rate EQ 20. <L_0EXCHG_RATE> = '30'. WHEN 'VPRS'. * IF condition Type EQ 'SKTO', then exch rate EQ 20. <L_0EXCHG_RATE> = '40'. WHEN OTHERS. <L_0EXCHG_RATE> = '50'. ENDCASE. ENDFORM. 2010 SAP AG 6
Execution Query Design: Go to transaction RSRT and execute the query ZSD_O05_QUERY. As per our Code Logic, Exchange Rate values would be dependent on Condition Type Values: IF Condition Type EQ MSWT, Then Exchange Rate EQ 10. IF Condition Type EQ PR00, Then Exchange Rate EQ 20. IF Condition Type EQ SKTO, Then Exchange Rate EQ 30. IF Condition Type EQ VPRS, Then Exchange Rate EQ 40. For Other Condition Type, Then Exchange Rate EQ 30. Transaction RSRT Selection Screen Execute the report (DEBUG) Check the values of Exchange Rate: Report Output 2010 SAP AG 7
Related Content For More information, visit the EDW Homepage. 2010 SAP AG 8
Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this do cument, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document. 2010 SAP AG 9