EKBE table for Generic Delta
Hi Gurus,
Good Day to all. I just like to inquire some details for creating generic datasource with delta enabled. I have created a view table with fields from EKBE table, and created generic datasource that reads the view table I have created from EKBE, now it needs delta process with CPUDT as delta specific field name, seeing the data type of CPUDT, it is DATS with 8 length.
I would like to assure if what will be use as marker of delta, timestamp utc, timestamp local, calendar day and numeric pointer?
And if I use one of the above, what settings that needs to be use for the safety interval upper and lower limit?
Thank you for your inputs and really appreciate it.
Hi,
use the CALDAY as a generic delta pointer.
i would like to recommend as: Safety Interval for Upper Limit as 1 and Safety Interval for lower Limit as ZERO
i think your are using the DSO as a staging layer no worry about duplicates.
Thanks,
Phani.
Similar Messages
-
I have to create one data source which will contain two fields for generic delta...extraction of data will be through FM.SAP provides a standard functionality to create a generic delta. This can only be build on one selected field.
The logic of the functional module is based on two fields: ICRDT (creation date) and IUPDT (change date). The module should look for both day because when a new records is created the change date does not get populated in R3.
Can anyone pls help me out?Hello Siggi,
i have to create an delta enabled extractor for a database table.
The database table (=EAUS) contains the fields "ERDAT" and "AEDAT".
I'm a Newbie in ABAP und so i read some blogs, articles and how to do papers here.
But my tests haven't work:
1. I created a structure in SE11 for extraction. The structure contains all the of the database tabel (=EAUS)
2. Then I created a data element "ZDATE" in SE11. I integrated ZDATE in the structure.
3. Then I copied function group "RSAX" and function module "RSAX_BIW_GET_DATA_SIMPLE" in our namespace.
4. I used the copied function module as a template and adapted the coding in the function module. The coding is from the paper "Functional Module Based Delta Enabled Generic Datasource"
But i doesn't work. My deltaenabled generic datasource doesn't get the deltas. In RSA3 with update mode "D" no data records were selected. (I create new records in the database EAUS before I checked the extraction). The update mode "F" and "C" works.
Can you help me and send me the coding of your function module?
Many thanks!
Jan -
Safety Intervals for Generic Delta
Hello Gurus,
I want to know about safety upper limit and lower limit for generic delta.
I have gone through the previous threads related to this topic and i am not able to understand completely.
can anybody explains me this in detail with example in terms with Calday, Timestamp & Numeric pointer.
Thanks in advance.There is very good example was exist on wiki.
please search and help yourself.
Use Google search by using search term " wiki generic delta".
You will get what you need. -
Relation between BKPF and EKBE table for reversing document?
Is there any relation between BKPF and EKBE table for reversing document when STBLG is blank in BKPF.
AND
How to differentiate Old Accounting document / Reverse document / New document when in BKPF-STBLG is blank for all three document and BKPF-XBLNR are same for all.Hi Varun,
Table Document no (BKPF-BELNR) is link between Material document no (EKBE-BELNR). If you are looking for validating Material reversal document then please use following logic for your requirement.
Material Document (MBLNR) & Material Document Year (MJAHR). Pass material document (MBLNR) to MSEG-SMBLN to read MSEG-MBLNR with MSEG-MJAHR to MSEG-SJAHR, if record found delete both the documents i.e. MSEG-SMBLN & MSEG-MBLNR (donu2019t consider these documents in the logic) and display Material Document No. (MSEG-MBLNR)
Regards,
Santosh -
i need to create a extractor x_attr to bring master data attributes from a table y.how can set
the generic delta on this x_attr generic datasource.does a generic delta exists for attr
datasource?Hi,
For delta to work properly in case of generic extractor.the field on which you want to make delta should be present in
the data source.
We have three delta.
1.Time stamp.
2.Cal day.
3Numeric pointer.
So depending upon your requirement and volume of your data you can choose the delta method.
Thanks,
Saveen Kumar -
Hi experts,
I want to create a generic data source related to purchasing for these fields.Anyone please provide me exact tables of these fields
1.MWSKZ Tax code
2.KBETR Condition amount
3.KWERT Condition Value
4.SORT1 Search Term
5.SORT2 Search Term
6.VALVT Value date (Check date)
7.QBSHB Withholding tax amount in doc cur
8.DWERT Differnce value
9.FRBNR No. of Bill of lading at time of GR
10.GROES Size / dimension
11.WT_QSSHB Withholding tax amount in doc.currency
12.WT_WITHCD Witholding tax code
13.Condition Type.
Atleast if anone give tables for some fields is also helpful.
Regards,
Nishuv.Hi
Table-Field
EKPO-MWSKZ
KOMV-KBETR
KOMV-KWERT
BSEG-QBSHB
MKPF-FRBNR
WITH_ITEM or BSEG-WT_QSSHB
LFBW- WT_WITHCD
MARA-GROES
Condition Type : KONP
Also check the following Link :
http://help.sap.com/saphelp_nw70/helpdata/en/45/4f8e8bbf3f4f63a5dd197ef7d53fa2/content.htm
http://www.abap.es/Descargas/TAB%20-%20Relacion%20de%20las%20tablas%20por%20modulos.PDF
Im unable to find VALVT and DWERT... kindly check the name once....
Hope thia helps you...
Regards,
Debjani....
Edited by: Debjani Mukherjee on Sep 7, 2008 7:07 AM
Edited by: Debjani Mukherjee on Sep 7, 2008 7:25 AM
Edited by: Debjani Mukherjee on Sep 7, 2008 12:20 PM -
Regd Safety Interval Lower Limit for Generic Delta
Hi All,
Safety Interval Upper Limit =1 for a Generic Delta would get Delta based on yesterday's BW data.
What would Safety Interval Lower Limit would do for a Generic Delta .
Your inputs please
SreeHi,
just a short example:
you run a init today --> 20070525 (internal date format).
for the next delta tomorrow the system takes the last extraction date - 1 day so 20070524 for data selection and will store 20070526 as last extraction date and so on.
This is to make sure that you will get all additional records extracted which were changed or created on each extraction date, but after last extraction. OK, you will get some records twice, but therefore you normally post the data to a ods via overwrite mode and this will take care about the 'real' delta while doing the further posting to the cube.
Hope this helps
kind regards
Siggi -
Time interval limit for generic delta on timestamp
I have searched a lot about delta on timestamp in the forums.
But I'm still not clear with the safety upper and lower limits..how is my delta load affected by this value?
What happens if I dont specify any value for the interval limit?Hi,
This is very simple thing, you must be knowing the concept of data posting in transactional system, e.g. creating a sales order.
When you create an order and press save, system takes data from this screen to the database tables and once this action, which is called "DB COMMIT", gets completed, you get data in your system tables. So this activity may take some time before you can retrive this information.
Let's say it takes 5 mins, so when you'll collect delta records, if some records, which are under process for DB commit, they won't come in delta. Say u collect these records at 12:00 AM and record posted 11:55 PM will take 5 mins to reflect in Database. So we keep safty limit of 5 min.
Upper and lower means starting and ending of time window, from which you want to extract records.
Hope it helps in understanding...
Regards,
Ashish -
How can I get delta records for Generic Delta
Hi BW Gurus,
I am using Generic Extractor using View from CATSDB and CATSCO talbes. At the time of modifying and changing records I am unable to get those records in BW despite enabling delta in RSO2 screen. I am able to view those modified and added records in R/3 in tables. Plz help me how I get those records to BW.hi,
After we loaded all the historical data uing full upadate . Implemenattion process is over , But we will have the Transaction data that will raise daily , So we have to store that New / changed data in Delta q , And extract them each day by Delta Update
So we will create an Info packege with the update mode as Delta , And schedule them when to start extraction , So we create the process chain uisng RSPC by giving the Info packege name . And extract the Detla daily as per schedule .
award pts if helpful.. -
I need to extract material sales data from table MVKE.
I want to use generic delta datasource but I'm not sure based on which field I need to load delta.
Any suggestions?
Is it possible to use generic delta for MVKE?Hi,
Yes you can go for generic delta, but you need to decide how your delta should be, whether you want only changed records or after before images or only new records,...
After deciding if you want only new records then you can go for CREATED On field
For changed records ou can go for CHANGED ON field
if you want after before images then choose the correct fields,
after choosing the delta you have to check for when you want to run your delta, daily once or more than ones, if you want yo run more than once go for time stamp.
Regards,
Pavan. -
When we go for Views and Function Modules for Generic Extraction
Hi Experts,
Can you please explain when we go for extracting the data using Views and when we got using Function Modules using Generic Extraction from R/3 system to BW with examples. And also can you explain when we go for delta for the above both scenarios.
Thanks for you help in advance
RohithHi,
Scenario for Extarction using FM
Imagine the scenario where you need to extract data from
tables having no common field between them and thereby preventing you from creating a view on top of those tables..
Or simply consider tables that are highly unrelatd in terms of fields, but you have a requiremnt to extract data from them.
Also Refer.
create generic extractor based on 2 tables
Generic Extraction via Function Module
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
Steps.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
http://help.sap.com/saphelp_nw04/helpdata/en/86/1c8c3e94243446e10000000a114084/frameset.htm
Scenario for Extraction using View
If there are more number of tables and data in those tables can be represented using joins then we can use this type of extraction
For more info Refer these links
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ecf9446011d189700000e8322d00/frameset.htm
Difference between "Help View" and "Search Help"
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed06446011d189700000e8322d00/frameset.htm
for more detailed info look on:
http://www.sap-img.com/abap/what-is-the-different-types-and-usage-of-views.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap+dictionary&
For GEneric Delta refer these links
[generic with delta;
[https://forums.sdn.sap.com/click.jspa?searchID=11388803&messageID=5164737] -
Doubt Reg Generic Delta "Safety Interval" Setting
Hi Experts,
I have a doubt regarding Setting "Safety Interval Upper Limit" and Lower limit in RSO2 for generic delta.
What does this setting imply?
If I do setting for calender day say both 1 then wht will be difference between delta before setting amd after setting?
Plz explain in terms other tham help provided...
Points will be awarded to say thanks..
Thanks in advance,
SorabhHi Sorabh,
Here some SAP informations:
Safety Interval Upper Limit of Delta Selection
This field is used by DataSources that determine their delta generically using a repetitively-increasing field in the extract structure. The field contains the discrepancy between the current maximum when the delta or delta init extraction took place and the data that has actually been read. Leaving the value blank increases the risk that the system could not extract records arising during extraction. Example: A time stamp is used to determine the delta. The time stamp that was last read is 12:00:00. The next delta extraction begins at 12:30:00. In this case, the selection interval is 12:00:00 to 12:30:00. At the end of extraction, the pointer is set to 12:30:00. A record - for example, a document- is created at 12:25 but not saved until 12:35. It is not contained in the extracted data but, because of its time stamp, is not extracted the next time either.
For this reason, the safety margin between read and transferred data must always be larger than the maximum length of time that it takes to create a record for this DataSource (with a time stamp delta), or it must display an interval that is sufficiently large (for determining delta using a serial number).
Safety Interval Lower Limit
This field contains the value taken from the highest value of the previous delta extraction to determine the lowest value of the time stamp for the next delta extraction. For example: A time stamp is used to determine a delta. The extracted data is master data: The system only transfers after-images that overwrite the status in the BW. Therefore, a record can be extracted into the BW for such data without any problems.
Taking this into account, the current time stamp can always be used as the upper limit when extracting: The lower limit of the next extraction is not seamlessly joined to the upper limit of the last extraction. Instead, its value is the same as this upper limit minus a safety margin. This safety margin needs to be big enough to contain all values in the extraction which already had a time stamp when the last extraction was carried out but which were not read. Not surprisingly, records can be transferred twice. However, for the reasons above, this is unavoidable.
Extracted Data Delta Type
The system uses the delta type to determine how extracted data is to be interpreted in BW, and into which data targets it can be posted.
A distinction is made between the following:
1. Additive delta
The key figures for extracted data are added up in BW. DataSources with this delta type can supply data to ODS objects and InfoCubes.
2. New status for changed records
Each record to be loaded delivers the new status for the key figures and characteristics. DataSources with this delta type can write to ODS objects or master data tables.
Check also examples in "How to... Create Generic Delta" under www.service.sap.com/bi.
Ciao.
Riccardo. -
Urgent: Problems in Generic Deltas by Function Module
Hi BW Experts,
My requirement is to extract text from CRM to BW using Zfunction module, copy of RSAX_BIW_GET_SIMPLE_DATA
which works fine for full loads but the problem arises only when i go for generic deltas. My code in FM for Deltas is:
LOOP AT s_s_if-t_select INTO l_s_select.
CASE l_s_select-fieldnm.
WHEN 'ZDATE'.
s_date_from = l_s_select-low.
s_date_to = l_s_select-high.
WHEN OTHERS.
ENDCASE.
ENDLOOP.
IF s_date_from IS INITIAL.
s_date_from = '20060401'.
ENDIF.
IF s_date_to IS INITIAL.
s_date_to = '99991231'.
ENDIF.
OPEN CURSOR WITH HOLD S_CURSOR FOR
SELECT * FROM STXH
WHERE TDOBJECT = 'CRM_ORDERH'
AND TDID = 'A002'
AND TDSPRAS = sy-langu
and TDLDATE between s_date_from and s_date_to
or tdfdate between s_date_from and s_date_to.
ENDIF.
FETCH NEXT CURSOR S_CURSOR
APPENDING CORRESPONDING FIELDS
OF TABLE wa_stxh
PACKAGE SIZE S_S_IF-MAXSIZE.
TDFDATE is creation date and TDLDATE is changed on
My extract structure contains Zdate(TDLDATE), Ztext1,2,3, Key field and langu in RSO2 I have selected calday in generic delta and Zdate as field Nm and upper limit as 1 and lower limit as space in settings and new status for changed records button.
Did I missed something because when i check in RSA7 i didnot see any changed records under totals column and i tried to load without it into BW than i didnot received single record evenafter changes.Would anyone suggest me the good solution for it I appreciate it in advance. I have seen lot of posts in SDN but I didnot find this type of secenario anywhere.
Thanks in advance
Regards
KishoreKishore,
go through the thread... which i provided for Generic DS using function for CRM Texts.
Re: Urgent: Extraction through function module
Any questions please let me know. If you have any questions update the thread with your mail id.
Replace the code with ...
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZDATE'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_TDLDATE.
APPEND L_R_TDLDATE.
ENDLOOP.
OPEN CURSOR WITH HOLD S_CURSOR FOR
SELECT * FROM STXH
WHERE TDOBJECT = <Text Object>
AND TDID = <Text ID >
AND TDSPRAS = sy-langu
AND (TDLDATE IN L_R_TDLDATE
or TDFDATE IN L_R_TDLDATE).
ENDIF. "First data package ?
Fetch records into interface table.
named E_T_'Name of extract structure'.
FETCH NEXT CURSOR S_CURSOR
APPENDING CORRESPONDING FIELDS
OF TABLE wa_stxh
PACKAGE SIZE S_S_IF-MAXSIZE.
L_R_TDLDATE will be calculted by the system. Internally, system will save the Last Delta date(you need to enable this field for Generic delta).
all the best.
Regards,
Nagesh Ganisetti. -
Generic Delta extraction by Function module issue
Hello Experts,
Please help !!!
I have problem for delta extraction by Function module. For the full load, I wrote function module based on RSAX_BIW_GET_DATA_SIMPLE. It works fine.
But I would like to have the delta load enabled. Therefore, I modified the datasource, add a delta specific field u2018ztimestampu2019, which type is calendar day.
Then I create a function module based on template u2018RSAX_BIW_GET_DATAu2019, as this support the upload mode. But when I test this datasource in RSA3, no matter itu2019s full load or initial delta load, it always send me an error, u201CErrors occurred during the extractionu201D.
I had some debug, and found that there is no value for i_isource when my function module is called. Therefore it raised the exception.
But I do not have the chance to debug my code for the delta logic, can somebody help to check?
I also check the entries in ROOSOURCE,
For my datasource ZTRNREC_FM_DELTA, The DELTA value is u2018AIEu2019, and extraction method is u2018F2u2019, should I change them to DELTA= u2018Du2019 and extraction method to u2018F1u2019? Where to change?
FUNCTION ZRSAX_TRAININGREC_DELTA.
""Local Interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SBIWA_S_INTERFACE-REQUNR
*" VALUE(I_ISOURCE) TYPE SBIWA_S_INTERFACE-ISOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SBIWA_S_INTERFACE-INITFLAG OPTIONAL
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE OPTIONAL
*" VALUE(I_DATAPAKID) TYPE SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
*" VALUE(I_PRIVATE_MODE) OPTIONAL
*" VALUE(I_CALLMODE) LIKE ROARCHD200-CALLMODE OPTIONAL
*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SBIWA_T_FIELDS OPTIONAL
*" E_T_DATA STRUCTURE ZTRN_REC_TIME OPTIONAL
*" E_T_SOURCE_STRUCTURE_NAME OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
The input parameter I_DATAPAKID is not supported yet !
Example: InfoSource containing TADIR objects
Auxiliary Selection criteria structure
DATA: l_s_select TYPE sbiwa_s_select.
Maximum number of lines for DB table
STATICS: l_maxsize TYPE sbiwa_s_interface-maxsize,
S_S_IF TYPE SRSC_S_IF_SIMPLE,
S_COUNTER_DATAPAKID LIKE SY-TABIX.
Parameter I_PRIVATE_MODE:
Some applications might want to use this function module for other
purposes as well (e.g. data supply for OLTP reporting tools). If the
processing logic has to be different in this case, use the optional
parameter I_PRIVATE_MODE (not supplied by BIW !) to distinguish
between BIW calls (I_PRIVATE_MODE = SPACE) and other calls
(I_PRIVATE_MODE = X).
If the message handling has to be different as well, define Your own
messaging macro which interprets parameter I_PRIVATE_MODE. When
called by BIW, it should use the LOG_WRITE macro, otherwise do what
You want.
Initialization mode (first call by SAPI) or data transfer mode
(following calls) ?
IF i_initflag = sbiwa_c_flag_on.
Initialization: check input parameters
buffer input parameters
prepare data selection
The input parameter I_DATAPAKID is not supported yet !
Invalid second initialization call -> error exit
IF NOT g_flag_interface_initialized IS INITIAL.
IF 1 = 2. MESSAGE e008(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'008' "message number
' ' "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDIF.
Check InfoSource validity
CASE i_isource.
WHEN 'ZTRNREC_FM_DELTA'.
WHEN OTHERS.
IF 1 = 2. MESSAGE e009(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'009' "message number
i_isource "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDCASE.
Check for supported update mode
CASE i_updmode.
WHEN 'F'.
WHEN 'D'.
WHEN 'R'.
WHEN OTHERS.
IF 1 = 2. MESSAGE e011(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'011' "message number
i_updmode "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDCASE.
Check for obligatory selection criteria
APPEND LINES OF i_t_select TO g_t_select.
Fill parameter buffer for data extraction calls
g_s_interface-requnr = i_requnr.
g_s_interface-isource = i_isource.
g_s_interface-maxsize = i_maxsize.
g_s_interface-initflag = i_initflag.
g_s_interface-updmode = i_updmode.
g_s_interface-datapakid = i_datapakid.
g_flag_interface_initialized = sbiwa_c_flag_on.
Fill field list table for an optimized select statement
(in case that there is no 1:1 relation between InfoSource fields
and database table fields this may be far from beeing trivial)
APPEND LINES OF i_t_fields TO g_t_segfields.
ELSE. "Initialization mode or data extraction ?
Data transfer: First Call OPEN CURSOR + FETCH
Following Calls FETCH only
LOOP AT G_T_SELECT INTO L_S_SELECT
WHERE FIELDNM = 'ZTIMESTAMP'.
ENDLOOP.
IF G_COUNTER_DATAPAKID = 0.
IF L_S_SELECT-LOW = '' AND L_S_SELECT-HIGH = ''.
OPEN CURSOR WITH HOLD G_CURSOR FOR
SELECT (g_t_fields)
FROM ZTRN_REC_TIME.
ELSE.
OPEN CURSOR WITH HOLD G_CURSOR FOR
SELECT (g_t_fields)
FROM ZTRN_REC_TIME
WHERE ZTIMESTAMP >= L_S_SELECT-LOW
AND ZTIMESTAMP <= L_S_SELECT-HIGH.
ENDIF.
ENDIF.
FETCH NEXT CURSOR G_CURSOR
APPENDING CORRESPONDING FIELDS
OF TABLE E_T_DATA
PACKAGE SIZE S_S_IF-MAXSIZE.
IF SY-SUBRC <> 0.
CLOSE CURSOR G_CURSOR.
RAISE NO_MORE_DATA.
ENDIF.
S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
ENDIF.
ENDFUNCTION.
I found some similar issue in this forum by link
Generic Extractor Delta Function Module code, but still I could not get clear answer.
Can you please help me:
1) why there is no value for i_source , how to fix it?
2) For the delta logic for ztimestemp, is it correct?
3) Need I modify the entries in ROOSOURCE ?
Thanks a lot !!!Hello Andre,
Thanks a lot for your help. I did some change , but still does not work. Could you please help check.
Now the source code are the following, It's based on the RSAX_BIW_GET_DATA_SIMPLE, as you confirm that this also supply the update mode (full, initial delta, delta).
FUNCTION RSAX_BIW_GET_DATA_TRAININGREC1.
""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 ZTRN_REC_TIME OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
Auxiliary Selection criteria structure
DATA: L_S_SELECT TYPE SRSC_S_SELECT.
Maximum number of lines for DB table
STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
counter
S_COUNTER_DATAPAKID LIKE SY-TABIX,
cursor
S_CURSOR TYPE CURSOR.
Select ranges
RANGES:
L_R_ZTIMESTAMP FOR ZTRN_REC_TIME-ZTIMESTAMP.
Initialization mode (first call by SAPI) or data transfer mode
(following calls) ?
IF I_INITFLAG = SBIWA_C_FLAG_ON.
Initialization: check input parameters
buffer input parameters
prepare data selection
Check DataSource validity
CASE I_DSOURCE.
WHEN 'ZTRNREC_FM'.
WHEN OTHERS.
IF 1 = 2. MESSAGE E009(R3). ENDIF.
this is a typical log call. Please write every error message like this
LOG_WRITE 'E' "message type
'R3' "message class
'009' "message number
I_DSOURCE "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.
APPEND LINES OF I_T_SELECT TO S_S_IF-T_SELECT.
Fill parameter buffer for data extraction calls
S_S_IF-REQUNR = I_REQUNR.
S_S_IF-DSOURCE = I_DSOURCE.
S_S_IF-MAXSIZE = I_MAXSIZE.
Fill field list table for an optimized select statement
(in case that there is no 1:1 relation between InfoSource fields
and database table fields this may be far from beeing trivial)
APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.
ELSE. "Initialization mode or data extraction ?
Data transfer: First Call OPEN CURSOR + FETCH
Following Calls FETCH only
First data package -> OPEN CURSOR
IF S_COUNTER_DATAPAKID = 0.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZTIMESTAMP'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_ZTIMESTAMP.
APPEND L_R_ZTIMESTAMP.
ENDLOOP.
Determine number of database records to be read per FETCH statement
from input parameter I_MAXSIZE. If there is a one to one relation
between DataSource table lines and database entries, this is trivial.
In other cases, it may be impossible and some estimated value has to
be determined.
IF L_S_SELECT-LOW = '' AND L_S_SELECT-HIGH = ''.
OPEN CURSOR WITH HOLD S_CURSOR FOR
SELECT (S_S_IF-T_FIELDS)
FROM ZTRN_REC_TIME.
ELSE.
OPEN CURSOR WITH HOLD G_CURSOR FOR
SELECT (S_S_IF-T_FIELDS)
FROM ZTRN_REC_TIME
WHERE ZTIMESTAMP >= L_S_SELECT-LOW
AND ZTIMESTAMP <= L_S_SELECT-HIGH.
ENDIF.
ENDIF. "First data package ?
Fetch records into interface table.
named E_T_'Name of extract structure'.
FETCH NEXT CURSOR S_CURSOR
APPENDING CORRESPONDING FIELDS
OF TABLE E_T_DATA
PACKAGE SIZE S_S_IF-MAXSIZE.
IF SY-SUBRC <> 0.
CLOSE CURSOR S_CURSOR.
RAISE NO_MORE_DATA.
ENDIF.
S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
ENDIF. "Initialization mode or data extraction ?
ENDFUNCTION.
I think it already includes the important statements you suggested.
I test this FM in RSA3, for the Full load mode, it works fine. Also if I checked the debug mode in execution , it will stop in the code and let me debug.
But when I choose other mode, like 'initializion of the delta transfer' or simulation of initial delta, I always get error 'error occurs during the extraction' .. even I choose debug mode, but it could not enter the code for debug..
Till now I did not see any parameter or value for the upload mode..
Another questions is that, in RSO2, I define Ztimestamp as my delta field.. But , can I add other field as selection condition in the datasource definition, and has its range table in this function module ?
Should I change the entries in ROOSOURCE for this datasource ??
Please let me know your feedback, do you have some concret example for generic delta extraction ?
Thanks a lot ! -
Dear Expert
I have a z Table consisting fields like company code , change date, etc.
I have created a generic delta using change date as delta field.
A program loads data to this table.
Lets say I loaded all data for company code 1000 and there are other company code data I also need to load but have not done so.
I replicate the datasource to BI 7.
I have read guides on Generic delta and need clarification on its mechanism in more detail.
========
1. Do we need to Initialize Delta for Generic Delta?
2. If my infopackage used for the init is change date of yesterday, what happens when some days later, I load company code data 2000 into the z table and these data has change dates earlier than the init date?
3. Does init work like this : lets say the data selection in the infopackage used for the init is :
company code = 1000
change date = yesterday.
the 1st delta infopackage will be based on the change date of yesterday and the upper and lower limit?
4. What if I subsequently load other company code data into the z table? How can these be loaded as delta by the existing delta? Or must there be another init? can this be done?
5. Technically, if delta is loaded today, and 2 days later, I insert manually into z table a record having the same change date as the 1st delta change date. How does the delta mechanism know about this? I seek clarification that this record will not be known by the delta and will not be picked up and loaded by the next delta infopackage because the change date is incremental and will never pick up and old change date and delta is based on change date selection.
Hope you can enlighten me on the above doubts .
Best regards
PascalHi Pascal,
1. Do we need to Initialize Delta for Generic Delta?
Yes, you need to do init to capture the delta records.for this while designing you have to select Delta check box in data source maintenance screen.
2. If my infopackage used for the init is change date of yesterday, what happens when some days later, I load company code data 2000 into the z table and these data has change dates earlier than the init date?
The change date will be populated in Z table based on system, when you change any record today you won't get yesterday date.anyways in your question as change date is less than last delta run date it won't pick that records.
3. Does init work like this : lets say the data selection in the infopackage used for the init is :
company code = 1000
change date = yesterday.
the 1st delta infopackage will be based on the change date of yesterday and the upper and lower limit?
The best practice is run the init with out any selections, unless when you have requirement that you need to create multiple init's on same data source.
no need to give date selections in info package(already your delta is working on change date).If you need data for a particular company code, give company code other even do not give company code as selection.It will pick all the new or changed data from last delta run.
4. What if I subsequently load other company code data into the z table? How can these be loaded as delta by the existing delta? Or must there be another init? can this be done?
Do not give company code as selection in your delta info package.same delta IP will pick the data for all company codes.
5. Technically, if delta is loaded today, and 2 days later, I insert manually into z table a record having the same change date as the 1st delta change date. How does the delta mechanism know about this? I seek clarification that this record will not be known by the delta and will not be picked up and loaded by the next delta infopackage because the change date is incremental and will never pick up and old change date and delta is based on change date selection.
As i already told we cannot give change date manually, when you save a record this will be populated by system in the table.
Delta settings for generic data source will be maintained in table ROOSGENDLM (here we will have last delta run time stamp on this data source).When you run delta next time, it will pick the data which was stored after delta time stamp.
Regards,
Venkatesh.
Maybe you are looking for
-
Regexp_replace - too heavy?
I've got code for extracting numbers from varchar2 column: with t1 as ( select 1 as acode, '100,00' as avalue from dual union all select 2 as acode, '100.00' as avalue from dual union all select 3 as acode, '100.00%' as avalue from dual union all sel
-
Issues / Bug with Nokia N9
Issues / Bug with Nokia N9 1. The mobile network gets disconnected after each call and I have to wait atleast 10-20 seconds to redial or make a new call, I cannot dial a number just after I finish a call / speaking with someone. It happens on both In
-
Changed RAM in Macbook Pro now the Apple logo appears then switches off
Hi all, I hope someone can offer me some assistance with this. I'm using a Macbook Pro (unsure of the year) It's a 13" running an i5 and 4GB of ram. I believe it is running Mountain Lion. I took the back off and added one strip of 4gb to go along sid
-
Cannot print out correct colors using Mac and Epson Artisan 1430
I recently switched from using Illustrator on my PC to using Illustrator on my IMAC. My display on the PC and the display on the IMAC show the graphics in the exact same colors. When I print a graphic from my PC in Illustrator on my Epson printer i
-
Programically checking RT8145 after rebooting
My application programically reboots my 8145RT device. I was wondering if there is a way to programically tell when the RT device has finished rebooting so that I can restart my TCP/IP communication to the device. Currently I just wait 45 seconds bef