on 05-07-2008 7:58 AM
Hi
Could any one explain when to use mapwithdefault function. Could anyone explain with a simple example?
Also need explanation on:
Copy value
Fix value
thnx
Hi Mahesh ,
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
FixValue :
There may be requirement when you wish to send some difeerent value for a particular input
eg.
[Boy] -> [Boy -> Male] -> [Male]
Source FixVlaue Target
[Girl] -> [Boy -> Male] -> [Girl]
Source FixVlaue Target
in above example i wish to replace the field which has value Boy with Male so the FixValue will do the trick. .
while if value is other than male it will pass that value as it is to target.
Copy value :
suppose you have input as 1. name
2.salary
3.Add
and you want to display it like name salary Add
so use CopyValue .In this you have give position of value you wold like to retriev.
If HelpFul Reward Points
Thanks
Sunil Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Go through this link...All standard functions are availabale....
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13
mapWithDefault Replaces empty contexts in the inbound queue with a default value, which you specify in the function properties.
Example:
If Default is the default value and
A|B1,B2| |C| |D
is the inbound queue
then mapWithDefault gets 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]))
Thanks,
Satya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You find an example here:
/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey,
heres copy value.
You use CopyValue() for a frequently occurring element to copy the value of a position in the source structure and assign it to a target field. The value is copied each time the target field occurs in the target structure. However, it is copied a maximum of maxOccurs times
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahesh,
mapwithdefault: we use this node function when we want to transfer some by default value to target.
example:
Source>mapwithdefault>Target
in this example if Source element does not exists in the source XML structure then the default value you specified will be transferred to Target.
copyValue: we use it to copy a value at a specified index from an input queue. it will transfer that value as a constant to the target.
Fix Value: It is a constant we use to transfer a spefied constant value to the target.
*Reward points if helpful
--Sankar Choudhury
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahesh,
In some cases, you might not have a value for a specific field in the source. But that field is mandatory for mapping. In such case what will happen. Mapping will fail and message processing will be stopped.
To avoid such situations, if value does not exist for a specific mandatory field, you do a kind of validation with the help of this mapwithdefault function and you are going to assign a default value when no value exists.
Regards
Bhanu
Intelligroup.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahesh
mapWithDefault:
Replaces empty contexts in the inbound queue with a default value, which you specify in the function properties.
Example:
If Default 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.
Regards
Abhishek
**please reward points if helpful*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.