Skip to Content
avatar image
Former Member

Delete Query ID or Tracking ID through Event

We would like to pull out of our Event Handler an ID (whether query or tracking) can we accomplish this using the BAPI /SAPTRX/BAPI_EH_ADDEVENTMSG_02 ??

IF so what are the fields that are required? We can successfully deactivated an EH but we don't want that we just want to pull it out of the EH set.

For example when a delivery is deleted from a shipment we don't want to track that shipment in our EH set anymore (our set being sales order, delivery, shipment).

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Apr 14, 2010 at 04:44 PM


    I am not sure why you would need to do this. If your EH set groups based on a shipment number and the delivery is deleted it is also deactivated (The delivery EH) and deleted from the shipment doc which means it wouldn't be picked up by the EH set anymore. If you are grouping on Sales Order number then again when the delivery is deleted the corresponding EH for the delivery is deleted and will no longer appear in the EH Set.

    Can you provide more details on your scenario?

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Chris,

      for Query IDs there is no activity available at the moment.

      But you should be able to write an own activity doing it similar like the Tracking ID activity. The query ID structure /SAPTRX/EH_QRYID_DYN has also a field for an update Indicator.

      I assume it will only work writing an activity method by an enhancement doing this:

      (1) start Class Builder (SE24) for class /SAPTRX/CL_EH_EVENT_MSG_MODEL

      in display mode

      (2) The "Methods" tab appears

      (3) Select menu function "Class >Enhance"

      (4) The "Create Enhancement Implementation" popup appears;

      create an enhancement implementation here

      (5) after creating it you come back to the "Methods" tab, but now you

      are in mode "Enhance class "

      (6) scroll down to the end of the methods list; here you can add a

      new method now ...

      That new method will be automatically connected to

      your enhancement impelmentation (you can see that in column

      "Enhancement implementation")

      Best regards,


  • avatar image
    Former Member
    Apr 20, 2010 at 12:36 PM

    We had made some changes that actually didn't delete the EH even if it was deleted in the AO system. We now have decided to use an alternative method of updating a different EH when a deleting of an AO occurs. I will outline this in the thread Update Sales EH before Deleting Delivery EH from application system

    The whole problem comes that we need to capture a metric in BI of a sales order line that is "Ready To Ship". So if a delivery is deleted or a delivery is removed from a shipment (deleted) then this needs to update the sales order line to let it know that this occured. I was hoping just to show that the EH was deactivated in a EH set. However, I now know that the EH is deleted completely when the AO is deleted. This is where the thread above comes into play allowing us to look at all event types even though the EH was deleted 😊

    I hope this helps some of you!

    Add comment
    10|10000 characters needed characters exceeded