This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
SAP BW source systems (e.g. ECC and CRM) as of SAP_BASIS 6.20 and PI_BASIS 2004_1. For more information, visit the EDW homepage.
Summary
The following document describes the steps required to achieve BW datasource enhancements in an SAP source system using classes (Object Oriented Programming) instead of the function modules “EXIT_SAPLRSAP_00*” (* = 1 to 4) via transaction “CMOD”. It meets the key requirement of modularization to facilitate the promotion of developments specific to a developer on a project team.
Author: Marvin Perumal
Company: SAP South Africa
Created on: 6 June 2011
Author Bio
Marvin is an SAP Principal BI Solution Consultant with more than 8 years experience in the Mining, Banking, Automotive, Consumer Products, Public Sector, Freight Logistics, Healthcare, Oil and Gas and Chemical industries, assuming responsibilities of team lead, project manager, integration manager and solution architect.
4.1. Create the BADI Implementation with the Decision Method ................................................................. 4
4.2. Create the Datasource-Specific Class ................................................................................................... 6
4.3. Test the Datasource .............................................................................................................................. 8
A.1. Code for “DATA_TRANSFORM” Method in Implementing Class “ZCL_IM_RSU5_SAPI_BADI”........... 9
A.2. Sample Code for “DATA_TRANSFORM” method in datasource-specific class “ZPERSON_ATTR” ..... 9
Related Content ................................................................................................................................................ 11
Execution of all implementations for “multiple use” BADI “RSU5_SAPI_BADI”
Datasource execution
1. Background
To understand the proposed solution, a basic understanding of BADIs and classes is required. Business Add-ins (BADIs) are provided by SAP that may be used to customize the BW extraction from source systems. A Business Add-in needs to be implemented by an Implementation. That implementation is assigned to an Implementing Class. The Implementing Class contains interfaces and methods.
The proposed solution uses the following architecture based on the SAP provided BADI “RSU5_SAPI_BADI” which contains two methods:
DATA_TRANSFORM
HIER_TRANSFORM
The above architecture has the following advantages:
Usage of object oriented programming techniques.
Modularisation of implementation classes per datasource facilitating development promotion (transports).
Execution of a single BADI implementation and only the related datasource-specific class during execution of a datasource.
Creation of a template for future enhancements of datasources.
2. Prerequisites
Developer key on the SAP ECC system that you are extracting data from.
Create an append structure with “ZZ” fields that will be filled by the datasource-specific class implementation.
The BADI-definition RSU5_SAPI_BADI (SE18) exists in your system.
Include LRSAPF06 includes call interfaces of the BADI-methods.
3. Limitations
Creation of the append structure for the datasource that is to be enhanced is not demonstrated – as mentioned in the prerequisites.
Coding logic for the “decision method” in the case of a hierarchy datasource is not provided – this does not differ significantly from the same “decision method” for transaction and master data discussed below (refer to SAP Note 691154).
Steps for linking (e.g. via transformations) the enhanced datasource to objects (e.g. DSOs or InfoCubes) in SAP BW are not explained.
BADI BADI Implementation Implementing Class
How To…Use ABAP Classes Instead of “CMOD” for BW Datasource Enhancements
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
4.1.3. Enter a description for the implementation class and activate
4.1.4. Go to transaction SE80, select your development package and you will find the implementation that you just created under the “Enhancements” folder.
4.1.5. Double click on the implementation “ZRSU5_SAPI_BADI” and select the “Interface” tab. You will find the following two methods listed for interface “IF_EX_RSU5_SAPI_BADI” in the implementing class “ZCL_IM_RSU5_SAPI_BADI”:
DATA_TRANSFORM
HIER_TRANSFORM
How To…Use ABAP Classes Instead of “CMOD” for BW Datasource Enhancements
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
4.1.6. Double click on the “DATA-TRANSFORM” method and click on the icon to go into “Change” mode.
This method will be used as a “decision-method” to identify the correct datasource-specific class to call. Insert the code from Appendix A.1 into the method and activate (method and class).
4.2. Create the Datasource-Specific Class
4.2.6. Next, we will need to create the datasource-specific class. Right-click on the “Classes” folder within your development package and select “Create”
4.2.7. Enter a “Class” name similar to the datasource for which you are creating the class, but replace the first character with a “Z”.
For example, the class that will be created to enhance the datasource 0PERSON_ATTR would be named “ZPERSON_ATTR”.
This naming convention is important as it is the basis for the coding logic in the “decision method” created in
step 4.1.6 above. If you decide to change this naming convention, the coding logic in the “decision method’
must be adjusted accordingly.
Future datasource specific classes can be copied from this initial example and adjusted as required.
How To…Use ABAP Classes Instead of “CMOD” for BW Datasource Enhancements
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
4.2.12. Double click on the “DATA-TRANSFORM” method and click on the icon to go into “Change” mode. This is where the coding logic will defer depending on datasource for which the class has been created.
Appendix A.2 provides sample code that extracts two customized fields (ZZ_INITS and ZZRUFNM) from table PA0002.
N.B. Change the coding logic (and align with the append structure) as required by your datasource enhancement requirement.
4.2.13. Activate method “DATA_TRANSFORM”.
4.2.14. Click on the “Previous Object” button and activate the implementation class “ZPERSON_ATTR”.
4.3. Test the Datasource 4.3.6. You are now ready to test your datasource, enhanced by object oriented programming techniques, in transaction “RSA3”.
How To…Use ABAP Classes Instead of “CMOD” for BW Datasource Enhancements
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries.
Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.
All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.