Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Idoc to flat file conversion: problem with mapping

Dear experts,

I have the following scenario: SAP (idoc) -> XI -> 3rd party

The idoc has s structure like this:

. ZSCX001 (idoc name)

... IDOC

..... ORDERHEADER

....... ORDERLINE

......... DELIVERY LINE

......... DELIVERY LINE

..... ORDERHEADER

....... ORDERLINE

......... DELIVERY LINE

......... DELIVERY LINE

etc

The flat file has this structure:

. FILENAME

... RECORD

..... FIELD1

..... FIELD2

... RECORD

..... FIELD1

..... FIELD2

etc

Now, per IDOC I need to create 1 file. For each delivery-line in the IDOC I need to create 1 record in the outputfile (flat file).

In message mappings, I did the following:

- messages-tab: Occurrence of the Idoc and inbound message type for flatfile: both 1

- design-tab: I linked IDOC to the FILENAME (so for each Idoc I create 1 flat file)

- design-tab: I linked the tag "Delivery line" to "RECORD" (I expected 1 record per delivery line)

When I test it, I only get 1 resulting record in the flat file, even if I test with 3 ORDERHEADER->ORDERLINE->DELIVERY LINE segments.

Can anybody tell me what I am doing wrong?

Thanks in advance,

William

Former Member
Former Member replied

Hi,

First make sure occurence of Record is 0..unbounded.

Second use the blow mapping rule..

Delivery line --->RemoveContext ---> RECORD

Regards,

Sarvesh

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question