Skip to main content
Version: 5.6

IDoc Trigger

The IDoc trigger is used when the OPC Router is to receive IDocs from the SAP® system. The SAP® system initiates the data transfer via the IDoc trigger. The configuration on the SAP® side is explained here only in general terms; please refer to the SAP® documentation for details.

Dialog Overview

SAP IDoc Trigger – Settings

The screenshot shows the selection of the SAP® connection and the IDoc type, as well as the configuration of the program ID, gateway service, and parameters.

Settings

PropertyDescription
SAP ConnectionAll SAP® connections created in the Plug-ins section are available for selection here. If the desired connection does not yet exist, you can make it available in the Plug-ins section as an SAP® Connection.
IDoc TypeIDoc type that triggers the action when sent. Ideally, this should match the type set in the IDoc transfer object.
IDoc ExtensionClass extension of the IDocs.
Program IDProgram ID used by the SAP® system to call the destination; identical to the program ID of transaction SM59.
Gateway ServiceGateway service of the SAP® system.
OutputOutput as JSON document: Provides the received IDoc as a JSON document. Output empty strings as null: Outputs empty strings as null.

Parameters

PropertyDescription
Available ParametersSelect the required parameters by checking the corresponding boxes. You can also select entire categories.
Copy JSON FormatCopies a JSON document to the clipboard whose structure corresponds to the function call.
warning

Important: The program ID is evaluated character-for-character (case-sensitive) and must match exactly the entry in the SAP® transaction SM59. Capitalization is common and recommended, but not mandatory. The combination of host (SAP connection), gateway, and program ID must be unique. Starting with version 3.1.1.5, the program ID itself can be used multiple times—but only with different gateways/hosts.

warning

Important: If an IDoc is updated or modified in the SAP® system, the trigger must also be adapted to the new IDoc.

HTTP Endpoint

Using the “HTTP Endpoint” tab, the OPC Router can also receive IDocs via an HTTP or HTTPS endpoint.

SAP IDoc Trigger – HTTP Endpoint

PropertyDescription
Enable HTTP Service for Receiving IDocsEnables the HTTP endpoint through which IDocs are received.
PortPort on which the HTTP endpoint is accessible.
Basic AuthenticationIf enabled, access requires logging in with a username and password.
Username / PasswordCredentials for Basic Authentication.
Enable SSLMakes the endpoint available via HTTPS and encrypts the transmission.
SSL CertificateCertificate used for the HTTPS connection.

Advanced

Use the “Advanced” tab to control the status feedback of received IDocs to the SAP® system.

SAP IDoc Trigger – Advanced

PropertyDescription
IDoc AcknowledgmentIf enabled, the OPC Router records the transfer result in the IDoc’s status after processing and reports it back to the SAP® system.
Status on Successful TransferIDoc status set upon successful processing, for example, Dispatch OK (Status 12).
Status on Failed TransferIDoc status set when processing fails, for example, Error during dispatch (Status 11).
ResendIf enabled, IDocs that have not yet been completed with an acknowledgment from the OPC router are retransmitted at startup.
Recipient Partner NamePartner name to which the status update applies.
Minimum Document NumberLowest IDoc document number starting from which the status update or resend is taken into account.

Example

Settings for the IDoc Trigger:

PropertyConfiguration
SAP Connection<sap-anbindung>, through which the relevant function is accessed.
IDoc TypePRODUCTIONORDER
Program IDINRAYTRIGGER
Gateway ServiceGateway service of the SAP® system, for example 3302

Logical System in SAP® Transaction BD54:

PropertyConfiguration
LogSystemOPCRIDOC01
DescriptionOPC Router with IDoc Listener

Corresponding SAP® Settings, SM59:

PropertyConfiguration
DestinationOPCROUTER
Connection TypeT TCP/IP
Activation TypeRegistered server program
Program IDINRAYTRIGGER
Gateway Host(no entry!)
Gateway Service(no entry!)

Port in SAP® Transaction WE21:

PropertyConfiguration
(Type)Transactional RFC
Portfor example, IDOCPORT
Version(select the appropriate IDoc version)
RFC DestinationOPCROUTER

Partner Agreement in WE20:

PropertyConfiguration
(Partner Type)LS (Logical System)
Partner NumberOPCRIDOC01

Output Parameters in WE20:

PropertyConfiguration
Receiver PortIDOCPORT
Output ModeTransfer IDoc Immediately
IDoc Type/Base TypePRODUCTIONORDER
Syntax Check(Enabled)

For manual testing, you can send an IDoc via WE19 by specifying the partner number and port. Be sure to select “Start Outbound IDoc Processing Immediately.” Errors can be viewed in WE07. The function to be called in SAP® is IDOC_INBOUND_ASYNCHRONOS (as of 4.0) or INBOUND_IDOC_PROCESS (3.x).