on 08-31-2006 11:22 AM
Dear All,
I have a target structure as follows:
<Item>
<Record10>
<RecordType>
<BankCode>
<AccountID>
<Amount>
</Record10>
<Record50>
<RecordType>
<Segment1>
<segment2>
<segment3>
</Record50>
</Item>
I want to fill the elements in the Record50 in a special way by using some logic. Sometimes I may have to create multiple Record50 structures. So I'm using an advanced user defined function to do this.
My mapping is as follows:
Source Structure -> myFunction()->Record50
And in myFunction() I wrote the following piece of code:
result.addValue("50");
result.addValue("PayRef1");
result.addValue("Address");
result.addValue("Nil");
I expect the output to be:
<Record50>
<RecordType>50</RecordType>
<Segment1>PayRef1</Segment1>
<segment2>Address</segment2>
<segment3>Nil</segment3>
</Record50>
But the output is like this:
<Record50>50</<Record50>
<Record50>PayRef1</<Record50>
<Record50>Address</<Record50>
<Record50>Nil</<Record50>
Can somebody tell me how to proceed? I tried to insert a context change in the beginning, but then the Record50 itself is not appearing.
Thanks,
Sandeep
Hi,
Advanced UDF will not create you like you expected.
You need to do like this
Source>myFunction1()-><RecordType>
And in myFunction() you do code:
result.addValue("50");
Source>myFunction2()-><Segment1>
And in myFunction2() you do code:
result.addValue("PayRef1");
so on..
Thanks,
Prakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep,
the way you do it, you need FOUR UDF:
1) result.addValue("50");
2) result.addValue("PayRef1");
3) result.addValue("Address");
4) result.addValue("Nil");
Than you have to map
<RecordType>50</RecordType> -> 1
<Segment1>PayRef1</Segment1> -> 2
<segment2>Address</segment2> -> 3
<segment3>Nil</segment3> -> 4
Regards Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sandeep,
When you use an Advanced USer Defined Function, you can return multiple values out of the UDF< but you cannot dynamically create the TARGET ELEMENT as you want.
You will need to repeat the same UDF for each TARGET ELEMENT as per the logic and create the target element.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
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.