cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass null values for all fileds in Message Mapping

Former Member
0 Kudos

Hi Friends,

in my Idoc to file..

in target message type most of the filds are 0..1 occurance..

if the idoc does not sending particular filed..it is not coming to target XML ..

but i want the target field as

<b><Filed1/></b> <i>.. ...if Idoc is not sending the value</i>..

i used exists and If ..and i got the result ..But..i have some 2000 fileds to map like this..

please guide me ..how can achive this for all fields once ...to populate null value if the value doent exsist....

Thanks and regards

ram

Accepted Solutions (1)

Accepted Solutions (1)

former_member335553
Active Contributor
0 Kudos

HI

use mapwithdefault node function in message mapping

Mapwithdefault function passes defalut value to the target if my source field does not appear.

You can set a default value by clicking the function in Mapping editor

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ram,

If u change the target fields min occurance to 1 and do not map it or leave it empty(as in ur case) u will get a null pointer exception...

The best way i think u can use is mapwithDefault Function

Regards,

AshwinM

Former Member
0 Kudos

Hi Ram;

There seem to be no other way out of this.

You can copy the mapping end node and just change the source field in each mapping.

You can also do some code in SAP to pass Null other than blank in the fields to XI.

Mudit

Award points if it helps

Former Member
0 Kudos

Change the min occurance for the target field to 1.

This will resolve the issue.

Regards,

Jai Shankar