on 07-13-2012 6:42 PM
IDOC
+segment1 (0....unbound)
++field1
++field2
+node2 (0...unbound)
++keyfield1
++keyfield2
segment 1 can appear more than one time.
Based on the node2, the target structure gets repeated. For every repeatetion the segment1 occurrences should repeat. Both Segment1, node2 are at the same level under one single segment in IDOC.
Eg: If segment1 repeats 4 times, and node2 repeats, each repetitions of node2 should have 4 repetitions of the segments1 occurrences in node 2 repetition.
Tried with multiple options. help
Venkat.
Yes, I agree with VJ.
in the UDF you have to do something like
for(int i =0; i>first.length();i++)
for(int j= 0;j<second.length();j++)
result.addValue("");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear VJ, Ravi Kanth,
Thanks for your replies. I wrote the UDF and resulted in following error mesg when I mapped it to the target node.
for(int i =0; i>node2.length();i++)
for(int j= 0;j<segment1.length();j++)
result.addValue("");
/usr/sap/X5D/DVEBMGS13/j2ee/cluster/server0/./temp/classpath_resolver/Map21bff7f3cd3711e1bf3a00000806f16e/source/com/sap/xi/tf/_.java:1005: cannot resolve symbol
symbol : method length ()
location: class java.lang.String[]
for(int i =0; i>node2.length();i++)
^
/usr/sap/X5D/DVEBMGS13/j2ee/cluster/server0/./temp/classpath_resolver/Map21bff7f3cd3711e1bf3a00000806f16e/source/com/sap/xi/tf/_.java:1006: cannot resolve symbol
symbol : method length ()
location: class java.lang.String[]
for(int j= 0;j<segment1.length();j++)
Hi Lucho.
Thanks for your reply. You suggestion did helped to execute the UDF succesfully but it did not fix the issue. The following is the Display queue values.
int cnt =0;
for(int i=0; i<a.length;i++)
for(int j=0;j<b.length;j++)
{
cnt++;
result.addValue("");
if(cnt>=i)
{
cnt=0;
result.addValue(ResultList.CC);
}
}
No errors but the way data is populated, there seems to be some issue!
example : There are 3 occurrences of a node and 3 occurrences of node b. The above function returns each value with a context chance and hence there are some fields which are not being populated in the target.
The problem currently is when there are 2 repetitions of a segment, hence there is a need to insert context change for every 2 objects.
Similarly, if there are 3 repetitions of one segment and 2 repetetions of second, there should be context created accordingly
I also tried to shuffle. Nothing works perfectly.
This is tried with target node.
help
A simple UDF at the context level should do the work here. Pass both Node2 and segment 1 to it. For each node2, add the length for segment one number of elements on the target.
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
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.