cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc to flat file conversion: problem with mapping

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

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

Second use the blow mapping rule..

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

Regards,

Sarvesh

Answers (1)

Answers (1)

Former Member
0 Kudos

make the occurance of Record type to 0 to unbounded and map the Root of delivery line to record type.

U must have delivery line occurance also 0 to unbounded.

chirag

Former Member
0 Kudos

Hi Chirag,

Thanks, but it has already been done like you described.

regards

William

Edited by: JWD on Nov 25, 2009 4:35 PM

Former Member
0 Kudos

Have you used the mapping the way I suggested.

Former Member
0 Kudos

Hi Sarvesh,

thanks yes I just did it but I still only get 1 record in the output...

Former Member
0 Kudos

let me understand ur delivery line is repeating or ordertype.

Did u checked the Queue of Delivery line how it is shown and the record type-- the output queue shud be in one context.

chirag

Former Member
0 Kudos

Hi Shirag,

can I send you a screenshot of the problem via mail?

Former Member
0 Kudos

u can but this is open forum where u can get more inputs so i prefer to have discussion on the same.

u can upload the screen shot and provide the link here

chirag