Data Source Enhancement Using User Exit

Applies to:
Any SAP system from which data needs to be pulled into SAP BI system.

Summary
This document describes how to enhance a data source in the source system so that the fields enhanced can be mapped to the info-objects in the BI system and the required data can be extracted & loaded to the data targets. Author: R. Prem Kumar

Company: SAP Created on: 23 May 2009

Author Bio
The author works for SAP. His expertise includes SAP BI and ABAP

SAP COMMUNITY NETWORK © 2009 SAP AG

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

...............................................Data Source Enhancement Using User Exit Table of Contents Introduction ...............................sap....................................................................................................3 Graphical view .................boc.................................................sap................................................sdn.............................................................8 Copyright........................................................bpx.3 Source System...............................................com | BOC ...........................................................................................com 2 .......................9 SAP COMMUNITY NETWORK © 2009 SAP AG SDN ..............................3 Result.......................................................................................................3 Goal .............................................................com | BPX .........................sap.................................................................................................................................................................

boc.Data Source Enhancement Using User Exit Introduction To describe the process followed to enhance a datasource using user-exits which involves a significant amount of ABAP coding Goal This document describes how to enhance a data source in the source system so that the fields enhanced can be mapped to the info-objects in the BI system and the required data can be extracted & loaded to the data targets.com | BPX .com | BOC . Graphical view Source System In this document we shall consider SAP CRM system as the source system Data Source The data source 0CRM_COMPLAINTS_I would be used as an example in this document This data source can be seen using the t-code rsa5 ( after activation it can be seen in rsa6 as well) This data source is used to fetch the complaints data (see transaction crmd_order) Extract Structure The associated extract structure is CRMT_BW_COMPLAINTS_I This structure can also be seen in the system using the transaction se11 SAP COMMUNITY NETWORK © 2009 SAP AG SDN .sap.sap.sap.sdn.bpx.com 3 .

sap.sap.bpx.sdn.Data Source Enhancement Using User Exit Using the button Append structure the custom fields can be appended to the structure Save and Activate the structure FUNCTION ENHANCEMENT In the transaction rsa6 highlight the required data source and click on Function Enhancement SAP COMMUNITY NETWORK © 2009 SAP AG SDN .boc.sap.com 4 .com | BPX .com | BOC .

Data Source Enhancement Using User Exit The above action would result in the execution of the CMOD transaction Create a project in order to make the enhancement assignment.bpx.sap.sap.boc.com | BPX .sdn.sap.com | BOC . In this example a project by the name ZCRWTY is created Assign the enhancement RSAP0001 & click on Components Choose the function exit EXIT_SAPLRSAP_001 SAP COMMUNITY NETWORK © 2009 SAP AG SDN .com 5 .

sap.boc.sdn.com 6 .bpx. name of the data source) The tables parameter C_T_DATA holds the values of the datasource whose structure is same as the data source structure Using the ABAP statements CASE. In the above function module (exit) the import parameter I_DATASOURCE holds the data source (i.Data Source Enhancement Using User Exit Activate the Project. to open the editor where the required coding can be done.sap. alternatively once the project is activated with the required function exit. Double click on the function exit EXIT_SAPLRSAP_001.com | BPX .com | BOC . ENDCASE & WHEN the code for the desired datasource can be executed SAP COMMUNITY NETWORK © 2009 SAP AG SDN .sap.e. Double click on the include ZXRSAU01. this will open the function module Please note that. this can also be displayed in the t-code for Function modules se37.

IF L_S_INFOSTRU-ITEM_GUID = ''.sdn. SAP COMMUNITY NETWORK © 2009 SAP AG SDN . ………………………. L_STAT = L_S_INFOSTRU-BWSTZCRZHED. CASE I_DATASOURCE.sap.Data Source Enhancement Using User Exit See below the example code : DATA: L_S_INFOSTRU LIKE CRMT_BW_COMPLAINTS_I. ……………………….com | BPX . ………………………. WHEN 'DATASOURCE1’ WHEN 'DATASOURCE2’ ENDCASE. ……………………….sap.com 7 . ……………………….boc. WHEN '0CRM_COMPLAINTS_I'.bpx. L_TABIX = SY-TABIX. ………………………. CLEAR L_STAT.sap. LOOP AT C_T_DATA INTO L_S_INFOSTRU. ………………………. ENDIF.com | BOC . ………………………. ……………………….

Data Source Enhancement Using User Exit Result When the data source is executed the user exit (enhancement) is triggered and the code written within the exit gets processed and this would fetch the desired data and would update the data source.boc.sap. This enhanced data source can be replicated in the BI system and further processing can be carried out SAP COMMUNITY NETWORK © 2009 SAP AG SDN .com | BPX .com 8 .com | BOC .sap.sdn.sap.bpx.

in the United States and in other countries. without representation or warranty of any kind. SAP COMMUNITY NETWORK © 2009 SAP AG SDN . AS/400. and MultiWin are trademarks or registered trademarks of Citrix Systems. and other countries. System p5. MVS/ESA. OS/2.Data Source Enhancement Using User Exit Copyright © Copyright 2009 SAP AG. Nothing herein should be construed as constituting an additional warranty. System x. and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S. Microsoft. Parallel Sysplex. Duet. eServer. All other product and service names mentioned are the trademarks of their respective companies. Windows.. All rights reserved. POWER6+.sap.sap. POWER5. X/Open. Citrix. z/VM. Inc. xSeries. ByDesign. Oracle is a registered trademark of Oracle Corporation. System i5. OS/400. HACMP. z10. System p. VideoFrame. Program Neighborhood. and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. PowerPC. zSeries. i5/OS.com 9 . XHTML and W3C are trademarks or registered trademarks of W3C®. Java is a registered trademark of Sun Microsystems. RETAIN. and PowerPoint are registered trademarks of Microsoft Corporation. Xcelsius. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only. z/OS. POWER5+. IBM. and SAP Group shall not be liable for errors or omissions with respect to the materials. Outlook. if any. OpenPower. DB2 Connect.S. HTML. S/390 Parallel Enterprise Server. Power Architecture. Web Intelligence. BladeCenter. PostScript. Business Objects is an SAP company.com | BPX . PowerVM. Intelligent Miner. DB2. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. OSF/1. JavaScript is a registered trademark of Sun Microsystems.sap. Adobe. AIX. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. These materials are subject to change without notice. R/3.sdn. XML. BatchPipes. World Wide Web Consortium. Acrobat. OS/390. UNIX. iSeries. MetaFrame.bpx. ICA. DB2 Universal Database. Inc. and Motif are registered trademarks of the Open Group. GPFS. pSeries. Linux is the registered trademark of Linus Torvalds in the U. System z. National product specifications may vary. the Adobe logo. SAP Business ByDesign. System z10. WinFrame. SAP NetWeaver. Crystal Decisions. Netfinity. Inc. Massachusetts Institute of Technology. BusinessObjects.boc. used under license for technology invented and implemented by Netscape. POWER. POWER6. Redbooks. Data contained in this document serves informational purposes only. SAP. RACF. The information contained herein may be changed without prior notice.A.com | BOC . S/390. 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. WebSphere. 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. Business Objects and the Business Objects logo. Crystal Reports. Excel. System z9. System Storage. z9. PartnerEdge. Tivoli and Informix are trademarks or registered trademarks of IBM Corporation. System i.

Sign up to vote on this title
UsefulNot useful