on 2008 Nov 18 1:03 PM
Hi, All.
I have 2 ODS:
ZODS_PAY
Doc_Num Date TCode Amt
Doc_1 01.11.2008 001 100$
Doc_1 04.11.2008 001 200$
Doc_2 07.11.2008 002 300$
ZODS_ACCRUALS
Doc_Num Date TCode Accrued_Amt_Per_Day
Doc_1 01.11.2008 002 10$
Doc_1 02.11.2008 002 10$
Doc_1 03.11.2008 002 10$
Doc_1 04.11.2008 002 20$
Doc_1 05.11.2008 002 20$
Doc_1 06.11.2008 002 20$
Doc_2 07.11.2008 002 30$
I should get the following report:
Doc_Num Data Amt Total_Accrued_Per_Period
Doc_1 01.11.2008 100$ 30$
Doc_1 04.11.2008 200$ 60$
Doc_2 07.11.2008 300$ 30$
My decision is:
1. Create ZODS_PAY2 with following structure:
Doc_Num Date TCode Amt ValidFrom ValidTo
Doc_1 01.11.2008 001 100$ 01.01.2008 03.11.2008
Doc_1 04.11.2008 001 200$ 04.11.2008 31.12.9999
Doc_2 07.11.2008 002 300$ 07.11.2008 31.12.9999
So I understand that I should realize the following algorithm for filling ValidFrom and ValidTo fields:
1. ValidFrom = Date.
2. ValidTo = (Date - 1) if this is a New Record.
After this I should fill a ValidDate to accruals table:
Doc_Num Date TCode ValidDate Accrued_Amt_Per_Day
Doc_1 01.11.2008 002 01.01.2008 10$
Doc_1 02.11.2008 002 01.01.2008 10$
Doc_1 03.11.2008 002 01.01.2008 10$
Doc_1 04.11.2008 002 04.11.2008 20$
Doc_1 05.11.2008 002 04.11.2008 20$
Doc_1 06.11.2008 002 04.11.2008 20$
Doc_2 07.11.2008 002 07.11.2008 30$
Any ideas? May be my decision is not good. Plz, help me to realize filling time-dependent fields for ODS.
Hi,
I am just putting my idea... You can implement according to the performance factor.
Fetch the date values from DSO1 and store it in internal table and sort them ascending.
Store the first value and start look up from second date record of internal table.
Compare the date field of second ODS (DSO2) with the second date record of DSO1 and store accordingly in to the target.
Hope it helps,
Regards,
anil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.