cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Copy-Value function?

justin_santhanam
Active Contributor
0 Kudos

Dear Friends,

I have query on how to use Standard function Copy-Value.

Please have a look @ the help.sap.com example use of Copy-Value function.

http://help.sap.com/saphelp_nw70/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm

I have designed the same example. Please see the mapping I've defined for this example :

http://www.flickr.com/photo_zoom.gne?id=930440086&size=o

Please see the resuts, its working perfectly. See the top image :

http://www.flickr.com/photo_zoom.gne?id=930440300&size=o

Ok, now lets come to the issue. Please consider the same example , If I have more than one partner

and I want to use the address field to the customer street,city & zipcode using copy-value function, how will I achieve this?

Please see the resuts.See the bottom image :

http://www.flickr.com/photo_zoom.gne?id=930440300&size=o

I think you all got the issue, if not please reply back.

Looking for your answers!!!

Best regards,

raj.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Raj,

refer sravya's blog....

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

vasanth.

justin_santhanam
Active Contributor
0 Kudos

Vasanth,

Thanks for the reply. I understood the functionality of it, the issue is based on the example in help. Whether its correct or not.

Best regards,

raj.

stefan_grube
Active Contributor
0 Kudos

The CopyValue function considers only values in the first context of the queue.

When the queue has more contexts, the other contexts are ignored.

In online help, the element addrDat is 3 times under name, that means 3 values are in the first context.

That means: For the first occurrence of the partner it is correct, for all other partners, the values of the first context is taken. The online help does not express this, so it is misleading and should be changed to an example where address is not beyond a node with occurrence inbounded.

In practical cases the copyValue can only be used for values that appear in source just one time, like the IDOC header fields, as it works like a constant.

Regards

Stefan

justin_santhanam
Active Contributor
0 Kudos

Stefan,

Thanks for the reply and the information. One more thing, initially I thought addrdat is under name as per the alignment. But if you scroll down and look at the mapping logic <i>" /CustomersMsg/customer/street=

CopyValue(/PartnersMsg/partner/addrDat)"</i> its clear that addrdat is under partner.

My intention is not to point out the wrong, instead we can suggest to change the example, so that for the future aspirants it could be easy to understand.

Best regards,

raj.

justin_santhanam
Active Contributor
0 Kudos

Friends,

Thanks for sharing your time and information.

Best regards,

raj.

former_member184619
Active Contributor
0 Kudos

Hi Raj,

Thanks to you and stefan as well. It was useful and informative.

Sachin

Answers (1)

Answers (1)

justin_santhanam
Active Contributor
0 Kudos

Friends,

I think its working as per designed. But the example which they gave in help.sap.com made me to confuse.

CopyValue function -Documentation.

<i>"CopyValue Fuction Takes Specified Value in Argument Stream and Copies It an Infinite Number of Times".</i>

I'm still keeping the thread as open, to share yout views on it. What do you guys say?

Is the example which help.sap.com has, is correct for this function.

Best regards,

raj.

Former Member
0 Kudos

Hi

I had a look at the example and your screenshots.It is working on one to one correspondence according to my knowledge.

<i>"CopyValue Fuction Takes Specified Value in Argument Stream and Copies It an Infinite Number of Times".</i>

This sentence i feel should not be there then.

If you get to know more,please share.

Thanks

justin_santhanam
Active Contributor
0 Kudos

Monika,

<i>It is working on one to one correspondence according to my knowledge.</i>

No Monika, its not, thats why I had a doubt and raised the issue. The statement which says <b> <i> "CopyValue Fuction Takes Specified Value in Argument Stream and Copies It an Infinite Number of Times"</i>.</b> is correct. I said the example which they gave is not correct.

Please correct me if i'm wrong.

Best regards,

raj.