cancel
Showing results for 
Search instead for 
Did you mean: 

How to work with the node creation functions

Former Member
0 Kudos

Hi,

In message mapping, need to create an IDOC. The IDOC is created depends on a condition.

I tried to use the following logic.

[Condition]>[if true]>[createIf]-->[IDOC]

**IDOC gets created**

[Condition]>[if false]>[createIf]-->[IDOC]

**mapping error**

How do I create the IDOC node without failing the message maping?

Thanks in Advance,

Ajay.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Please make sure that the target idoc structure has an occurence of 0..ub or 0..1.

Please post the error here, so we can help you better.

Regards,

Smitha.

Former Member
0 Kudos

Hi,

Praveen:

I have already tried that occurance change from 1:1 to 0:1. But its giving some mapping error. Even I have reimported an external definition of the same IDOC with some structural changes, but XI says "Leaf node cannot be an optional field" this occurs when we change the occurance from 1 to 0.

Michael:

I cannot use any condition in the receiver determination, because the decision is made by a lookup function in MM, whether to create an IDOC or not.

Looking for more suggestions.

Thanks,

Ajay.

Former Member
0 Kudos

Hi Aj,

I just tested this with Idoc by making the IDoc 0...unbounded in the Third tab of message mapping.

I just gave condtion on the Node of the IDoc name and it generates one IDoc based on the condition.

Regards

Vijaya

Former Member
0 Kudos

Hi AJ,

For instance, you can do that:

1/ Create a mapping M1 : "Source -> SourcePlus"

with SourcePlus = All fields of Source plus an error field "Err". Put the result (true/false) of your condition inside this field "Err".

2/ Create a mapping M2 : "SourcePlus -> IDoc_1" (true one)

3/ Create a mapping M3 : "SourcePlus -> IDoc_2" (false one)

4/ After that, inside a BPM build your switch like this:

               --(branch 1 if Err = true) M2  ---- 
   >--- M1 ----                                  ---->
               --(branch 2 if Err = false) M3 ----

Note: you can avoid this BPM, if in IR you use a Condition fiter inside Receiver Determination.

Mickael

Former Member
0 Kudos

I think you are getting runtime error because, the minOccurs for IDOC node is 1.

In case false value for condition, it IDOC node which is mandatory is not being created.

In message mapping, go to the 3rd tab page 'Messages' and change the 'Occurs' column for IDOC to '0..1' or '0..tounbounded' depending on ur need.

thx

praveen