‎2007 May 21 1:49 AM
Hello Friends,
I need help in writting Start Routine in update rule of Data Load from ODS 1 to ODS 2.
Now in ODS 1 data is available at daily level (i.e., Cal Date as lowest level of granularity)
in ODS 2 data is available at monthly level (i.e., aggregated/suppressed to Fiscal Period level)
-
In ODS 1 the data is available in the following form:
Visit Date Fisc Period Customer Product Question Answer Counter
01.01.2007 001.2007 C1 P1 Q1 Yes 1
20.01.2007 001.2007 C2 P1 Q1 Yes 1
20.01.2007 001.2007 C1 P1 Q1 No 1
15.02.2007 002.2007 C3 P1 Q1 Yes 1
15.02.2007 002.2007 C4 P1 Q1 No 1
(the key fields are: Visit Date + Fiscal Period + Customer + Product + Question)
-
-
In ODS 2 the data is available in the following form:
Fiscal Period Customer Product Question Answer Measure Cust-Last Visit Date
001.2007 C2 P1 Q1 Yes 1 20.01.2007
001.2007 C1 P1 Q1 No 1 20.01.2007
002.2007 C3 P1 Q1 Yes 1 15.02.2007
002.2007 C4 P1 Q1 No 1 15.02.2007
(the key fields are: Fiscal Period + Customer + Product + Question)
Customer-Last Visit Date is available as an attribute of Customer, not as part of transaction data since data in ODS 2 is at monthly level.
-
We have Run Date = Load/System Date, which is 22.02.2007 in this scenario/example.
Normal Load would mean converting the daily level data to fiscal period level. If data exists for that fiscal period in the target ODS, then overwrite it, and change the Cust-Last Visit Date(ODS 2) = Visit Date (ODS 1).
Now, the logic for start routine starts as follows:
1  IF Visit Date (ODS 1) < Run Date
Processing Record = Incoming Record.
2  Loop If Processing Record-Fiscal Period <= (less than or eq to) Run Date-Fiscal Period
Get the Record (from ODS 2) in an internal table, based on the key (Fiscal Period + Customer + Product + Question) of Processing Record from ODS 1.
IF Processing Record-Visit Date > Cust-Last Visit Date (ODS 2)
Update ODS 2
3  IF Processing Record-Fiscal Period < Run Date-Fiscal Period
Copy Processing Record to next Fiscal Period as well.
(i.e, Processing Record-Fiscal Period = Processing Record-Fiscal Period + 1)
3  Endif
Else
Do not process the processing record (i.e., SKIP Processing Record)
END LOOP
Endif
2  End Loop
1  Else
Normal Load
1  EndIf
Thanks a lot in advance
JP
‎2007 May 21 3:51 AM
do you not have an abap-er at your disposal? i don't imagine this to be quick & dirty that can be written without access to your system! some analysis work may also be required before the actual coding can be done...so I wouldn't post the entire functional spec (business requirement) here hoping for a solution; that would be too weird.
Regards.
‎2007 May 21 4:01 AM
i understand sougata.. i just need the start.. not the entire code.
thanks