Data Source View
Data Source View
Applies to:
SAP Business Intelligence (BI 7.0). For more information, visit the EDW homepage
Summary
This article describes first how to create a view on two or more tables. Then how to load data through generic datasource based on that view. Here I have used BI tables and datasource created on BI server. But the same procedure we can follow if we need to load data from R/3. Author: Indrashis Bose
th
Company: Accenture Services Pvt Ltd (Mumbai/India) Created on: 11 September, 2011
Author Bio
Indrashis Bose is a SAP BI consultant currently working with Accenture Services Pvt Ltd in Mumbai, India. He is working in SAP BI for the last 1+ year and he has experiences in development/support activities. He is presently working in a support project and enriching his experiences in variouis support related issues.
How to Create View on Different Tables and Load Data through Generic Datasource based on that View
Table of Contents:
Scenario: ............................................................................................................................................................. 3 Creating view on two tables: ............................................................................................................................... 4 Creating Generic Datasource based on view: .................................................................................................... 5 Replicating datasource in BI: .............................................................................................................................. 7 Creating Infopackage and Loading data: ............................................................................................................ 8 Related Contents .............................................................................................................................................. 10 Disclaimer and Liability Notice .......................................................................................................................... 11
How to Create View on Different Tables and Load Data through Generic Datasource based on that View
Scenario:
In SAP BI, data are stored in many tables. Some time it may be required that we need to load data combining two or more tables i.e. taking different fields from different tables based on a condition. Then it is very useful to create a view on those tables and loading data through a generic datasource on that view. We may need to load data from R/3 tables to BW system or may be from BW tables. Here I have explained using BW tables. But the same procedure should be followed in case source is R/3 system. We need to create view and datasource in R/3 system. Then we need to replicate that datasource in BI system. We have two employee tables Employee table 1 (ZTABLE1_EMP) and Employee table 2 (ZTABLE2_EMP). Table 1 contains Employee No, Employee Address, Employee Phone and Employee Name.
Now we have a requirement that we need to load Employee No, Employee Name and Employee Email. First two fields come from table 1 and the third from table 2. So here we will create a view on these two tables and then we will create a generic datasource on that view to load data. Lets us go step by step to load the data,
How to Create View on Different Tables and Load Data through Generic Datasource based on that View
Then a pop up window will come. Select Database view and click on copy.
Then in the next screen give description as Employee view. Then give the tables name that we are using ZTABLE1_EMP & ZTABLE2_EMP. Then give the join condition that we are using i.e. Employee No of table 1 is equal to Employee Nop of table 2.
How to Create View on Different Tables and Load Data through Generic Datasource based on that View
Then go to View Fields tab. There give the different fields that we want to see from different tables. The left column is for field description in view. The middle column contains table name and the right column contains the respective field of that table. Here we want to see 3 fields - Employee No and Employee Name from table 1 and Employee Email from table 2. And then activate the view.
Then again go to se11 and select view. There give the view name as ZVIEW_EMP and click on display. There check the contents of the view and see whether the records are coming properly.
Now we can say that our creation of view is complete. Now we have to make the data source on this view.
How to Create View on Different Tables and Load Data through Generic Datasource based on that View
Then in the next screen, give application component as BW. Give the datasource description. As we are extracting from Database View, so give the view name in the specified area. Then click on save.
Then a new window will open. You can see the extract structure there. Check all the three fields that we want to see. Then again click on save.
Then you will again go to the first screen> Just click on save and your datasource will be saved.
Now datasource is created but we need to replicate the datasource. Now we need to check whether our datasource is ready to be replicated. For that go to tcode RSA6. There under BW node, check whether you can see your datasource.
How to Create View on Different Tables and Load Data through Generic Datasource based on that View
Then in the next screen, right click on BW datasources at the top and click on replicate metadata.
Then you will get a pop up that ZDATAS_EMP does not exist in BI and will create the datasource in BI. Choose RSDS as type of the datasource.
It may take some time to replicate the datasource. After replication is complete you can see your datasource under BW datasources. This means datasource is ready. Now we just need to create infopackage to load data to PSA.
Remember one thing We need to follow exact same procedure if we need to load data from R/3. We will follow every step before replicating the datasource in R/3 system i.e. we will create view and the datasource in R/3 system. Then in BI system we will replicate the datasource. Then we just need to choose source system as R/3 instead of BI.
How to Create View on Different Tables and Load Data through Generic Datasource based on that View
How to Create View on Different Tables and Load Data through Generic Datasource based on that View
Now loading upto PSA is complete using generic datasource. Now you can easily create transformation / DTP and load data to any infoprovider from the datasource.
How to Create View on Different Tables and Load Data through Generic Datasource based on that View
Related Contents
Database Views Generic Extraction using function module Maintaining Generic datasources
How to Create View on Different Tables and Load Data through Generic Datasource based on that View