cancel
Showing results for 
Search instead for 
Did you mean: 

How send records with same key to error stack and after decide what to do

inaki_zunzarren
Explorer
0 Kudos

Hi BW Experts,

I have the next problem:

I am loading data from external system, which cannot check the data consistency. Any times, I am loading records to ODS with the same key and each one overwrite the previous one. I don´t want to load these records, even the first record, I want all records of the request with the same key (key ODS) will be sent to error stack and after decide which of them will go up to ODS.

The option "Unique Data Records" is not enough in this case because the first record is loaded.

Any idea?

Regards,

Iñaki

Accepted Solutions (0)

Answers (2)

Answers (2)

inaki_zunzarren
Explorer
0 Kudos

My question is not about if record with same key exists in ODS, is about if in the same request exists records with the same key and I don´t want anyone load in ODS, I want all go to error stack and after decide what to do

Thanks

Former Member
0 Kudos

It is even easier, in the start routine you find in the internal table DATA_PACKAGE all the record of your request.

You can sort it by your key than test if you have some record duplicate.

Mario

inaki_zunzarren
Explorer
0 Kudos

Thanks Mario,

but how I can send all these records to error and get they are not loaded?

Maybe creating monitor entries in the start routine?

Thanks

Former Member
0 Kudos

You have two options, if you want to not stop the load you can delete the duplicate report from the datapackage otherwise you can stop the load puting a value in the ABORT variable (if the value is different from 0 the load are stopped).

You have also available the internal table MONITOR_RECNO and MONITOR that you can fill with the error you want to do in the monitor.

Mario

Message was edited by:

Mario Sacco

inaki_zunzarren
Explorer
0 Kudos

I don´t want to stop the load, but neither I want to delete duplicate records, I want to send these duplicate records to error stack to analyze them and decide what to do with them

Regards

Former Member
0 Kudos

Try to use the internal table MONITOR_RECNO you can put an error for the single record, so you can set the error for all record duplicated.

Former Member
0 Kudos

You can check in start routine if the record you still load are also present in the ods reading the table of active data.

If present you can put it an a custom table and after you check it.

Mario