IDocDecode
The service converts an XML string in a format that is specified by the SAP IDoc-XML specification into an IDoc that is of the type com.sap.conn.idoc.IDocDocumentList and necessary for an RFC call (that uses clientSendIDoc).
- Input parameters
-
- bytes- OR -
- Byte array. Contains the data to be decoded as IDocXML.
- node - OR -
- XML Node object that represents the IDocXML data. For example, you get a node when putting an XML file through FTP with an xml extension. The service checks in that order if an input document is available: xmlData, bytes, node.
- xmlData
- String. IDoc in XML. The XML format is consistent with the SAP IDoc-XML specification.
Note: You can specify the bytes or node or xmlData in the input parameters.
- Return values
-
- $encoding
- Specifies the encoding from the input document's XML header, for example, iso-8859-1.
- iDocList
- Contains the IDocs as an object of the type com.sap.conn.idoc.IDocDocumentListcom.sap.conn.idoc.IDocDocumentList.
Example
This service is the first service that is called when you want to send an IDoc-XML document to an
SAP system. The following is a sequence of service calls that take an IDoc in XML format, convert it
to a com.sap.conn.idoc.IDocDocumentListcom.sap.conn.idoc.IDocDocumentList object, then fire it into
the SAP system:
- Start IDocDecode service. It takes the input xmlData (the XML String) and creates an com.sap.conn.idoc.IDocDocumentList object that is in RFC-ready form. (This means that it matches the RFC call used to send an IDoc into the SAP system, and that the pipeline is almost in the required format).
- Start clientCreateTID service. Use this service to request a transaction ID from an SAP system
that can be used for sending the IDoc to the SAP system.Note: Store this transaction ID so that you can resend the IDoc if any errors with the same ID.
-
Start clientSendIDoc.