IDoc usage with JRA

Definition

An IDoc class library is available for Java applications that support communication based on IDocs. In the following section you will learn how to use IDocs with the Java Resource Adapter. Several programming examples will illustrate the JRA-specific procedure for IDoc usage..

The IDoc Library offers the interface com.sap.conn.idoc.IDocXMLProcessor to handle IDoc data, which essentially boils down to converting it into or from an XML string. In addition to this interface the JRA offers a toXML() method through its com.sap.mw.jco.jra.XMLConverter interface which renders the IDoc of a com.sap.conn.jco.JCoRecord into an XML string.

The required classes and interfaces are available within the package com.sap.mw.jco.jra.idoc except for the IDocMessageListener (tRFC) and QueuedIDocMessageListener (qRFC). They are part of the common JRA functionality which can be found in com.sap.mw.jco.jra . Using QueuedIDocMessageListener you can send IDocs via qRFC in a specified order (EOIO: exactly once in order).

Note

This functionality is not only used for IDoc processing. It was already available before the introduction of IDocXMLProcessor and is preserved to guarantee downward compatibility. It is strongly recommended to employ the IDocXMLProcessor functionality. The corresponding JRA parse method fromXML(String xmlDocument) has already been deactivated because of its limited functionality. It now throws a javax.resource.NotSupportedException .

From the ABAP side JRA (internally) handles three function modules which exclusively deal with IDocs:

IDOC_INBOUND_ASYNCHRONOUS

  • Will be used for SAP-Release 4.0 or higher (IDoc Version 3)

  • Used in conjunction with

tRFC INBOUND_IDOC_PROCESS

  • Will be used for SAP-Release 3.0/3.1 (IDoc Version 2)

  • This function module assures compatibility to older SAP-Releases

  • Used in conjunction with

tRFC IDOC_INBOUND_IN_QUEUE

  • Will be used for SAP-Release 4.0 or higher (IDoc Version 3)

  • Used in conjunction with qRFC