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