Virtual Characteristics Enhancement
Virtual Characteristics Enhancement
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.
Table of Contents
Scenario ....................................................................................................................................................... 3 Step-by-Step Solution ................................................................................................................................ 3
Project-CMOD.............................................................................................................................................................. 3 Enhancement (RSR00002) .......................................................................................................................................... 3 Execution ..................................................................................................................................................................... 7
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
Enhancement (RSR00002) Query is built on DSO (0SD_O05): Order: Condition Data Enhancement includes three Includes (Under Function Group: XRSR):
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)
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>.
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' WHEN 'MWST'. <L_0EXCHG_RATE> = '10' . WHEN 'PR00'. * IF condition Type EQ 'PR00' <L_0EXCHG_RATE> = '20' . WHEN 'SKTO'. * IF condition Type EQ 'SKTO' <L_0EXCHG_RATE> = '30'. WHEN 'VPRS'. * IF condition Type EQ 'SKTO' <L_0EXCHG_RATE> = '40' . WHEN OTHERS . <L_0EXCHG_RATE> = '50' . ENDCASE. ENDFORM.
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
Report Output
Related Content
For More information, visit the EDW Homepage .