cancel
Showing results for 
Search instead for 
Did you mean: 

Recognizing Error Events

Former Member
0 Kudos

Hi,

I am posting multiple event handlers and event messages using bapi_eh_post and add_event_msg02  from sap ECC system.

Suppose, I am pushing 10 entries to create 10 events in EM at one go out of which 4 entries contain irrelevant data or few fields are blank.

In that case, 6 event handlers  will be created.

But how can I recognise which are the exact entries those are posted perfectly and which are not.

I can see, in the bapireturn of both the function modules produce E type message if all the entries are not posted but It does not contain specific data.

But Is there any way to find out, the exact entries those are not posted or posted or Is there any mechanism to not trigger the events which are already exist in EM in term of date time and location.


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

@Debabrata :

Ofcourse, that's a way but that will definitely take more time,Cannot we find out the error entries from function module bapi_eh_post and addeventmsg02's output.

@Gopi:

.Kindly explain on first point in detail..about outbound queue.

I am calling EM FM BAPI EH POST and ADDEVENTMSG02 from SAP ECC system.

I can put a check in ECC , before passing data into relevant internal tables in ECC side before posting to validate.....but how can i confirm that exactly all the input entries are posted(either event handler created or event msg posted)...without making any extra call..

If i will verify at EM end using badi, again that will take some more time to validate each entry is posted or not.

I am just concern about the entries those are not posted so that i can take care of it manually.

Is there any concept of error log available??

Also how I can stop duplicacy of  posting same event message with respect to date time and location??(Any alternate way without using badi)


Former Member
0 Kudos

Hi Ratnakar,

Event Handler:

  1. If your setting is Asynchronous, when you create a sales order, it will be placed in queue (Transaction code SMQ1) to post in SAP EM System.  It calls BAPI /SAPTRX/BAPI_EH_POST & /SAPTRX/BAPI_EH_ADDEVENTMSG_02 .
  2. Check this FM /SAPTRX/AOTREF_UPDATE_DB & /SAPTRX/APPLOG_UPDATE_DB for logs when you create sales order.
  3. Go to the program /SAPTRX/LASC2F01 and set the breakpoint in form POST_TRACKING_OBJECT_DATA.
  4. Check in call function /SAPTRX/BAPI_EH_POST returned value of ‘ LT_OBJECTSTATUS’ & ‘P_BAPIRETURN[]’
  5. Check POSTSTATUS A  - Object Posted to Event Handler  or B - Object Acknowledged by Event Handler or C - Object Posting Rejected Due to Lock on Event Handler or D - Object Posting Rejected Due to Error in Event Handler (This data is coming from /SAPTRX/BAPI_EH_POST -> /SAPTRX/BAPIAOTYREF -> /SAPTRX/AOTRKSTAT)
  6. In tracking object status it gives you Tracking Object Number to track it for each sales order.
  7. Now, simulate your scenario with successful and unsuccessful sales order to check how to achieve.
  8. Also, try this /SAPTRX/LEH_BAPISU02 ->/SAPTRX/BAPI_EH_POST - CALL BADI l_badi_eh_s->before_eh_post

Event Message:

Go to the program /SAPTRX/LASC2F05 and set the breakpoint /SAPTRX/BAPI_EH_ADDEVENTMSG_02

You can stop reprocessing of same expect event if event message has already been received in SAP Event Management... Just uncheck the box of Reprocess Expected Event then it will ignore subsequent messages after first message is received.

Regards

GGOPII

P.S: Transaction code - SLG1 gives full log of sales order, however it has lot of records and may slow down.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ranakar,

You can check as below:

1. If BAPI return with error in ECC side, it can reside on ECC outbound queue

2. You can check whether there any entry made in Table /SAPTRX/AOTREF (reference between application objects and event handlers)

3. When event handler posted in SAP EM, the functional module BAPI_TRKOBJ_ACKNST

ATUS to update the status in Table /SAPTRX/AOTREF.

4. You can check the latest status using /SAPTRX/EH_LIST_STAT.

5. If none of them suits, then you have to use SAP Event Management preprocessing function to achieve this before create or update event handlers with your requirement.

Regards

GGOPII

Former Member
0 Kudos

Hello Ratnakar,

Your scenario is not very clear. I will try to answer your query from what I understood.

BAPI_EH_POST  -- This is used to Create Event Handlers

BAPI_ADD_MSG02 -- This is used to post event messages for the event handlers created in the previous step

Now,

1) If you are trying to find if the event handler is created or not, use /SAPTRX/EH_LIST  and search based on either "Tracking ID" or "Application Object ID". You should be knowing what is the tracking id and/or the application object id for your scenario

2) If you are trying to find event messages or events are posted for the above event handlers, use /SAPTRX/EVM_STAT and search based on event code set, event code & tracking id. Here you can choose the radio button options as the selection criteria "processed", "unprocessed", "Invaild Data", "All" etc.

Thanks,

Deb