I am facing a weird issue. I am mapping an IDOC segment in the MATMAS05 idoc. All the mappings are correctly done. However at runtime , the order of the fields in the IDOC is getting jumbled up and as a result when I am converting the IData to IDOC some of the fields which are out of alignment are getting omitted. Now how the fields are going to get mapped during runtime that I cannot control , hence what is the solution to this issue. Its a very weird issue , nothing is wrongly done yet fields are getting missed.
Also, Do you mean the values in IDOC is getting jumbled? How are you creating IDOC? Are you using any internal services when receiving the document from SAP system?
Are you seeing any pattern in jumbled values i.e. result structure is constant for multiple runs but its different from defined referenced document type structure ?
Have you applied SAP adapter fix as well (as you are using SAP Built-in service)?
Try to use pipeline variable substitution option and check if the issue gets resolved.