on 09-26-2008 3:20 AM
Hi,
The following is my source structure :
Recordset 1..1 -> Idoc 1..unbounded -> Segment 1..1
<Recordset>
<Idoc>
<segment>abcdefgh</segment>
</Idoc>
<Idoc>
<segment>klmno</segment>
</Idoc>
.
.
.
</Recordset>
I have a requirement where in I have to pass the data from the various segments as an input to the RFC.Is there any UDF which I can use to concatenate the values from the different segments and map it to the input for the RFC.There can be many idocs under one Recordset and each idoc has one segment.
Appreciate if you could help.
Thanks in advance.
Induja
Hi,
Please use below TestUDF code
Here pass the input parameter as Segment ---> TestUDF ---> Target field
And select the cache parameter as queue
String temp = new String("");
for(int i = 0; i<a.length;i++)
{
temp = a<i> + temp;
}
result.addValue(temp);
Thanks
Swarup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply Swarup.It worked:)
If I want to concatenate segments which start with a particular substring alone,will I be able to achieve it.Like for example,I only want to concatenate the segments which start with say 'abcd'.There are many segments within the recordset which start with this substring.I want to concatenate only those.Will I have to use the substring function to place a check.
Please could you give me your ideas on this.
Thanks and Regards,
Induja
Hi Induja,
You can use if statement to check the first 4 characters of all the segments.concatenate those segments which satisfy the above condition.Here is the code for the same..
String temp = new String("");
String string1 = "abcd";
for(int i = 0; i<a.length;i++)
{
if (string1.equals(a.substring(1,4)))
temp = a<i> + temp;
}
result.addValue(temp);
Regards,
Yuga
There is no standard UDF to concatenate values in a given context. You have to write a UDF for the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.