cancel
Showing results for 
Search instead for 
Did you mean: 

Posting EM events

Former Member
0 Kudos

Hi experts,

we have set up the basis EM now (Mainly, we defined an rfc Connection to the same Client and assigned this to the event Manager EM1 in spro-> integration to other components->...-> EM Interface and assigned this application System to each Event type in spro -> EM -> application object types and Event types).  We are using BAPI /SAPTRX/BAPI_EH_ADDEVNTMSG_02 to try and post These Events to the freight unit.

We are filling the following data:

TRACKINGHEADER:

EVTCNT = 0000000006

EVTID = LOAD_END

TRXCOD = FU

TRXID = PHU-0034 (the freight unit number)

EVTDAT = 04.12.2014

EVTTIM = 16:45:00

TRACKLOCATION:

EVTCNT = 000000006

LOCCOD = 0001

The system now has an event handler that I can view in Transaction /n/SAPTRX//EH_LIST. It has the expected events defined for this freight unit type and it has a tab where I can see the event messages and the Errors, but there is no error message and the event is not visible in the execution tab of the freight unit. What is missing?

Thank you for any tips. In the meantime, we will test all kinds of combinations.

Petra

Accepted Solutions (1)

Accepted Solutions (1)

former_member190756
Active Contributor
0 Kudos

Hello Petra,

how do you send the message? SE37? -> http://scn.sap.com/docs/DOC-35878

What comes back from the BAPI in the BAPI return table?

Do you see the message in /n/SAPTRX/EVM_STATUS? What status it has.

Did the Locations from the message match with the locations from the Expected Event?

-> You could temporarily switch this check off in /n/SAPTRX/TSC0EE per Expected Event for testing

Best regards,

Steffen


Former Member
0 Kudos

Steffen and all other people who are so kind to help me here,

thanks for your feedback. I am posting the Events using se37 and the bapi (as described in the description of the msg).

I would definitely like to switch off the check of the locations in the expected events and all other checks against ee. We need to post actual events and do not need to check anything against expected events. Also, we will only post load end and unload end  and arrival departure events, plus some other custom events. When I unclick the generate button in the transaction that u suggest (thank you!), I still get the same result. The BAPI has no message in the result structure. It has a blank entry with a message id, but no message.

But, the event handler has a log and it is related to the ee check.

We have little time in this project and we only need to see actual events. Can we switch off the exp Events? If yes, what is the best way?

Thanks so much

Petra

former_member190756
Active Contributor
0 Kudos

Hello Petra,

the last entry in the Log is pointing to the problem:

Message processing aborted. Not in List of allowed Event Codes.

This should be related to a wrong location. You send a message for an Expected Event but the location does not match. For EM this is then an Unexpected Event.

You should just enter the Location that you see in EH_LIST for your Event when you call the
BAPI /SAPTRX/BAPI_EH_ADDEVNTMSG_02. Afterwards it should work.

Best regards,

Steffen

Former Member
0 Kudos

Hi,

have removed the expected event profile. now, load_end must be configured as an unexpected event. In order to do that, I will copy the standard event handler onto a custom event handler because the standard treats that as an expected event. In order to test if I can post any event, I have used an unexpected standard event "Damage". It works now. But, I can see the damage event only after I insert another event manually and also the date, time and location is not filled.

I have some testing work in front of me.

Thanks for your help

Regards

Petra

Former Member
0 Kudos

was able to resolve the issue with the date and time. Fill EVTTST field with 08.12.2014 10:45

.But the Problem with the Events not being updated unless I say insert Event manually is still open.

Former Member
0 Kudos

Hi Petra,

I am confused. Did not you already mark Steffen's answer as "Correct answer" ?

Can you please do the following ?

1) Send me a screenshot of the Event handler type

2) Also, execute the BAPI in sequence with BAPI_TRANSACTION_COMMIT

Thanks,

Deb

Former Member
0 Kudos

hi Deb,

sorry, wanted to award you points for your contribution. Had overseen that I had already given points to Steffen.

1. Event handler type attached

2. I do not understand your question

I still have one Problem that the Events only Show after I have inserted "insert Event" and not before. Maybe, this is resolved by doing a BAPI_TRANSACTION_COMMIT and not just a Manual run of the FM in SE37?

Former Member
0 Kudos

Hi Petra,

You mean to say that Internal Event Code "Damage" is not updating.  If yes, do the below steps:

1. Fill up all required fields in BAPI /SAPTRX/BAPI_EH_ADDEVENTMSG_02 and include Tracking Modify as per your data in below fields.

MODCNT                         0000000003

EVTID                          DAMAGE

MODREF                         0000000000

LOCID1                         0001

LANGUAGE                       EN

ETXDAT                         08.12.2014

ETXTIM                         16:00:00

ETXZON                         CET

ETXTST                         08.12.2014 16:00

2. Set the breakpoint in inside the BAPI FM /SAPTRX/EVTMSGCHECK_02 and check it is populating in is_evm_tables-ee_modify.

3. If data are populating in internal structure then move on to next step.

4. Check line 114 gives sy-subrc <> 0 and finds your internal event code from table /saptrx/evcode.

5. If everything looks good then check it is updated your event.

Check and let us know.  If this is not you are looking, then give us screen shots and steps to direct you to right path.

Regards

GGOPII

former_member186607
Active Contributor
0 Kudos

If you are sending event messages for test purposes manually via SE37 ni SAP EM (with BAPI /SAPTRX/BAPI_EH_ADDEVENTMSG_02), you have to follow the steps described in this document: http://scn.sap.com/docs/DOC-35878

Otherwise the RFC call to TM will not be done and therefore no update in TM will be done.

Best regards, Daniel

Former Member
0 Kudos

Hi Petra,

As per your screenshot of the event handler type, I can see there is an "expected event profile".

Please do the following:

1) Go to the expected event profile,

2) copy to a custom one,

3) switch check location 'off'

4) Execute BAPI and BAPI_COMMIT in sequence

5) Check if the actual event is coming on to the /SAPTRX/EH_LIST

    NOTE: Do not check on the execution tab yet

Please let us know your test results.

Thanks,

Deb

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Petra,

Can you paste the log of event handler if you have activated to check?

Go to Event handler detail overview in Event Handler -> Click Display Event Handler Application log -> Copy the log data and paste here.

We can check and let you know.

Regards


GGOPII

Former Member
0 Kudos

Hello Petra,

Few things we need to check here:

1) Where are you posting the events from and how ?

  • OR via SE37 and calling the BAPI in EM
  • OR via EDI/IDOC in EM
  • OR via /SAPTRX/MI02 in EM
  • OR via FO execution tab in TM

2) Check your expected event profile, if it has location/partner/data code check on: May be that is failing

3) Check /SAPTRX/EVM_HDR and /SAPTRX/EH_EVMSG if you see the reported message

4) Check your application log to see if you have received the error message "Message processing aborted"

5) Are you using custom internal event codes or standard event codes ?

Please answer the following and we should be able to dig down to the root cause

Thanks,

Deb

Former Member
0 Kudos

Hi Deb,

1) se37, using BAPI

2) I have unassigned the ee Profile (we do not need ee in this project)

3) in table *_EVMSG, I see only a msg guid, in table ..EVM_HDR, I see the Event with the related Event data, but no message

4) no, the message has not aborted

5) I am using Standard internal event codes and custom internal Event codes, but the ones I am testing are standard

I have now unassigned the ee Profile and will try to create a new freigth unit to see if I can post an Event now.

Regards and many thanks

Petra