IDocEncodeString
The service encodes an IDoc to a String equivalent, the format that is used by the file port of an SAP system. The service first checks for the iDocList field, whether that parameter is not present, it looks for the IDOC_* record lists.
Note: When saving to a file, make sure that the string is saved with correct encoding.
- Input parameters
-
- serverName
- SAP system alias, which is used as repository for structure information about the IDoc. The name must match a configured RFC connection alias at SAP® ERP.
- iDocRelease
- Optional. SAP system release that the IDoc is sent to.
- $encoding
- Optional. Specifies the encoding that is used in the output document's XML header, for example, iso-8859-1.
- iDocList- OR -
- Contains the IDocs as object of com.sap.conn.idoc.IDocDocumentList.
- IDOC_CONTROL IDOC_DATA - OR -IDOC_CONTROL_REC_40 IDOC_DATA_REC_40
- 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.
Note: You can specify the iDocList or IDoc tables that contain IDOC_CONTROL and IDOC_DATA or IDOC_CONTROL_REC_40 and IDOC_DATA_REC_40 in the input parameters.
- Return values
-
- iDocString
- String. IDoc in the file port.