cancel
Showing results for 
Search instead for 
Did you mean: 

DBSQL_DUPLICATE_KEY_ERROR

ZenonK
Participant
0 Kudos

Hello Gurus.

I'm occasionally getting these Runtime errors: DBSQL_DUPLICATE_KEY_ERROR.

I've seen similar posts on here recently.  Can anyone help?

Problem 1

Runniing Expected Event Monitor.   It dumps on this line in  /SAPTRX/LEH_FUNCSF01   UPDATE_DB_TABLE

Problem 2

Posting an idoc in WE19,   Dumps on same line as above.

Thanks.

Zenon.

Accepted Solutions (1)

Accepted Solutions (1)

former_member190756
Active Contributor
0 Kudos

Hi Zenon,

this results on a mismatch of the counter in /SAPTRX/EH_HDR-LAST_EEHST_NBR for the EH and the number of entries in /SAPTRX/EH_EEHST for the same EH.

Root cause is normally some coding that writes besides the standard EM interfaces to EM tables.

Best regards,

Steffen

ZenonK
Participant
0 Kudos

Hi Steffen.

The only unusual thing I did was post an Actual Event in EH Types  'Upd.Act 2'.  

(I called /SAPTRX/BAPI_EH_ADDEVENTMSG_02)

Could this be the problem?

The requirement is to update the Reported Date/Time as soon as the EH is created.

On previous projects I've sent the Actual message from the Application System after the EH is created but this was not practical here.

Regards.

Zenon.

former_member190756
Active Contributor
0 Kudos

Hi Zenon,

yes this could be the reason.

Do you send it to the same EH? This does definitely not work and leads to inconsistencies.

You should use an event type for that.

In the standard rule activity /SAPTRX/RESEND this is prevented e.g. at the beginning.

Best regards,

Steffen

ZenonK
Participant
0 Kudos

Thanks Steffen.

Yes it was the same EH,

I initially tried the EH Type but it was not easy to find a good trigger point.  I'll try that again.

I was also thinking of running /SAPTRX/BAPI_EH_ADDEVENTMSG_02  in the background (batch)

every 20 mintes to post the event mesage, but fear this will also cause problems.

I'll stick to the standard Event Type approach,

former_member190756
Active Contributor
0 Kudos

What should work if you can live with background jobs:

SPRO:

Event Management

     Event Messages, Status Queries, Web Interface and EM OData Service

          Define Criteria for Event Message Processing

Criteria for Buffering Event Messages

You define criteria for buffering event messages to save event messages in the database without them being processed by SAP Event Management (for example, all event messages for a specific event). They are sent to SAP EM later on using a report (transaction /SAPTRX/MI03) where they are then processed.

Best regards,

Steffen

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Since you have mentioned occasionally...

Can you check , whether you are running multiple instances at the same time. which will result in such dumps..

It might happen, that new instance will get trigger although previous instance is still running.then it will lead to the mentioned dump.

Regards,

Ratnakar

ZenonK
Participant
0 Kudos

Hi Ratnakar.

Please can you explain 'mulitiple instances'.  Sounds interesting,

Thanks.

Zenon.

Former Member
0 Kudos

Hi,

I mean multiple instances of expected event monitor job at same time.

Regards,

Ratnakar

Former Member
0 Kudos

Hi Zenon,

This is what we discussed in the past.

Runtime Error : DBSQL_DUPLICATE_KEY_ERROR | SCN

1. Can you go to expected event monitor and check your custom activity function how it sets?

2. Check the sequence of expected event monitor set the event handler status?

3. Is your expected event monitor status setting sets for two different event handlers at same time?

Regards


GGOPII

ZenonK
Participant
0 Kudos

Hi Gopi.

We are not using ab EEM activity.   If the event is overdue it turns RED.  No further action is taken,

Thanks.

Zenon.