S07 B4H Datasource Enhancement+-+Part+2
S07 B4H Datasource Enhancement+-+Part+2
Batch_2 Page 1
Q & A Session
Devi Noticed, 2LIS_02_SCN/SGR are still non odp data sources in BW4HANA. If IP is not in functionality, how the delta will be
captured from S4?
How DTP DTIS variates with the old error stack?
how export datasource works in BW4HANA
Shakthi Getting error while trying to get data from Table Function. Attaching the code and error in the "TF Error" tab.
What is Mixed Scenario in SAP BW
How to enable ODP so that we get an entry in ROOSATTR table
Is BADI, the default way to enhance DS in SAP BW on HANA as well?
Any reason for LO extractors alone to have setup table?
Do the delta gets extracted everytime from Set up table? will we be filling setup table everyday to pick the data from source ?
How OpenHub Destinations works
/bic/oh<>
is there any limits for no. of enhancement spots to be created in a BADI?
Batch_2 Page 2
Batch_2 Page 3
Datasource activation process
Batch_2 Page 4
Datasource Enhancement
BADI BADI =
• List of Interfaces (list of empty methods - only definition, no implementation)
Batch_2 Page 5
• List of Interfaces (list of empty methods - only definition, no implementation)
• Class which implements the methods of the Interfaces
▪ List of interfaces
▪ Interface has empty methods
▪ Implementing Class for the Interface will be there.
New Method Enhancing DataSources with BAdI RSU5_SAPI_BADI (Classic BADI).
▪ As of SAP_BASIS 6.20 and PI_BASIS 2004_1 (R/3 Release 4.6C), a new way is available to enhance
a standard datasources which is a more efficient way to enhance SAP standard content, using Business
Add-Ins (BAdIs) rather than user exits.
▪ The technical name of this BAdI is RSU5_SAPI_BADI, detailed on the SAP Note 691154.
▪ Two ways:
○ Each datasource is implemented as a separate BADI implementation and Z Class.
○ Each datasource is implemented as a separate method within the same implementation and class.
▪ Create a template method for the developers to copy from.
▪ Declare the variables
▪ Declare Field Symbol for extract structure
▪ Check if C_T_DATA is not initial.
▪ Get details of datasource (RSA1_SINGLE_OLTPSOURCE_GET)
▪ If no details fetched, then exit.
▪ Create data for extract structure
▪ Get Method Name from datasource.
▪ Remove the first character.
▪ Call the datasource method.
Important variable C_T_DATA: This is where the datasource stores all the extracted data.
to remember I_DATASOURCE: This stores the name of the datasource.
Batch_2 Page 6
ODP & ODQ Framework - Intro
ODP ▪ With SAP BW/4HANA, Operational Data Provisioning (ODP) now becomes the central infrastructure for data extraction and
replication from SAP (ABAP) applications to a SAP BW/4HANA Data Warehouse.
▪ Operational Data Provisioning (ODP) is an SAP Netweaver based Framework that became available from BW 7.40.
▪ For SAP BW it's recommended to use ODP for the implementation of new extraction and replication scenarios
from SAP (ABAP) applications.
Before
After
Batch_2 Page 7
Salient features • Enables “extract once, deploy multiple times” architectures for data sources.
of ODQ For example, BW and BODS can extract from the same delta queue (ODQ) of the extractor.
• Supports real-time (Daemon based - streaming process chains) or regularly scheduled loads.
• Monitoring of the PSA is replaced with that of the ODQ (Transaction code: ODQMON).
• Data cannot be changed in ODQ (a feature that previously did exist with the PSA).
• Two Type of Request –
• A composite request transfers data from one or more queues that have been grouped together into a subscription
• An extraction request transfers queue data from the provider to the queue storage
Subscription
Concept
Batch_2 Page 8
Types of
Subscribers
Batch_2 Page 9
Tables in ODQ The ODQ uses three tables to store data:
1. ODQDATA_C
Contains compressed Init request data
2. ODQDATA
Contains compressed Delta request data
3. ODQDATA_F
Contains Full request data (a.k.a data snapshots)
DTP’s fetch data directly from the ODQ. The first time you run a DTP, the ODQ performs a delta initialisation where a request for the DataSource is generated, and table ODQDATA_C is
filled. In the second run, the ODQ does a delta update with those records that were created or changed (including deletions) since the last load. The delta records are stored in the
ODQDATA table in a compressed format.
Handy Tools
Data Retention ▪ The data in ODQ is retained for reconciliation and recovery.
▪ We can control how long to keep the queue’s data after it has been successfully sent to all targets.
▪ The default is 24 hours for any data in the queue that is flagged as retrieved or as cancelled.
▪ The job to reorganise delta queues is created by default when delta initialisation request is executed from
the subscriber, e.g. BW.
▪ The time and schedule of the job can be changed manually by program ODQ_CLEANUP or by selecting
“Reorganize delta queues” under the Goto menu in transaction ODQMON (Figure 6).
Batch_2 Page 10
There are 3 choices for retention:
This period is given in days. The default is 31 days (4 weeks plus an extra weekend).
Classification of relevance of data.
Data-relevance
▪ Data that has not yet been retrieved and is business critical is never automatically deleted by the reorganization
process.
▪ At present, the system does not make any relevance-related distinction of delta data.
All data in the delta queue is considered business-critical and is therefore not deleted until it has been flagged as either retrieved or invalid.
▪ Because of the particularly high volume expected, data from delta initialization requests and standard requests is also classified as being
of low relevance.
Delta Types Delta Type ‘D’ – The SAP application writes delta records directly into ODQ (PUSH) for ODP extractors
for ODQ with delta type ‘D’. E.g. LO Cockpit Datasource delta.
Delta Type ‘E’ – The ODP data source determines the delta through the extractor on request.
The extractor must be capable of providing the delta records for the DataSource on demand (PULL).
E.g. FI Datasources (0FI_GL_4)
Real-time When we start a process chain in streaming mode, a daemon process is automatically scheduled in the
Daemon in ODQ delta queue (known as the ODQ daemon). If the daemon process is already schedules,
it adds new subscriptions to the process in real-time mode.
Batch_2 Page 11
it adds new subscriptions to the process in real-time mode.
The daemon is automatically removed from scheduling if the last subscription is cancelled, if the
associated connector is not scheduled any more for real-time indexing.
Procedure.
You monitor the daemon process in the delta queue for real-time processing (ODQ daemon) in the
Delta Queue Monitor by choosing
GoTo->Real-Time Daemon .
By pressing
We can call the job overview, where you can call each job's job log.
If you want to schedule the daemon process with settings other than the default settings,
you can enter the Period in Minutes and the Takt Time in Seconds and schedule the process by pressing
Batch_2 Page 12
Important Links
Batch_2 Page 13
Code Blocks
}
DS Specific Zclass class ZCL_IM_ZRSU5_2LIS_11_VAHDR definition
public
final
create public .
public section.
interfaces IF_EX_RSU5_SAPI_BADI .
protected section.
private section.
ENDCLASS.
method IF_EX_RSU5_SAPI_BADI~DATA_TRANSFORM.
endmethod.
method IF_EX_RSU5_SAPI_BADI~HIER_TRANSFORM.
endmethod.
ENDCLASS.
Common ZClass
public section.
Batch_2 Page 14
public section.
interfaces IF_EX_RSU5_SAPI_BADI .
class-methods _DATASOURCE_TEMPLATE
importing
value(I_DATASOURCE) type RSAOT_OLTPSOURCE
value(I_UPDMODE) type SBIWA_S_INTERFACE-UPDMODE
value(I_T_SELECT) type SBIWA_T_SELECT
value(I_T_FIELDS) type SBIWA_T_FIELDS
changing
!C_T_DATA type ANY TABLE
!C_T_MESSAGES type RSU5_T_MESSAGES optional
exceptions
RSAP_BADI_EXIT_ERROR .
**********************************************************************
*Definition for 2LIS_11_VAHDR
**********************************************************************
class-methods LIS_11_VAHDR
importing
value(I_DATASOURCE) type RSAOT_OLTPSOURCE
value(I_UPDMODE) type SBIWA_S_INTERFACE-UPDMODE
value(I_T_SELECT) type SBIWA_T_SELECT
value(I_T_FIELDS) type SBIWA_T_FIELDS
changing
!C_T_DATA type ANY TABLE
!C_T_MESSAGES type RSU5_T_MESSAGES optional
exceptions
RSAP_BADI_EXIT_ERROR .
**********************************************************************
*Definition for 2LIS_11_VAITM
**********************************************************************
class-methods LIS_11_VAITM
importing
value(I_DATASOURCE) type RSAOT_OLTPSOURCE
value(I_UPDMODE) type SBIWA_S_INTERFACE-UPDMODE
value(I_T_SELECT) type SBIWA_T_SELECT
value(I_T_FIELDS) type SBIWA_T_FIELDS
changing
!C_T_DATA type ANY TABLE
!C_T_MESSAGES type RSU5_T_MESSAGES optional
exceptions
RSAP_BADI_EXIT_ERROR .
**********************************************************************
*Definition for 2LIS_11_VAKON
**********************************************************************
class-methods LIS_11_VAKON
importing
value(I_DATASOURCE) type RSAOT_OLTPSOURCE
value(I_UPDMODE) type SBIWA_S_INTERFACE-UPDMODE
value(I_T_SELECT) type SBIWA_T_SELECT
value(I_T_FIELDS) type SBIWA_T_FIELDS
changing
!C_T_DATA type ANY TABLE
!C_T_MESSAGES type RSU5_T_MESSAGES optional
exceptions
RSAP_BADI_EXIT_ERROR .
class-methods LIS_02_HDR
importing
value(I_DATASOURCE) type RSAOT_OLTPSOURCE
value(I_UPDMODE) type SBIWA_S_INTERFACE-UPDMODE
value(I_T_SELECT) type SBIWA_T_SELECT
value(I_T_FIELDS) type SBIWA_T_FIELDS
changing
!C_T_DATA type ANY TABLE
!C_T_MESSAGES type RSU5_T_MESSAGES optional
exceptions
RSAP_BADI_EXIT_ERROR .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
METHOD if_ex_rsu5_sapi_badi~data_transform.
Batch_2 Page 15
CALL FUNCTION 'RSA1_SINGLE_OLTPSOURCE_GET'
EXPORTING
i_oltpsource = i_datasource
i_objvers = 'A'
IMPORTING
e_s_oltpsource = ls_oltpsource
EXCEPTIONS
no_authority = 1
not_exist = 2
inconsistent = 3
OTHERS = 4.
IF sy-subrc <> 0.
EXIT.
ENDIF.
CASE lv_method(1).
WHEN '0' OR '2'.
SHIFT lv_method.
WHEN OTHERS.
* Do Nothing
ENDCASE.
ENDMETHOD.
METHOD if_ex_rsu5_sapi_badi~hier_transform.
ENDMETHOD.
METHOD LIS_02_HDR.
**********************************************************************
* Copy this template 2LIS_02_HDR method and
* implement the code according to the requirement
* Don't change the code here.
**********************************************************************
ENDSELECT.
ENDLOOP.
ENDMETHOD.
METHOD lis_11_vahdr.
**********************************************************************
*Logic for 2LIS_11_VAHDR
**********************************************************************
Batch_2 Page 16
**********************************************************************
ENDLOOP.
ENDMETHOD.
METHOD lis_11_vaitm.
**********************************************************************
*Logic for 2LIS_11_VAITM
**********************************************************************
ENDLOOP.
ENDMETHOD.
METHOD lis_11_vakon.
ENDLOOP.
ENDMETHOD.
METHOD _datasource_template.
**********************************************************************
* Copy this template datasource method and
* implement the code according to the requirement
* Don't change the code here.
**********************************************************************
Batch_2 Page 17