on 09-09-2009 4:57 PM
Hi all,
I need to write a UDF for CollapseContext. Has anybody coding for that.
Thanx in advance,
Thomas
use this UDF to get the first value from each context then use removeContext and map that to target .
create a UDF with argument a and choose context
if(a.length>0)
result.addValue(a[0]);
Do the mapping as follows
sourcefield----->UDF----->removeContext---->TargetField
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to use the collapsecontext in udf..
just write it like result.collapseContext...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
This is the code for the collapse context, CC is the UDF name
public void CC(String[] var1, ResultList result, Container container) throws StreamTransformationException{
String v_current="";
for(int i=0;i<var1.length;i++)
{
if (var1<i>.equals(ResultList.CC))
{
i++;
}
if (var1<i> != v_current)
{
result.addValue(var1<i>);
}
v_current = var1<i>;
}
}
Here you have to send the sorted data to this UDF then its working like collapse context.
Regards
Ramesh
hi you can use the standar function ...collapsecontext.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You got already SAP PI Provided standard Collapse Context Function.
Thanks,
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.