on 08-21-2015 3:30 PM
Hi Experts,
I have following scenario of mapping,
Source Structure (Customized structure from legacy system):
<PO>
.....multiple fields
<Tax1>
<Tax2>
<Tax3>
<Tax4>
<Tax5>
.....multiple fields (same parent)
</PO>
Target Structure (Standard structure):
<Purchase Order>
.....multiple fields
<Tax Detail> (0 to unbounded)
<fields>...
</Tax Detail>
</Purchase Order>
I need to repeat Tax Detail segment in Target structure based on how many Tax field comes in Source structure (same level)...as of now it is 5. is it possible using standard functions or do I need to write UDF...if yes please provide details on how should I proceed.
Please help.
Thanks and Regards,
Nitin Patil
Nitin,
If input elements are Tax, Tax, Tax, Tax, Tax then map one-to-one Tax to target TaxDetail.
If Input elements are Tax1,Tax2,Tax3,Tax4, Tax5 then duplicate target TaxDetail 5 times in target structure in message mapping and map one-to-one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nitin,
You can handle this easily just adding an simple UDF in between.
Mapping will be like -
Tax1 -> remove context
Tax2 -> remove context -> UDF -> Purchase Order
Tax3 -> remove context -> split by value(each value) -> Tax Detail
Tax4 -> remove context
Use the following code in the UDF as per your requirement -
int b=Integer.parseInt(a[0]); --> a[0] will be the sum of count of Tax
for (int i=0;i<b;i++)
{
String s=String.valueOf(i);
result.addValue(s); -> This resultList will be mapped to PO
r1.addValue(arr[i]); -> This resultList will be mapped to tax Detail
}
Try this ... If helpful don't forget to help me to gain point.
Thanks,
Apu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nitin, to proceed with your problem, I suggest the following:
* Creates a complete xml source that reflects a particular case
* Creates a complete destination xml that reflect the particular specific output.
Do you work with SAP PI 7.1?
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.