cancel
Showing results for 
Search instead for 
Did you mean: 

Event Handler and tracking ID's behaviour

Former Member
0 Kudos

Dear All,

                Once we post the Event Handler (let say from ECC) with relevance condition as abap_true and then we delete the object in ECC such that relevance condition is abap_false now . What happens to Event Handler and its data. Does it gets deleted or EH become inactive ? .

                I am facing an issue where I was creating an EH on some ECC object and then i change the object on which EH will be created . Now the tracking id of old objects is also getting linked with the new EH. The name of the tracking ID code set is same.

Thanks,

Shubh.

Accepted Solutions (1)

Accepted Solutions (1)

former_member190756
Active Contributor
0 Kudos

Hello Shubh,

you can influence this in the AO Type TR /N/SAPTRX/ASC0AO:

Event Handler Deactivation Indicator

Indicates that an event handler for an application object is deleted (set
indicator) if the application object is no longer relevant.

The standard behavior of the application interface is that an event handler,
which is created in the Event Manager, is not deactivated or deleted unless the
corresponding application object or business object is deleted. This means that
an event handler stays active, even if the condition for the event management
relevance of an application object becomes false, having previously been true,
due to changes to the corresponding business object.

Examples

A container as part of a shipment is moved with carrier A. Shipments of
carrier A are event management relevant. If the carrier is now changed to B,
which is not event management relevant, the behavior is as follows:

  • Indicator is not set: Event handler stays in the Event Manager.

  • Indicator is set: Event handler is deleted after carrier switch.

Deleted means that EH is set to inactive and gets a deletion indicator. It will not be displayed then in any UI or returned by any Retrieval BAPI.

Best regards,

Steffen

Former Member
0 Kudos

Dear Steffen,

                    Thanks for your reply. I have marked the EH Deactivation Indicator in AOT.  Now once i delete the object and recreated another one , the previous EH instance is marked as deleted as you mentioned above and not fetched in the UI. But the one that i have created recently has all the old info and control parameters. These old parameters were added ,let's say, on occurrence of certain event in the old EH instance.  Why are the parameters fetched again and from where are they fetched ?

Thanks,

Shubh.

former_member190756
Active Contributor
0 Kudos

Hello Shubh,

if the old and the new EH have the same tracking ID and you have already sent Event Messages to the old one these messages get also processed for the new one.

When an EH is created it looks for messages with all Tracking IDs assigned to the EH that have not already processed for it.

If you want to avoid this there are several possibilities:

- make the Tracking IDs unique if possible (there are two additional fields)

- delete the Tracking IDs from the old EH

- Tracking IDs can have a Start and End Date i.e. they are only valid within a certain time frame

- delete and archive the messages that were sent to the old EH

It depends on your scenario which one is feasible and the best way.

Best regards,

Steffen

Former Member
0 Kudos

Dear Steffen,

                    Regarding your response that

"The standard behavior of the application interface is that an event handler,

which is created in the Event Manager, is not deactivated or deleted unless the

corresponding application object or business object is deleted."

                            Why is this behavior kept ?  How does the application interface check that whether an object is deleted or not ? 

                   e.g. On creation of HU for delivery on PGI we create a handler for HU ID maintained in

     shipment. We do a Reversal of GI and HU for delivery is deleted. Will that delete the handler as well ?

Thanks,

Shubh.

former_member190756
Active Contributor
0 Kudos

Hello Shubh,

this depends on your Relevance Function that you have maintained in the AO Type.

If the flag is set and the aftrer the Reversal the AO Type is not relevant any more (according to the logic in your Relevance Function) EH gets deleted.

Best regards,

Steffen

Former Member
0 Kudos

Dear Steffen,

                        Thanks for your reply. I am copying the earlier reply of yours below:

"The standard behavior of the application interface is that an event handler,

which is created in the Event Manager, is not deactivated or deleted unless the

corresponding application object or business object is deleted. This means that

an event handler stays active, even if the condition for the event management

relevance of an application object becomes false, having previously been true,

due to changes to the corresponding business object."

                                     The one in bold above says that event handler stays active even if the condition for the event management relevance of an application becomes false.  But your last reply says that if the relevance condition is set to false the EH gets deleted ?

Thanks,

Shubh.

Former Member
0 Kudos

Dear Steffen,

                     Any update on the above question ?

Thanks,

Shubh.

former_member190756
Active Contributor
0 Kudos

Hello Shubh,

sorry for the confusion. I thought you have switched on the flag mentioned above.

If yes the the EH gets deleted when the relevance condition is false.

If the flag is not set EH stays active even if the relevance condition is false.

Best regards,

Steffen

Answers (0)