Additional Info On Generic Data Extractors
Additional Info On Generic Data Extractors
Additional Info On Generic Data Extractors
Delta
Time Stamps in SAP source tables where the date and time of an activity are concatenated together into a
single 15-digit field. For example, 11-Dec-2009 @ 1:00:00.0 PM would be designated in a Time Stamp defined field
as 200912111300000 (YYYYMMDDHHMMSSS format).
Calendar Day in SAP source source tables is defined as a data type of D or DATS. It contains 8-digits for the date
in YYYYMMDD format.
Numeric Pointer in SAP source tables is a field that contains a numeric pointer. For example, the Sales Order
Number on the Sales Order Header table (VBAK-VBELN) would be considered a potential Numeric Pointer for
generic delta, even though it has been defined as a character (data type of C or CHAR) of 10-bytes because it
contains all numeric data. This type of generic delta can only be used for new records. It will not be able to
determine if changes have been made to an existing Number Pointer field.
The pointer field (normally an ID) must be continuously increasing. So a record created
right now must always have a higher ID than the one created say an hour ago
No updates to existing records
One thing that should be pointed out about using the built-in generic delta functionality. It only allows identification of
one field to use for delta. In a substantial amount of cases, however, there are more than one field that need to be
used for determining delta (e.g. Created On and Changed On dates). In these cases, this delivered functionality for
creating generic delta cannot be used and you will have to create a Function Module to not only programmatically
handle the delta logic, it would also have to be used as the source for the generic DataSource as well (even if you're
just extracting data out of one SAP source table).
VBELN
4965
ERDAT
AUDAT
NETWR
01.01.2006
01.01.2006
5000
4966
02.01.2006
02.01.2006
1000
4967
05.02.2006
05.02.2006
15000
4968
06.07.2007
06.07.2007
20000
4965
01.01.2006
09.07.2007
9000
Tips:
If delta field is Date (Record Create Date or change date), then use Upper Limit of 1 day. This will load
Delta in BI as of yesterday. Leave Lower limit blank.
If delta field is Time Stamp, then use Upper Limit of equal to 1800 Seconds (30 minutes). This will load
Delta in BI as of 30 minutes old. Leave Lower limit blank.
NOTE: Safety interval should be set so that no document is missed even if it was not stored in the DB
table when the extraction took place.
When we see this DataSource in Extractor Checker (RSA3), this data source
When I see the content of table EKKO, I can find few records where AEDAT is blank.
These records are missing in Extractor Checker.
How I can solve this problem? Which delta-specific field can be used in
this generic Datasource? Should I define an additional Generic DataSource with
Delta-Specific Field BEDAT (as BEDAT is filled when AEDAT is blank in table EKKO)?
Answer1 :
Hi,
In order to capture delta on EKAB table, you will have to create two generic datasource, one having a delta on
"BEDAT" i.e. "Purchase Order Date" and other having a delta on "AEDAT" i.e. "Changed On". This is because when a
record gets created in this table, "BEDAT" is populated and "AEDAT" is blank. When a change occurs, "AEDAT" is
populated. So, your first generic datasource will capture the records created and the second will capture the records
changed.
As AEDAT is delta field it will take up only those records for which AEDAT date is greater that last execution date.
Record for which AEDAT is coming blnk for them it is obvious that their date will be 00.00.0000 which can not be
greater than any date. hence it is missing those records
We want to do a delta load using a generic extractor based on two fields - ERDAT, AEDAT.
If AEDAT is initial, use ERDAT; else, use AEDAT.
Questions:
1/ Is this possible using a generic extractor
2/ How do I use a FM with Gen Delta option (asks for Table not FM)
3/ Will I have to do delta management myself (i.e., keep track of the last delta date, and do AEDAT/ERDAT > last
delta date)
Answer :
1/ Yes, you can create a single delta enabled generic DS built on 2 date fields
2/ Function Module Created : Z_SAX_BIW_GET_DATA_SIMPLE, and extract structure: ZOXECX0114 ---> Of course
this will be your own
3/ Delta built on dummy date : ZZDLDAT
4/ Here I am extracting from AFRU using 2 dates:
FUNCTION Z_SAX_BIW_GET_DATA_SIMPLE.
*"---""Local Interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
*" TABLES
*"
I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*"
I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*"
E_T_DATA STRUCTURE ZOXECX0114 OPTIONAL
*" EXCEPTIONS
*"
NO_MORE_DATA
*"
ERROR_PASSED_TO_MESS_HANDLER
*"----
counter
S_COUNTER_DATAPAKID LIKE SY-TABIX,
cursor
S_CURSOR TYPE CURSOR.
Select ranges
data: x.
*
while x is initial.
endwhile.
************************************************************************
Initialization: check input parameters
************************************************************************
Data transfer: First Call
OPEN CURSOR + FETCH
Following Calls FETCH only
************************************************************************
Fill range tables BW will only pass down simple selection criteria
of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'AUFNR'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_AUFNR.
APPEND L_R_AUFNR.
ENDLOOP.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'VORNR'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_VORNR.
APPEND L_R_VORNR.
ENDLOOP.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'RUECK'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_RUECK.
APPEND L_R_RUECK.
ENDLOOP.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZZDLDAT'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_ZZDLDAT.
APPEND L_R_ZZDLDAT.
ENDLOOP.
ENDIF.
IF SY-SUBRC <> 0.
CLOSE CURSOR S_CURSOR.
RAISE NO_MORE_DATA.
ENDIF.
S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
ENDIF.
ENDFUNCTION.