SAP service usage

I am running into some “issues” with the “” 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 “” 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 “” works correctly. That is because if I take an outbound SAP document, convert it to a string using the “” service, I can then use that resulting string (it has valid DOCNUM, SEGNUM, PSGNUM values) as input to the “” and subsequently execute “” 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.

it will changes the flatfile to idoc formate