cancel
Showing results for 
Search instead for 
Did you mean: 

Sending multiple idocs to sap based on condition

Former Member
0 Kudos

Hi Experts,

I want to generate multiple idocs at the target,from a single message coming from the sender file system.

The splitting of the message should happen in XI only if-

1.The segment X coming multiple times in source message

2.If plant field in the segment XI is is 123

Please help me with the conditions in the mapping and settings in XI to generate multiple idocs at the target side.

Regards,

Suresh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Create XSD of IDOC and change occounrace of IDOC to 0 to unbounded.

Now use this XSD as target message type in your mapping.

Use Exists function in IDOC node mapping as per your requirement. It will solve your issue.

Let me know if you have any doubts.

-Gouri

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi suresh,

try with the below mapping ..

Use ifWithOutElse.

if Plant(field of segment X) equalsS "123", then map segment X directly to the required target node(occurrance should be 1..n). Hope this works.

Regards,

Swetha.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>1.The segment X coming multiple times in source message

connect this segment X with IDOC segment in the mapping ( after you change the occurance of the IDOC from 1..1 to 1...unbounded)

what's the issue here anyway ?

Regards,

Michal Krawczyk

Former Member
0 Kudos

Thanks for the information.

This is actually a change of the existing interface.

In mapping the the top node(name is IDOC) of target structure XSD is already mapped 1-1 with the source structure (XSD )top node(name is IDOC).

If i remove the mapping and link X segment of source to target IDOC node, will it not cause a problem in generating message at runtime.

Regards,

Suresh.

Former Member
0 Kudos

Hi Suresh,

As far as i know,Unless you change the occurance of the IDOC from 1.1 to 1..unbounded, it is not possible to generate multiple Idocs. Changing the occurrance doesnt cause any problem during run time.

Former Member
0 Kudos

Hi Friends,

I am trying to change the occurance of XSD by exporting out from XI into notepad. But the problem is i dont know where to add the entry maxOccurs="unbounded".

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

But my XSD structure is something different. please check below-

<?xml version="1.0" encoding="UTF-8" ?>

- <wsdl:definitions targetNamespace="" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

- <wsdl:types>

- <xsd:schema version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

- <xsd:element name="WMMBID02">

- <xsd:annotation>

<xsd:documentation>Stock movements</xsd:documentation>

</xsd:annotation>

- <xsd:complexType>

- <xsd:sequence>

- <xsd:element name="IDOC">

- <xsd:complexType>

- <xsd:sequence>

- <xsd:element name="EDI_DC40">

- <xsd:annotation>

Please help !!

Regards,

Suresh.

former_member181962
Active Contributor
0 Kudos

Hi Suresh,

I'm not sure how you did that, but here is what you should do.

You should go to the XSD tab and not the WSDL tab and then copy the xsd file into a note pad.

then change the occurance.

Rehards,

Ravi

former_member200962
Active Contributor
0 Kudos

You cannot perform a multimapping (1:N) since IDOC does not support it...however you can do IDOC bundelling (refer blog by MIchal on this)

former_member181962
Active Contributor
0 Kudos

Hi Suresh,

You can make use of the famous IDOC Occurance change trick:

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

Then map the source node which can occur multiple times with the IDOC node of the target.

Regards,

Ravi