cancel
Showing results for 
Search instead for 
Did you mean: 

1 File - XI - Multiple IDOCS issue

0 Kudos

Hello,

We have a PlainFile–TO–Idoc SAP XI Scenario. We have configured everything and it is working fine. However, we have a new requirement: every plain file can contain multiple IDOCs. I mean, in the text file we can have something similar to this:

HEADER;0200000140;AH02;20061205

REGISTRY;000000000000000011;AH02

REGISTRY;000000000000000012;AH02

REGISTRY;0200000144;AH03

HEADER;0380000990;AH02;20061205

REGISTRY;000000000000000012;AH02

Where:

HEADER;0200000140;AH02;20061205

REGISTRY;000000000000000011;AH02

REGISTRY;000000000000000012;AH02

REGISTRY;0200000144;AH03

It should create an IDOC and

HEADER;0380000990;AH02;20061205

REGISTRY;000000000000000012;AH02

It should create another one.

So, in this case XI should receive 1 file and R/3 system should receive 2 IDOCs. But, it is not working. We have investigated several XI forums and finally we found that in the Message Mapping there’s a tab (Messages) where you can indicate the occurrences of each message. If we try to set the IDOC Message as unbounded, the message structures in the Message Mapping changes from:

For the file:

MT_Struct

IDOC

E1SEGMENT1

FIELDs

E1SEGMENT2

FIELDs

For the IDOC:

IDOC_NAME

IDOC

BEGIN

EDI_DC40

E1SEGMENT1

FIELDs

E1SEGMENT2

FIELDs

To something like this:

For the file:

Messages

Message1

MT_Struct

IDOC

E1SEGMENT1

FIELDs

E1SEGMENT2

FIELDs

For the IDOC:

Messages

Message1

IDOC_NAME

IDOC

BEGIN

EDI_DC40

E1SEGMENT1

FIELDs

E1SEGMENT2

FIELDs

Now the problem is that the message mapping fails because we are not able to create an XML structure with more than 3 levels deep. The mapping process returns “Cannot produce target element /ns0:Messages”.

When we had 1 File –> 1 IDOC, the file sender content conversion was configured, for example, as follows:

Document Name: MT_Struct

Recordset Name: IDOC

Recordset Structure: E1SEGMENT1,1, E1SEGMENT2,*

Key Field Name: KField

E1SEGMENT1.fieldSeparator: ;

E1SEGMENT1.keyFieldValue: 1

E1SEGMENT1.fieldNames: KField, Field1, Field2

E1SEGMENT1.endSeparator: ‘nl’

E1SEGMENT1.ignoreRecordsetName: true

E1SEGMENT2.fieldSeparator: ;

E1SEGMENT2.keyFieldValue: 2

E1SEGMENT2.fieldNames: KField, Field1, Field2, Field3, Field4

E1SEGMENT2.endSeparator: ‘nl’

E1SEGMENT2.ignoreRecordsetName: true

This configuration generated something like this:

But we don’t know how to generate the XML tags for the fields: “Messages” and “Message1” because the content conversion configuration does not allow generating 3 or more level structures deep.

So can you tell us how to solve this problem? Is there anything we can do to configure SAP XI so we can send 1 File to multiple IDOCS.

Thanks in advance.

Roger Allué Vall

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Roger -

Given that you original scenario was working fine, another approach to this would be to use the "Recordsets per Message" parameter (setting it to 1) in your sender file adapter config. Given that your recordset is something like: <i>HEADER, 1, REGISTRY, *</i>, adding this new parameter would send a new message for each HEADER, REGISTRY recordset at the adapter level (there would be a separate resulting IDOC for each new message as well). That way, you wouldn't need to change any mappings or anything else from your original working scenario.

Regards,

Jin

0 Kudos

Thank you Jin!

This solved the problem!!!!

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Just change the occurrence of IDoc as mentioned in the below weblog. Then your issue should be resolved:

/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change

---Satish

Former Member
0 Kudos

have a look at Anish's weblog, /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping

Hope this will help you.

Thanks

Pooja