on 09-29-2008 11:32 PM
Hey folks
I have a mapping issue:
It is IDOC to file scenario
A segment in IDOC repeats multiple times. I want to take a field of the first repeating segment and map it to a target field.
And i want to take afield of the last repeating segment and map to a target field.
Eg : E1EDPL1
GSB 100
E1EDPL1
GSB 200
E1EDPL1
GSB 300
Mapping logic 1 :
Take the first GSB ( Value: 100) and map to a target field.
Mapping logic 2 :
Take the last GSB(Value : 300) and map to a target field.
Guess we need to have a context java function which takes as an input an array of GSB and extract first and last GSB.
Need help with the java udf.
Thnx
A small correction
Here a is the GSB values.
cache parameter - context
1st udf
public void add(String[] a,ResultList result,Container container)
{
//write your code here
result.addValue(a[0]);
}
GSB ---> add -
> tgt1
2nd udf
public void add1(String[] a,ResultList result,Container container)
{
//write your code here
int len = a.length -1;
result.addValue(a[len]);
}
GSB---> add1 -
>tgt2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Whats the occurance for the fields.
use GSB ( 0 ) for the first field
and GSB ( GSB.length ) if it is a string or GSB ( GSB.length() ) for integer
and return these from UDF
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do you want to map these to same target field or different target fields??
if one target field then use below UDF.
Change the context of GSB to Header level;
int i =GSB.length();
result.addValue(GSB(0));
result.addValue(GSB(i));
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.