Don’t know if this is the best solution, but somehow it seems to work…
I found out that the IDOC_DATA_REC_40 that contains all the data segments, that SAP sends us, is a document list structured like this:
IDOC_DATA_REC_40
IDOC_DATA_REC_40[0]
SEGNAM
MANDT
DOCNUM
SEGNUM
PSGNUM
HLEVEL
SDATA
ALL DATA FIELDS OF THE SEGMENTS
IDOC_DATA_REC_40[1]
SEGNAM
MANDT
DOCNUM
SEGNUM
PSGNUM
HLEVEL
SDATA
ALL DATA FIELDS OF THE SEGMENTS
Only the fields in the SDATA are mapped in the bound document returned by the transformFlatToHierarchy… so I decided to replicated and copy the 5 fields in the SDATA part… so I created a document type similar to the IDOC_DATA_REC_40, but that includes also the 5 fields in the SDATA part, and to map it the values of same fields found in the parent, and to use this document when calling the transformFlatToHierarchy… this is what the new document type looks like:
IDOC_DATA_REC_40
IDOC_DATA_REC_40[0]
SEGNAM
MANDT
DOCNUM
SEGNUM
PSGNUM
HLEVEL
SDATA
SEGNAM
MANDT
DOCNUM
SEGNUM
PSGNUM
HLEVEL
ALL DATA FIELDS OF THE SEGMENTS
IDOC_DATA_REC_40[1]
SEGNAM
MANDT
DOCNUM
SEGNUM
PSGNUM
HLEVEL
SDATA
SEGNAM
MANDT
DOCNUM
SEGNUM
PSGNUM
HLEVEL
ALL DATA FIELDS OF THE SEGMENTS
This works! the Bound Document returned contains all 5 fields in all segments…
Thanks again,
Ricardo
#Integration-Server-and-ESB#webMethods#Flow-and-Java-services