0% found this document useful (0 votes)
189 views

Virtual Characteristics Enhancement

Virtual Characteristics Enhancement
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
189 views

Virtual Characteristics Enhancement

Virtual Characteristics Enhancement
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

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.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 1

SAP BW - Virtual Characteristic Exit (RSR00002)

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

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2

SAP BW - Virtual Characteristic Exit (RSR00002)

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):

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 3

SAP BW - Virtual Characteristic Exit (RSR00002)

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)

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 4

SAP BW - Virtual Characteristic Exit (RSR00002)

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>.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 5

SAP BW - Virtual Characteristic Exit (RSR00002)

FIELD-SYMBOLS FIELD-SYMBOLS FIELD-SYMBOLS FIELD-SYMBOLS FIELD-SYMBOLS FIELD-SYMBOLS

<L_0S_ORD_ITEM>. <L_0KNART>. <L_0KNCOUNTER>. <L_0MATERIAL>. <L_0KPRICE>. <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' 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.

, then exch rate EQ 10.

, then exch rate EQ 20.

, then exch rate EQ 20.

, then exch rate EQ 20.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 6

SAP BW - Virtual Characteristic Exit (RSR00002)

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

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 7

SAP BW - Virtual Characteristic Exit (RSR00002)

Related Content
For More information, visit the EDW Homepage .

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 8

SAP BW - Virtual Characteristic Exit (RSR00002)

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 conte nt of this document.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 9

You might also like