cancel
Showing results for 
Search instead for 
Did you mean: 

Empty IDoc fields do not show up in payload

Former Member
0 Kudos

Hi everyone!

I have a scenario where XI receives an IDoc from a SAP R/3 system and posts the IDoc data to an external HTTP receiver. Everything works fine. However, when an IDoc field is empty, it doesn't show up in the payload. This leads to problems in my mapping, since those empty fields also do not appear in the output message (these fields are optional in the target structure).

Now I <i>could</i> encode some logic in the mapping to check whether the respective source field is empty, and insert some standard values. But this is tiresome since there are many fields involved. Is there a better solution to do this? Mabye some configuration in the IDoc adapter???

Thanks in advance,

Joerg

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Joerg,

If you are above XI3.0 SP14 then you can use the node function <b>mapWithDefault</b> in between the mapping. This will create the xml tag for the field on the target side even if you are not having those fields in the source side i.e., the incoming idoc.

Cheers

JK

PS: Pls mark helpful answers

Answers (2)

Answers (2)

udo_martens
Active Contributor
0 Kudos

Hi Joerg,

using a XSL mapping would solve that kind of problems. It has less performance than MM.

Regards,

Udo

Former Member
0 Kudos

Joerg,

You first check your field exists or not. If exists then you map it to the target field else if you dont have then if the field is alphanumeric then map the same length spaces as constant in the target or if the target field is numeric then map with a constant having that many no. of zeros.

Ex:

If>Idocfield>Exists>then>Idocfield

>else>constant(may be with spaces or zeros)

---Satish