!--a11y-->
Adding Attachments to Event
Messages 
You can add attachments to an event message that you want to send to SAP Event Management (SAP EM) for an event handler. When you add an attachment to an event message in the Web interface, you can perform a virus check before sending the event message to SAP EM.

For example, you want to report a delay due to an accident and also send a photograph of the scene of the accident and your digital signature.
Prerequisites for Adding an Attachment to an Event Message Using a BAPI or a Function Module
● The system administrator has defined criteria for saving event messages.
For more information, see the Implementation Guide (IMG) for SAP Supply Chain Management under Event Management ® Event Messages, Status Queries, and Web Interface ® Define Criteria for Event Message Processing.
Prerequisites for Adding an Attachment to an Event Message in the Web Interface
● The system administrator has configured the settings for this function for your user using the event message profile, which is part of the user profile.
The administrator has defined a configured field for adding an attachment to an event message and has assigned this configured field to your event message profile. As a result, you can see and send attachments to an event message.
The administrator has created the configured field with ATTACHMENTS as the EM Attribute ID.
The system automatically specifies EVENTMESSAGE as the corresponding EM object.
For more information, see the Implementation Guide (IMG) for SAP Supply Chain Management under Event Management ® Event Messages, Status Queries, and Web Interface ® Web Interface ® Define Fields for User Profiles and Assign User Profiles and Web Interface Transactions to Users.
● If you want to use a virus check in the Web interface, the system administrator has configured a Virus Scan Provider in the J2EE Engine Visual Administrator.

For more information about the Virus Scan Interface and configuring a Virus Scan Provider, see the SAP Library under SAP NetWeaver ® Security ® System Security ® Virus Scan Interface.
For more information about the Virus Scan Interface, see SAP Note 786179.
● If the system administrator has configured a Virus Scan Provider, he or she has also defined the following on the Admin page of the Web interface. He or she has defined the parameter value TRUE for the Virus Scan Execution parameter in the Global Manager.
Adding Attachments to an Event Message Using a BAPI or a Function Module
...
1. Place the file in the network, from which the system calls the following:
BAPI EventHandler.AddEventMessages02 or function module /SAPTRX/BAPI_EH_ADDEVENTMSG_02
2. Split the file up so that the length of each individual block does not exceed 255 characters.
3. Enter the blocks into table TRACKFILEBIN (binary file) or TRACKFILECHAR (text file).
4. Fill the following fields in header table TRACKFILEHEADER:
○ EVTCNT
○ FILENAME
○ FILECLASS
○ MIMETYPE
○ FILESIZE
○ NUMLINES
5. Call BAPI EventHandler.AddEventMessages02 or function module /SAPTRX/BAPI_EH_ADDEVENTMSG_02 with table TRACKFILEBIN (binary file) or TRACKFILECHAR (text file) and header table TRACKFILEHEADER.
6. The system saves the file in the database and on the hard disk, if necessary.
For more information about saving event message attachments on the hard disk, see the Implementation Guide (IMG) for SAP Supply Chain Management under Event Management ® Event Messages, Status Queries, and Web Interface ® Define Criteria for Event Message Processing.
Adding Attachments to an Event Message in the Web Interface
...
1. Choose either the fast entry page or an action for sending event messages on the search results page of the Web interface.

The system administrator has created at least one configured field with ATTACHMENTS as the EM Attribute ID.
A browse pushbutton is available next to this field in the Web interface.
2. Choose Browse.
A new window appears from which you can navigate to the file on your PC that you want to attach to the event message.
3. Attach the file to the event message and send the event message to SAP EM.
Before the Web interface sends the attachment to SAP EM, the Virus Scan Provider performs a virus check. If, for example, it finds a virus or a connection problem occurs, you get a warning message. This warning message informs you that the Web interface cannot send the attachment. The Web interface provides detailed information about the error on the Admin page.
