SAP BC 4.6 transformFlatToHierarchy problem

[FONT=Helv][SIZE=2]I have a small problem with the SAP service pub.sap.idoc:transformFlatToHierarchy in SAP BC 4.6. Once this service is called, the fields (segnum, psgnum, hlevel, mandt, docnum) are not present in any of the data segments in the hierarchical structure returned, but only mandt and docnum are correctly populated in the EDI_DC40 segment in the returned structure… is there a particular reason why these 5 fields are not present in the data segments of hierarchical structure returned by the service transformFlatToHierarchy ? what I find strange is that these 5 fields are present in all data segments in the IDOC_DATA_REC_40 that SAP send to the connector, so I don’t see any reason why they are not replicated in the hierarchical structure…

Thanks in advance for your help,

Ricardo
[/size][/font]

Ricardo,

As far as I know these fields indicate the relation between the segments in the data records in the flat IDoc structure. They are used by the transformFlatToHierarchy service to correctly create the hierachical IDoc structure, and you do not need them anymore.

Is there a specific reason why you would need these fields in the hierarchical structure?

Kind regards,

Koen

I’m not sure if they are really needed… but the SAP people doing the validation are asking for these fields to be populated… cuz when these files are generated directly within SAP, all these fields are present…

Much thanks for your help,

Ricardo

Why do SAP care about this fields in the order as the IDOC was sent outbound from SAP which you would be doing transformation to some other format routing logic that destination is expecting??Any good reason behind like you need to extract that info and map to another document??

HTH,
RMG

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

Its not bad idea though…you got everything in the boundNode and it resolved your issue…what if you give the actual IDOC recordReference the doctype that will have control/data rece IDOC/EDI_DC40,ORDERS03 (as an example)…were you able to see all the required segments/fields??

HTH,
RMG

Not sure I completely understood your question… I have no choice but to use the IDOC_DATA_REC_40 and IDOC_CONTROL_REC_40 structures that my service receives from the SAP BC 4.6… my service is defined as a routing rule in Patner Manager for a particular IDOC msgtype (INVOIC, ORDRSP, CARNOT, etc…).

Regards,

Ricardo

“what if you give the actual IDOC recordReference the doctype that will have control/data rece IDOC/EDI_DC40,ORDERS03 (as an example)…were you able to see all the required segments/fields”
I was asking in the o/p of flattohierarchy step by mapping the boundNode to recordReference(assign actual IDOC record type) is not populating all the fields ie EDI_DC40 with control fields ,INVOIC02 data fields?? Well it should at this point.

Anyways lets close the issue,as it was got resolved.

HTH,
RMG