cancel
Showing results for 
Search instead for 
Did you mean: 

Node to be created at Target even if no value in the source field

Former Member
0 Kudos

Hi,

I have to send the CSV file from Idoc.

The requirement is that all the fields in the inbound are to be mapped to target. If the source field does not exists then a blank value has to be mapped to the target so the the output is:

ABC|XYZ|||||MNO||

I have used below mapping for each node at the target:

SRCFLD

SRCFLD ->(exists) -> (If then else) -> TARGET

CONSTANT

So if the source field vaue is not there, still there will be a blank value in the target.

But this is not working and the value is still not getting populated.

Has any one got this issue before?

regards, Anirudh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anirudh,

Use mapWithDefault function type node Functions.

In your source node doesnt exist this will be mapped with the value set in mapWithDefault. If you leave this value to a blank, a blank will be

mapped to the target node.

Regards,

Carlos

Former Member
0 Kudos

Hi Carlos/Venkat,

Solved my problem.

Many thanks.

regards, Anirudh.

Former Member
0 Kudos

Hi,

good that it works, but then it should have worked before too.

Description of mapWithDefault in SAP Help:

>The function corresponds to the following combination of standard functions:

>If(

> \[\]field,

> exists(\[\]field),

> Constant(\[value=default\]))

Regards

Patrick

Former Member
0 Kudos

Hi Patrick,

I have rechecked what you have said.

While using mapWithDefault, the target node was not created if the context is not changed to some parent (or grand parent) node which exists.

Earlier, while trying with [exists, if] functions, the target was not created because the context of the source field was not changed.

Now [exists,if] is also working as expected.

Thanks for your insistance

Regards,

Anirudh.

Answers (3)

Answers (3)

Former Member
0 Kudos

Maybe u can realize it in below flow:

Source field -->then |

Source field >exists>if |==> Target field

Constant>MapWithDefault>else |

Hope it could help you !

Former Member
0 Kudos

hi

node function --> mapWithDefault

wud solve u r problem

rgds

srini

Former Member
0 Kudos

Hi,

your mapping should work but only if the parent of the sourcefield exists.

Regards

Patrick