cancel
Showing results for 
Search instead for 
Did you mean: 

Tracking History in ODS

Former Member
0 Kudos
56

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member204514
Contributor
0 Kudos

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

Former Member
0 Kudos

Thx, anil. Performance is very important! I added to u some points, hope it helps

So I solved this problem with standard functionality of time-dependent characteristics.

Answers (0)