cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering Records with Start Routine

Former Member
0 Kudos
361

Hello BW Gurus,

I want to load selected records from ODS1 to ODS2. ODS1 contains the Key Field Meter Reading Documents and characteristic Site (Installation).

I want to load only the three most recent MR Docs for each site. Most recent MR Docs are identified by higher MR Doc Number.

Anybody has ABAP code example to help me start?

Thanks

JLT

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jean-Luc,

I think you have to access onto the active table of ODS1 to satisfy this kind of requirement (not so nice at performance level)...

just some questions:

Do you have to delete all the previous records in ODS2 and do everytime a full from ODS1 ?

Do you have some other key fields in ODS2 ?

Because I was thinking about an external pgm to feed your ODS2...

Bye,

ROberto

Former Member
0 Kudos

Hi Jean,

In the Start Routine, the records will be contained in the internal table DATA_PACKAGE. The best way to deal with your situation is to sort the DataPackage w.r.t the MR Numbers. Then DELETE the records you don't need.

But this potentially has one issue, that it, you are restricting yourself for each individual DataPackage. I mean there is potentially no way to tell if all the MR numbers you are looking for fall in the same Data Packet.

I think this issue could be resolved using a kind of a staging area. here is what I think:

1. From ODS1, the data is populated to ODSTEMP.

2. ODSTEMP is a staging ODS.

3. In this ODS, you need to delete the records which you don't need from the active table using a ABAP Report.

4. now do a FULL LOAD to ODS2.

5. Drop the data contained in ODSTEMP.

Regards,

GPK.

Answers (4)

Answers (4)

former_member183777
Active Contributor
0 Kudos

Another option for you is to create a Function Module based generic datasource in the BW system. Just like you build generic datasources in R/3, you can build them in BW and use it to code the extraction from ODS1.

You should start by copying the SAP supplied template Function module RSAX_BIW_GET_DATA_SIMPLE

Former Member
0 Kudos

I don't quite understand the concept of Data Package in this case. Does it mean that the data from ODS1 will be split in Packages when processed by the Start Routine?

Former Member
0 Kudos

Hi Jean,

When ever we load data into any data target, the data will be processed using the DATA Packets. These Data Packets are like INTERNAL TABLES holding the data to be loaded into the cube.

Eg:

You have to load 1Million records to your data target. Depending on the settings in RSCUSTV6, the data records will be split into many DATA PACKETS and hence loaded onto the Data Target one after the other.

Hope this makes sense.

Regards,

GPK.

Former Member
0 Kudos

Thanks GPK,

It's a good idea. But what would prevent from doing it directly in ODS2

(without a staging ODS)?

Jean-Luc

Former Member
0 Kudos

Hi Jean,

The MR# can be in any order in any DATA PACKAGE. If you can assure that, all the MR#(Similar) fall in the same DATA PACKAGE, then we are good. Only if it is the other way round, we would have a potential issue.

Hope it is clear.

Regards,

GPK.

Former Member
0 Kudos

Hi Roberto,

Thanks for the reply.

To your questions:

Once a month, we will delete and reload ODS2;

There are 2 other Key Fields in ODS2 (same as ODS1): installation and

Meter Reading Reason.

Thanks

Jean-Luc