on 07-21-2009 6:33 AM
Hi Experts,
I have thee source structure as.... Adress field as occurance of Min=3 & Max=3
<?xml version="1.0" encoding="UTF-8"?>
<ns0:CopyValue_Source_MT xmlns:ns0="http://mapping.com">
<Partner>
<PartnerName>Name1</PartnerName>
<Address>Manyata</Address>
<Address>Bangalore</Address>
<Address>560045</Address>
</Partner>
<Partner>
<PartnerName>Name2</PartnerName>
<Address>White field</Address>
<Address>Bengalooru</Address>
<Address>560010</Address>
</Partner>
</ns0:CopyValue_Source_MT>
I need to replicate to traget structure as it is in source...if i use copy value it replicates first context values in both context of target...
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:CopyValue_Target_MT xmlns:ns0="http://mapping.com">
- <CustomerRecords>
<Name>Name1</Name>
<Street>Manyata</Street>
<City>Bangalore</City>
<Pincode>560045</Pincode>
</CustomerRecords>
- <CustomerRecords>
<Name>Name2</Name>
<Street>Manyata</Street>
<City>Bangalore</City>
<Pincode>560045</Pincode>
</CustomerRecords>
</ns0:CopyValue_Target_MT>
Regards
nandan
Nandan,
You need to map like this:
Partner ---> CustomerRecords
PartnerName ---> Name
Address ---> Street
For city use simple if then with out else and map like this:
Address > Index (1,1,context)-> equals text function to constant 2 --> if
then--> Address --> city
For Pincode use simple if then with out else and map like this:
Address > Index (1,1,context)-> equals text function to constant 3 --> if
then--> Address --> Pincode
It should work. I tested in my system.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Instead of copyValue function create UDFs as given below
getStreet UDF
define a argument and name it street and choose CONTEXT while creating this UDF
result.addValue(street[0]);
use mapping as given below
address-----> getStreet(UDF)------.street(targetfield)
getCity UDF
define a argument and name it city and choose CONTEXT while creating this UDF
result.addValue(city[1]);
use mapping as given below
address-----> getCity(UDF)------.>city(targetfield)
getPincode UDF
define a argument and name it pincode and choose CONTEXT while creating this UDF
result.addValue(pincode[2]);
use mapping as given below
address-----> getPincode(UDF)------.pincode(targetfield)
I have tested the above UDF .It is working fine .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if i use copy value it replicates first context values in both context of target...
I suggest you to check this out to understand CopyValue better
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
Regards,
Manjusha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the example of SAP help library
http://help.sap.com/saphelp_nw04/helpdata/en/70/f3cbad30ee479cb15672219f3405f0/frameset.htm
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please use this mapping:
For CustomerRecords:
<Partner> --> removeContext --> <CustomerRecords>
For Name:
<PartnerName> --> <Name> (this is assuming that PartnerName has a context change per name) otherwise insert splitByValue
For Street, City, Pincode:
<Address> --> <Street>
<Address> --> <City>
<Address> --> <Pincode> (this is assuming that the source nodes have a context change per line) otherwise insert splitByValue
If you use copyValue, it will populate the ALL instances specified in the location.
Hope this helps,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.