Flat File Extraction of Master and Transaction data using same source file
Introduction
Many a times we face a requirement, wherein we get one comprehensive source file having both the Master and Transaction data and we have to use the same to extract and update the Master and Transaction data to the relevant info providers correspondingly. Usually, we get separate source files for Master and Transaction data.
Let’s understand this with the help of some practical examples:
Source File Structure:
Long Description | Type | Length |
Incident Ticket Number | Char | 15 |
Description of Ticket | Char | 60 |
Area | Char | 3 |
Sub Area | Char | 4 |
Assignment Group | Char | 5 |
Ticket Count | Integer | 10 |
Resolution Time Met | Integer | 10 |
Resolution Time Not Met | Integer | 10 |
Resolution Time | Quantity | 10 |
Total Ticket Time | Quantity | 10 |
The various fields along with their data types and length are defined.
The above consists of both Master and Transaction data information.
BW Definitions:
In order to get the data from the above source file we have to create info objects of type Characteristics and Key Figures in BW.
Characteristics: We need to define characteristics for Incident Ticket Number, Description of Ticket, Area, Sub Area, and Assignment Group. In our example we will have Area, Sub Area and Assignment group as attribute of Incident Ticket Number.
Key Figures: Similarly we need to define Key Figures for Ticket Count, Resolution Time Met, Resolution Time Not Met, Resolution Time and Total Ticket Time.
Note: Take into consideration the various data types for the same for various definitions as above.
BW Extraction Logic:
Now we have 1 Flat File that consists of both Master and Transaction data.
Master and Transaction Objects would be having the different structures so we have to create 3 data sources i.e. 2 for Master (Attribute and Text) and 1 for Transaction Data. All 3 data source shall be using the same source file to extract the data.
Note: Source and Target structures are not same but even then we can take care of this in data source definition so that data gets updated correctly.
1. Data source definition for Transaction data source
(I) General Info – Provide the Short, Medium and Long Description of the data source.
(II) Extraction Tab: Provide the File path from the Application server (AL11).
(iii) Fields Tab: This is the most important in the data source definition.
We need to list out all the fields in the correct sequence as per the source file structure in the Fields Tab.
Now as for the Transaction data we only need to have the following fields:
1. Incident Ticket Number 2. Ticket Count |
3. Resolution Time Met |
4. Resolution Time Not Met |
5. Resolution Time |
6. Total Ticket Time |
So, we need to check the check box for Transfer for only those fields which are required however we are adding all the fields in the same sequence as per source file structure. Here we are making sure that fields get updated correctly as we have different source structure. Transfer checkbox needs to be ticked for only those fields for which data needs to be transferred.
We can use the Preview Tab to read preview data and check whether it is getting populated correctly or not.
2. Data source definition for Attribute Data source :
Similarly we can define the Attribute data source as well. The Field Tab Definition would be:
Here, we need to have only first 5 fields of the source file and that too in the same sequence as per the source file definition.
3. Data source definition for Text Data source
The Field Definition of Text Data source would be as:
In this way we can load data from 3 different data sources having different target structure based upon the same source file having both Master and Transaction data.