Adapter for SAP 10.1 | webMethods Adapter for SAP Documentation | webMethods Adapter for SAP Installation and User’s Guide Documentation | Built-in Services | IDoc-XML Services | pub.sap.idoc:encode
 
pub.sap.idoc:encode
Service that converts an IDoc list to an XML string in a format specified by the SAP IDoc-XML Specification.
Input Parameters
iDocList
- OR -
Contains the IDoc(s) as object of the type com.sap.conn.idoc.IDocDocumentList.
IDOC_CONTROL
IDOC_DATA
- OR -
IDOC_CONTROL_REC40
IDOC_DATA_REC40
Both keys are Document lists (Tables) containing the control and data tables for the IDoc.
The SDATA field is a Document object containing the keys and values from the segment table (the name of the segment table is specified by the SEGNAM field).
Note:
This service handles both IDoc versions 2 and 3. The difference between the two is that, for IDocs version 2, the service looks for IDOC_CONTROL and IDOC_DATA in the pipeline. For IDocs version 3, it looks for IDOC_CONTROL_REC_40 and IDOC_DATA_REC_40.
$encoding
Optional. Specifies the encoding used in the output document's XML header, e.g. iso-8859-1
Return Values
xmlData
String. The IDoc in XML. The XML format is consistent with the SAP-XML specification.
Example
This service is most often used when you want to receive an IDoc from an SAP system and convert it to XML.
*Invoke pub.sap.idoc:encode. This takes the pipeline containing the IDoc as input and converts it to an XML string. The XML string is accessible in the pipeline via the xmlData key.