on ‎2020 Aug 16 5:40 PM
I am trying to create a function module-based delta data source.
ranges: l_r_CPUTM forMKPF- CPUTM,
l_r_ AEDAT forMKPF- AEDAT.
LOOP AT s_s_if-t_select INTO l_s_select.
CASE l_s_select-fieldnm.
WHEN ‘CPUTM’.
ls_ CPUTM -sign= ‘I’
ls_ CPUTM -option= ‘EQ’.
APPEND l_r_ CPUTM.
WHEN ‘AEDAT’.
ls_ AEDAT -sign= ‘I’
ls_ AEDAT -option= ‘EQ’.
APPEND l_r__ AEDAT.
ENDCASE.
ENDLOOP.
Is there anything wrong as the changed records are not pulled up?
Request clarification before answering.
Hi Sudip,
Please find my answer below
Question 1. How you are populating ZDATE.? it will always have blank data
Answer: The ZDATE will have blank value when you will run a full load and in that case it will select all the data from Table.
When you run from RSA3 (it is still full load)
See the below select code.
loop at s_s_if-t_select into l_s_select where fieldnm = 'ZDATE'.
move-corresponding l_s_select to l_r_zdate.
l_r_zdate-sign = 'I'.
l_r_zdate-option = 'GE'.
clear l_r_zdate-high.
append l_r_zdate.
endloop.
open cursor with hold s_cursor for
select *
from mkpf
where ( ( CPUDT in l_r_zdate
or AEDAT in l_r_zdate )).
endif. In case of full load the range table l_r_zdate will be Greater than Equal to Blank(Zero) and the select statement will execute as [Select from MKPF where CPUDT is Greater than Equal to Blank(Zero) OR AEDAT is Greater than Equal to Blank(Zero). i.e. it will bring all the data from the table that means Full load].
Do you agree to that ??
Now when you run a delta Load :-
Either by Replicating the Data source in BW , making a Delta Init and then running Next Delta
OR by running init and extracting in other system (like SAP Data Services etc)
The delta Pointer will be available in Source System RSA7/ODQMON will have the date of last delta. This date field will be feed to the append table l_r_zdate in the FM and then the value of l_r_zdate will be Greater than Equal to that Date.
In the below Screenshot the last run of Delta for this was 17/09/2019. Random Data-source screenshot.

For Example :- You have performed Init today (19/08/2020) and when you are running the Delta tomorrow (20/20/2020),the value passed to the l_r_zdate will be Greater than Equal to 19/08/2020 or simply ">=" "20200819".
Now the above select condition will work like:- Select from MKPF where CPUDT is Greater than Equal to "20200819" OR AEDAT is Greater than Equal to "20200819". That means it select all the records with CPUDT (Date of Entry) greater than equal to the last ran of successful Delta ("20200819") or it will select all the records with AEDAT (changed on) greater than equal to the last ran of successful Delta ("20200819").
This is what Delta Functionality means.
Note : It already have 1 days buffer, as it has "GE" Sign. That means if it is ran on 21/08/2020, then it will bring data of 20th and 21st data both even though 20th Data were already extracted yesterday(as delta pointer is 20th - date of last successful delta). As you have already mention to keep Safety Internal to 1 day in your question I believe this wont be any issue. It is frequently used in BW as BW TRFN has Overwrite capabilities.
2.are you setting ZDATE as delta field in generic delta option in RSO2 along with the code?
Answer: Yes, I am setting ZDATE as a delta field in Generic Delta Option in RSO2.

3. any changes in includes of that function module ?
Answer: Nothing special in the Include , it just be pointing towards this Function Module.
If you want you can do the declaration of structure of your Internal table in the Include "L*****TOP" of that function group (not mandatory).
I have used this code sample for writing all my FM based Datasource selecting from Change Date and Created Date by creating ZDATE field as an extra field. It should work.
Note:E_T_DATA will be like the extract structure of the Datasource

Please let me know if you have any questions.
Thank you!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.