Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

need abap coding help in start routine

Former Member
0 Likes
354

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 &#61664; IF “Visit Date” (ODS 1) < Run Date

Processing Record = Incoming Record.

2 &#61664; 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 &#61664; 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 &#61664; Endif

Else

Do not process the processing record (i.e., SKIP Processing Record)

END LOOP

Endif

2 &#61664; End Loop

1 &#61664; Else

Normal Load

1 &#61664; EndIf

Thanks a lot in advance

JP

2 REPLIES 2
Read only

Sougata
Active Contributor
0 Likes
333

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.

Read only

Former Member
0 Likes
333

i understand sougata.. i just need the start.. not the entire code.

thanks