Implementing BAdI Transformations in Open Hub InfoSpoke

12
Implementing BAdI Transformations in Open Hub InfoSpoke Applies to: SAP Business Information Warehouse 3.x, SAP NetWeaver Business Intelligence 7.0 all support packs For more information, visit the Business Intelligence homepage . Summary This document describes how to use the functionality of BAdI Transformations in Open Hub InfoSpoke. Using BAdI Transformation how to distribute data from multiple Data Targets to an external system. Author: Ramakrishna Kamurthy Company: SITA CORP India Pvt. Ltd. Created on: 16 February 2009 Author Bio Ramakrishna Kamurthy is working in SITA CORP India Pvt. Ltd., as SAP BI Conslutant having more than 3 years of SAP BW/BI experience. He is having more than a year experience on SAP BI Data Archiving. SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 1

Transcript of Implementing BAdI Transformations in Open Hub InfoSpoke

Page 1: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

Applies to: SAP Business Information Warehouse 3.x, SAP NetWeaver Business Intelligence 7.0 all support packs

For more information, visit the Business Intelligence homepage.

Summary This document describes how to use the functionality of BAdI Transformations in Open Hub InfoSpoke. Using BAdI Transformation how to distribute data from multiple Data Targets to an external system.

Author: Ramakrishna Kamurthy

Company: SITA CORP India Pvt. Ltd.

Created on: 16 February 2009

Author Bio Ramakrishna Kamurthy is working in SITA CORP India Pvt. Ltd., as SAP BI Conslutant having more than 3 years of SAP BW/BI experience. He is having more than a year experience on SAP BI Data Archiving.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 1

Page 2: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

Table of Contents Scenario..............................................................................................................................................................3

Open Hub Service...........................................................................................................................................3 InfoSpoke with BAdI Transformations..........................................................................................................................3 Prerequisites ................................................................................................................................................................3 Procedure ....................................................................................................................................................................4

Step by Step Solution .........................................................................................................................................4 Logic ...................................................................................................................................................................8 Related Content................................................................................................................................................11 Disclaimer and Liability Notice..........................................................................................................................12

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 2

Page 3: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

Scenario Distributing the data from SAP BW to an external system as a CSV file. Open Hub Service is the SAP delivered tool to distribute the data from SAP to an external system. The scenario here is how to work or use BAdI Transformations in Open Hub InfoSpoke, when the BW Data Target structures are not meeting the external system required structure. Using BAdI Transformations, system allows enhancing the target structure of InfoSpoke as per the requirement.

Open Hub Service

The open hub service enables you to distribute data from an SAP BW system into external data marts, analytical applications, and other applications. With this, you can ensure controlled distribution using several systems. The central object for the export of data is the InfoSpoke. Using this, you can define the object from which the data comes and into which target it is transferred.

InfoSpoke with BAdI Transformations

You have the option of transforming the data to be transferred using a Business Add-In (BAdI). The original structure for transfer is thereby the InfoObject list.

Prerequisites

For the Transformation tab page, set the indicator for InfoSpoke with Transformation Using BAdI so that the InfoSpoke is activated first. Then you arrive in the BAdI builder.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 3

Page 4: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

Procedure

Create your implementation for a BAdI called OPENHUB_TRANSFORM

In the BAdI Builder, provide the short text for the Implementation. The Implementation name is always the same as the technical name of the InfoSpoke

The Implementation of this BAdI is always filter-dependent. Enter your InfoSpoke name as the filter element. You can have only one implementation for each InfoSpoke

Activate the class

Maintain your code in Method of a class

Activate your method, return to your BAdI, return to your InfoSpoke

Step by Step Solution 1. Allow InfoSpoke to execute a transformation step between extracting the data and transfer it into an

open hub destination. Go to transaction RSBO, provide InfoSpoke name, go to transformation tab, and select the check box – InfoSpoke with Transform. Using BAdI

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 4

Page 5: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

2. In the next screen, system asks for the confirmation to generate the necessary / required objects for transformation. Select Yes.

3. It moves automatically to BAdI Builder – Implementation administration screen to maintain the implementation. Provide the Short Text for the Implementation.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 5

Page 6: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

4. Add defined filters in the same screen of Implementation maintenance. Select the InfoSpoke for which the BAdI Transformation is to be implementing.

5. Select the Implementation Type in the Interface Tab. Select ABAP Code, activate the Implementation.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 6

Page 7: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

6. Once the implementation activated successfully, it moves to the InfoSpoke maintenance screen, system automatically generates the target structure and Addin Implementation

The following are the objects that system generated when the check box InfoSpoke with Transformation using BAdI is checked.

Implementation Name : Z<InfoSpoke Name>

: ZZIS_003

Defination Name : OPENHUB_TRANSFORM

Interface Name : IF_EX_OPENHUB_TRANSFORM

Implementing Class : ZCL_IM_<InfoSpoke Name>

: ZCL_IM_ZIS_003

Method : TRANSFORM

Source Structure* : /BIC/CY<InfoSpoke Name>

: /BIC/CYZIS_003

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 7

Page 8: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

Logic Here in this example, data is distributing from the InfoCube ZIS_003 which maintains the information of the Customers Sales details and materials. But the external source system requires material manufacturer details along with this information. The manufacturer details are available in 0material InfoObject. So, using BAdI Transformation providing the required solution.

Source Structure in the InfoSpoke maintains the same structure of InfoCube ZIS_003, Target Structure is generated by enabling the BAdI Transformation check box. In order to distribute the required information as per the external system, Target Structure is to be enhanced with Manufacturer InfoObject, and need to write ABAP code to populate the data to the appended InfoObject.

1. Add the required field in the Target Structure of the InfoSpoke. Go to SE11, provide the Target Structure name ie, /BIC/CZZIS_003 and select change or double click on Target Structure in InfoSpoke maintenance. Add component Manufacturer of component type /BI0/0MANUFACTOR, then activate.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 8

Page 9: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

2. Write ABAP code to populate the data to the appended field in the target structure. Go to SE19, provide the Implementation name ZZIS_003 and go with change or double click on the implementation name in the InfoSpoke screen, select the interface tab, double click on method TRANSFORM. It takes to the ABAP editor to write the code.

The code shown here populates the data to MANUFACTOR field in the Target Structure /BIC/CZIS_003 form the InfoObject 0MANUFACTOR.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 9

Page 10: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

3. Save the Class, return to the InfoSpoke maintenance screen and activate. Schedule the InfoSpoke, it generates two excel files ie, one for schema and one for data, observe both the files, the schema file contains the appended field and the data file contains the appended field with data.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 10

Page 11: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

Related Content http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/c5/03853c01c89d7ce10000000a11405a/content.htm

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 11

Page 12: Implementing BAdI Transformations in Open Hub InfoSpoke

Implementing BAdI Transformations in Open Hub InfoSpoke

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 12

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