Escolar Documentos
Profissional Documentos
Cultura Documentos
Applies to:
NetWeaver SAP BW 7.0. For more information, visit the EDW homepage.
Summary
There are occasions when we need to send data to 3 party systems such as Teradata or Datastage from SAP BW system. To achieve this, SAP has provided Open Hubs wherein we can define the containers to store data, i.e., either rd a flat file or a database table, and facilitate the extraction of data to 3 party systems through these systems. In addition to this, certain requirements mandate sending status details along with the actual data to 3 party systems. One such scenario is described here along with the solution devised. Author: Debanshu Mukherjee
rd rd
Author Bio
Debanshu Mukherjee is working as Lead SAP BW Consultant with IBM India Pvt Ltd. and (c) He has around 6 yrs of rich experience in BW implementation, development and rollout projects.
Table of Contents
Introduction ......................................................................................................................................................... 3 Requirement: ...................................................................................................................................................... 3 Solution: .............................................................................................................................................................. 4 Step by Step Solution: ........................................................................................................................................ 4 Step 1: Create Z info-objects for direct update DSO. ..................................................................................... 4 Step 2: Create a direct update DSO which will act as the target for APD. ..................................................... 6 Step 3: Create APD......................................................................................................................................... 6 Step 4: Create an OHD for storing data for the latest DTP run. ................................................................... 10 Step 5: Create the Transformation and DTP from the Direct Update DSO to the Status OHD. ................... 10 Step 6: Test by Executing the APD and Checking Data. .............................................................................. 11 Related Content ................................................................................................................................................ 15 Disclaimer and Liability Notice .......................................................................................................................... 16
Introduction
There are occasions when we need to send data to 3 party systems such as Teradata or Datastage from SAP BW system. To achieve this, SAP has provided Open Hubs wherein we can define the container to store data, i.e., either rd a flat file or a database table, store data in these containers and facilitate the extraction of data to 3 party systems through these systems. In addition to this, certain requirements mandate sending status details to 3 party systems along with the actual data. One such scenario is described here along with the solution devised:
rd rd
Requirement:
Facilitating the status details for the latest load into the Master data Open Hub for Profit Center. In other words, we have an Open Hub defined, ZPFT_CTR, to send the profit center master data from SAP rd BW to 3 party.
Now 3 party also requires SAP BW to send the latest load details such as: 1. Request ID for the latest DTP run which extracts data from SAP BW target and stores it into the Open Hub. 2. The no of records extracted with the latest run. 3. Calday 4. OHD Name
rd
Solution:
To cater to the above requirement, we can use a combination of APD and Open Hub. APD: The Analysis Process Designer is a graphical tool for modeling multilevel "Analyses Processes". It is an interactive modeling (drag & drop) workbench for multilevel Data Analysis Processes APDs empower us to do the following: 1. Creation of new information out of existing data 2. Transformation of data 3. Writing back new data to BW database or operational system (CRM) With APDs Different kinds of sources allow the possibility of ad-hoc analyses. We are going to leverage this feature by taking a standard SAP table as a source and storing the data in a DSO. APD: This APD will take the standard SAP view for DTP, RSBKREQUEST_V, as source and store data in a direct update DSO (APDs only support direct update DSO) or Flat file.
Note: We could also use table RSBKREQUEST for DTP details but not all fields in this table are linked to data elements which is a mandate for using this as a source in APD.
Thereafter we can send data from the direct update DSO or flat file to another Open Hub which will store the rd status information for the 3 party. Therefore in essence, we need to create the following objects in BW: 1. Z info-objects for direct update DSO. 2. Direct update DSO 3. APD 4. Open Hub for status details
b) ZOHDNAME This will store the OHD name. Data Type NUMC Length 45 (The length of target object in RSBKREQUEST_V view is 45)
c) ZOHRCDTRS This will store no of records transferred to OHD Aggregation will be default (Summation)
Step 2: Create a direct update DSO which will act as the target for APD. We need to create a direct update DSO with the Z info-objects created. DSO: ZPFCT3PR Key field: ZDTPREQID (As this would be unique with every load) Data fields: ZOHDNAME, 0CALDAY, ZOHRCDTRS
Step 3: Create APD. Now we will create an APD which will take the data from the view RSBKREQUEST_V and store in the direct update DSO ZPFCT3PR Tcode: RSANWB 1. Create an new APD under the Generic folder:
2. We will drag and drop the Read Data from Database table icon to the right panel.
4. Now we need to inform the APD as to which DTP requests it has to pick. For that we need to drag a filter, connect it with the DTP View RSBKREQUEST_V and provide details (right click -> properties)
While providing details for this filter, we need to transfer the field, TGT Name of data target for DTP, from the list of fields to the selection and provide value as ZPFT_CTR.
Actually what this is doing is that it is selecting only those records from the RSBKREQUEST_V view where the target is the profit center open hub. In essence the DTP which is feeding the Open Hub for actual profit center master data.
5. Now we need to select the latest run details for the DTP. To achieve this we will be sorting the data which is picked after the filter restriction: For that we need to drag the sort data icon, connect it with the OHD Name filter and provide details (right click -> properties)
While providing details for this sort, we need to transfer the field, REQUID Request ID for DTP, from the list of fields to the selection and check the box for the descending option.
This will bring the latest DTP run record on the top. 6. Now we need to write drag the ABAP Routine icon, connect it with the sort and write a small routine which will extract only the top row from the table.
Before providing the details for the routing, drag the DSO icon, provide details and connect it with the routine, this will ensure that both source and target structure for the routine are connected to it.
Here are the routine properties: Source Fields: REQUID, TGT, LINESTRANSFERRED, TSTMP_FINISH Target Info-objects (Direct update DSO Info-objects): ZDTPREQID, ZOHDNAME, ZOHRCDTRS, 0CALDAY
ABAP Code: Please see the ABAP code at the end. 7. Now assign the target info-objects to the source fields in the transformations from routine to the DSO
8. Now the APD is ready to be activated. Save and Activate the APD: While saving please provide the technical name and description: Tech Name: Z_APD_MSRT_DAYA_3RD_PRTY Description: Profit Center (Attribute) Load details for EDW
Step 4: Create an OHD for storing data for the latest DTP run. This OHD will extract data from the direct update DSO ZPFCT3PR. Select database table as destination type.
Step 5: Create the Transformation and DTP from the Direct Update DSO to the Status OHD.
Step 6: Test by Executing the APD and Checking Data. For this first we will trigger the DTP which loads data from Profit center master data to the Open Hub ZPFT_CTR.
This DTP generated Req ID 111213 No of data transferred = 2462 Day of run - 22.04.2011 Target OHD ZPFT_CTR
Lets trigger the APD and check the data in the OHD
Now execute the DTP from the direct update DSO ZPFCT3PR to the Open Hub ZPFCT3PR
Lets check the data in the OHD table /BIC/OHZPFCT3PR We can see that data is accurately transferred from RSBKREQUEST_V view :
Now 3 party can access these details. These details can be used for reconciliation purposes such as comparing no of records extracted from the main OHD and no of records extracted from this status OHD.
rd
I_TIMESTAMP = v_tim_stamp IMPORTING E_DAT = v_dat. IF sy-subrc = 0. ls_target-TSTMP_FINISH = v_dat. ENDIF. APPEND ls_target TO et_target. clear : ls_source, ls_target. ENDIF. ENDIF. *---------- End of transformation code -----------------------------ENDFORM. ** End of custom code:
Related Content
Analysis Process Designer (Apd) Step By Step - Business Intelligence SAP HELP Analysis Process Designer A Simple Guide to Using Analysis Process Designer Analysis Process Designer (APD): Part - 1 Analysis Process Designer (APD): Part - 2 For more information, visit the EDW homepage.