cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping UseOneAsMany

former_member301120
Active Participant
0 Kudos

Hello to all,

I use the default function "UseOneAsMany" in my mapping to mutiply a value.

My Problem is, the mapping throws an error, if the source field doesn't exist.

Is there a workaround for this problem?

I've tried

<Source> --> exists --> ifwithoutelse --> UseOneAsMany

but this hasn't solved my problem.

Could I use the function "UseOneForMany" for a node with several subnotes to multiply the complete subtree?

Regards Christian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

please use mapWitDefault API as below

<Source> --> exists --> ifwithoutelse >mapWithDefault> UseOneAsMany

It will avoid the supress value. If you see the queue for this mapping you will get supressed value which raised the exception for UseOneAsMany.

Don't pass any value in mapWithDefault, just use as it is

Thanks

Swarup

Answers (5)

Answers (5)

former_member301120
Active Participant
0 Kudos

Hello,

I solved the problem with your help.

<source> --> mapwithdefault ---> useoneasmany --> if (exists) --> target

so the target will be created if it's in the source

Thanks

former_member301120
Active Participant
0 Kudos

Hello Swarup Sawant,

thanks it works fine. Is there a way that the target node wouldn't be created if the source node doesn't exist?

Could I use "UseOneAsMany" for a complete subtree?

Regards

Former Member
0 Kudos

Kaiser,

If you are using a mapwithdefault then if your source node doesnot exist then also your target will occur becuase it takes the default value.

Since you dont want the target node if your source not doesnot exists then in your case do this:

If -->Source > exists> then use oneas many.

Dont use if else only use if. So the target will create only if source exists else not. Here you have to make sure the UseOneAsMany contexts.

Regards,

---Satish

nisarkhan_n
Active Contributor
0 Kudos

For this you can write an simple UDF which reads from the mapwithdefalu check if the value is empty supress it.

Former Member
0 Kudos

Hello,

if you know a value that can never be a value of your source field (for example an empty value -> set your default value to this value.

Then you can use another if-without-else after your 'one-as-many'-function and the if condition is (input value != default value).

Regards

Patrick

Former Member
0 Kudos

Hi,

Check this link to know about node funtions,

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

Regards,

Phani

Reward points if Helpful

nisarkhan_n
Active Contributor
0 Kudos

check have you set the proper context for the filed source, it shoudl be to the node aove it....

checik thie link which descibes this use of function more easily.

Former Member
0 Kudos

Hello,

guess you need a 'split-by-value'-function.

Please look here:

http://help.sap.com/saphelp_nw04/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm

Regards

Patrick