I am trying to read an IDOC (in string format) with multiple records using the service “decodeString”, but the result seems to be erroneous as some fields in the idoc are wrongly parsed.
Any ideas/comments/suggestions will be highly appreciated.
you should use this service pub.sap.idoc:transformFlatToHierrachy (SAP AdapterService)which will parse the IDOC to IDATA structure based on the IDOC document structure reference.And I believe you have the particular IDOC DTD/Schema downloaded from SAP site the one that you are trying to parse.
I found the decodeString seems to be erroneous in reading multiple record IDOCS.Have you worked in similar scenario ?
Would appreciate and welcome to share your ecxperience in this regard.
I greatly appreciate your responses.I have gone through all the postings related to reading IDOC string.My probs is actually reading MULTIPLE record idocs.When used all the above discussed services to decode the input IDOC string from an MQ output, the decoded data does not have all the records in the IDOC.Hope now you have a clear picture about my issue.
Would appreciate any comments/ideas/suggestions regarding this.
I also am running into some “issues” with the “pub.sap.idoc:decodeString” service.
I receive an “Idoc String” from another application (not SAP). In this string, the DOCNUM, SEGNUM, PSGNUM values are not properly valued resulting in the corresponding values in the “IDOC_DATA” documents created in the pipeline not being correct. A subsequent execution of the “pub.sap.idoc:transformFlatToHierarchy” will understandably create an IS document with data “missing” and the structure inconsistent with the “true” IS doc type for the Idoc.
However, I know the “pub.sap.idoc:decodeString” works correctly. That is because if I take an outbound SAP document, convert it to a string using the “pub.sap.idoc:idocToString” service, I can then use that resulting string (it has valid DOCNUM, SEGNUM, PSGNUM values) as input to the “pub.sap.idoc:decodeString” and subsequently execute “pub.sap.idoc:transformFlatToHierarchy” to create a valid/correct IS doc type for the Idoc (including multiple Idoc situations).
It appears to me that the “Idoc string” MUST contain valid DOCNUM, SEGNUM, PSGNUM values. If they are not supplied or are not correct, is there a way to “fix” the “Idoc string” other than brute force (e.g. parsing through the string, fixing up the values which in turn requires knowledge of the specific Idoc structure)?
Thanks in advance for any assistance/thoughts on this question.