cancel
Showing results for 
Search instead for 
Did you mean: 

Map with default

Former Member
0 Kudos

hi all,

what is map with default. please explain how to do map with default.

Thanks

Accepted Solutions (0)

Answers (7)

Answers (7)

Shabarish_Nair
Active Contributor

MappWithDefault function acheives the below logic;

If source field does NOT EXIST then Map the target field with a default value.

You can provide what should be the default value as part of the mapwithdefault function properties.

From Help:

mapWithDefault

Replaces empty contexts in the inbound queue with a default value, which you specify in the function properties.

Example:

If u201CDefaultu201D is the default value and

A|B1,B2| |C| |D

is the inbound queue,

mapWithDefault returns the following outbound queue:

A | B1,B2 | Default | C | Default |D.

The function corresponds to the following combination of standard functions:

If(

[]field,

exists([]field),

Constant([value=default]))

Former Member

Hi,

MapWithDefault: Inserts default value specified in function properties into Empty contexts.

If the target field is mandatory and if the input to that field is null/or no source field, then you have to use the mapWithDefault function with the value you want.

sourcefield->mapWithDefault->targetfield.

Regards,

Swetha.

Former Member
0 Kudos

i got useful answer

rajasekhar_reddy14
Active Contributor
0 Kudos

This function provides a default value, whenever the source element is not available.

you can give default value.

Former Member
0 Kudos

Hi,

If the target side element is mandatory but source is not mandatory, at this time suppose the source is null then the mapping fails, so to avoid that we are using the mapWithDefault value.

Source field -


> MapWithDefault -


> Target Field,

Suppose source has null the default value (we mentioned value) goes to the target field.

former_member307485
Active Participant
0 Kudos

Hi Sam,

*mapWithDefault :*

It is required when you wish to send some default value if input is null (Nothing) .If input is not null it will just simply pass the value coming from source .

e.g

null -> ABC -> ABC

Source MapWithDefault Target

XYZ -> ABC -> XYZ

Source MapWithDefault Target

Regrds,

Divya

Former Member
0 Kudos

Hi,

Functionality of "mapWithDefault" Function is:

Replaces empty contexts in the inbound queue with a default value, which you specify in the function properties.

Example:

If u201CDefaultu201D is the default value and

A|B1,B2| |C| |D

is the inbound queue,

mapWithDefault returns the following outbound queue:

A | B1,B2 | Default | C | Default |D.

The function corresponds to the following combination of standard functions:

If(

[]field,

exists([]field),

Constant([value=default]))

Please see the below link. It will help you to understand all the standard mapping functions.

http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm

Regards,

Shwetambari

Former Member
0 Kudos

Are you talking about mapping with default values?

Edited by: hetal shah on Apr 1, 2009 7:19 AM

Former Member
0 Kudos

yes