This chapter describes how to create a package for delta extraction.
So far we have seen examples of extracting data from BW data targets. The instructions in this chapter explain how the interfaces introduced in the previous chapters can be turned into delta extraction interfaces.
In delta extraction interfaces only the data, which was changed after last extraction, is extracted. Delta extraction interfaces are only supported for InfoCubes, ODS/DSO and Open Hub objects, but not for InfoObjects.
This chapter includes the following topics:
The first step is to modify the interface:
Select the desired Interfaces.
Double click the interface.
Select the Flow tab.
Click the ODI source set.
Set KM option values for FIRST_REQ_ID and LAST_REQ_ID KM as shown below.
Click OK to save and close your interface.
The second step consists of creating an ODI variable that stores the last extracted request ID. This request ID serves as the starting point for the next extraction run:
Create a MIN_REQUEST_ID variable to hold the last request id. The MIN_REQUEST_ID variable has to be a numeric variable with a Historize
or Last-value
Action as shown below.
The value of this variable is updated at the end of the delta extraction package described in the third step. It happens once delta extraction is finished and the MAX REQUEST ID will be fetched from SAP BW system and will be stored into the ODI Variable (MIN_REQUEST_ID). The refresh expression shown here is used to update the variable:
In the third step the building blocks created in the previous steps are put together: Variable and Interfaces are arranged into a Package:
Open the SAP Demo
Project.
Create a new Package named SAP Demo
.
Insert a Declare Variable step to this Package:
Drag and Drop the MIN_REQUEST_ID
variable and select the "Declare Variable" step type.
Insert a Flow step to this Package:
Drag and drop the Interface created in the previous sections for InfoCube/ ODS or OpenHub-Extraction in the Package.
Insert a Refresh Variable step to this Package.
Drag and Drop the MIN_REQUEST_ID
variable and select the "Refresh Variable" step type.
Definine the step sequence.
Define the Refresh Variable step as the First Step.
Link it to the Flow step that is the next step upon success.
Link the the Flow step to the Refresh Variable step that is the next step upon success and the last step in the Package. Add arrows between the variables.
Your Package should look as shown on this screenshot.
To run the integration Package:
In the Projects tree view, expand the SAP Demo
Project.
Select the SAP Demo
Package.
Right-click and select Execute.
In the Execution window, click OK.
In the Session Started window, click OK.
What happens when you execute the delta extraction Package?
First, Oracle Data Integrator initializes the variable MIN_REQUEST_ID with the last historized value (declare variable step). This value is then passed into ABAP extraction program to specify where to start the data extraction. The KM queries the SAP system for the highest assigned request ID. All data between min and max request ID will be extracted (interface).
After the execution of the interface the refresh variable step stores the highest request ID into MIN_REQUEST_ID for next extraction run.