cancel
Showing results for 
Search instead for 
Did you mean: 

EH generation

Former Member
0 Kudos

Dear EM experts

The BAPI /SAPTRX/BAPI_EH_ADDEVENTMSG_02 has an Option EH_GENERATION_MODE. The documentation says, the Option A has an effect that all Messages generate an EH without customizing check. When I run the BAPI, I get the error "no active Event handler found", but the message Details are updated in EVM_HDR. Would it be an Option to put A into the EH_GENERATION_MODE to resolve this issue? and if so, what is the function module that I have to fill into field EH_GENERATION_FUNCTION.

Any other other tips how I can get the message tobe processed and put into the execution tab of the freight unit?

Thanks in advance

Petra

Accepted Solutions (1)

Accepted Solutions (1)

former_member190756
Active Contributor
0 Kudos

Hello Petra,

this option is for scenarios where you have no application system e.g. postal scenarios.

The EH is not generated automatically you have to create a function module where you code your logic to create all the EH data. For EM TM sceanrio this is not needed.

Best regards,

Steffen

Answers (2)

Answers (2)

pietro_marovello
Explorer
0 Kudos

Dear All,

in my "standard scenario" I have a custom application object against which an event handler is created and later the events are posted.

Also, I might have an event posting related to an event handler that is not created yet: in this case I have to create it. So, this means that option A has to be set up in the BAPI /SAPTRX/BAPI_EH_ADDEVENTMSG_02? The BAPI creates the EH only if the event handler does not exist in the EM system?

Best regards,

Pietro

former_member186607
Active Contributor
0 Kudos

Hi Pietro,

if you want to create a new EH based on an event message (BAPI /SAPTRX/BAPI_EH_ADDEVENTMSG_02), you can use EH generation function for this requirement.
You have to implement then such a EH generation function that fits your needs. You can configure your EH generation function via IMG activity "Define Criteria for Event Message Processing".

In the EH generation function you can e.g. first check if an EH already exists and only create new EH if this checks fails. You can check function module /SAPTRX/PTA_AUTH_EH_CREATE_HV as an example. This is used in PTA scenario, where authentication event message comes in for not existing EH.

Best regards, Daniel

Former Member
0 Kudos

Hi Petra,

The below information has provided by SAP in Option A for EH_GENERATION_MODE

"Each event message generates an event handler (no check in Customizing table).

In this case, you must specify the name of the function module that generates the event handlers in variable EH_GENERATION_FUNCTION".

If you want to create manually event handler in SAP EM then you can use Tcode /SAPTRX/EH_CREATE.

I just want to understand whether all basic configurations completed in SAP EM <-> SAP TM.

Can you check this discussion and check activity template FM /SAPTRX/TMS_UPDATE_FU

Regards

GGOPII