on 06-20-2008 12:17 PM
Hello Gurus!!
I have to map the next structures, I hope somebody could guide me.
Source
<FIELDS> 0..2
-
<NAME>
-
<VALUE>
</FIELDS>
Target
<DATA> 0..1
-
<NAME1>
-
<VALUE1>
-
<NAME2>
-
<VALUE2>
<DATA>
An example could be:
Source
<FIELDS>
-
<NAME>COLOUR</NAME>
-
<VALUE>Green</VALUE>
</FIELDS>
<FIELDS>
-
<NAME>SIZE</NAME>
-
<VALUE>9X12</VALUE>
</FIELDS>
Target
<DATA> 0..1
-
<NAME1>COLOUR</NAME1>
-
<VALUE1>Green</VALUE1>
-
<NAME2>SIZE</NAME2>
-
<VALUE2>9X12</VALUE2>
<DATA>
I hope will be clear enough.
Thanks and regards,
Manuel.
Hi,
Why don't you go for XSLTor an UDF
Thanks,
Vijaya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
write it this way..
write an UDF...
select context among value context and queue...
and declare 'a' as a string array..
Since you used context you get names into 'a'.
udf1:
String code = new String();
code = a[0];
result.addValue(code);
udf2:
String code = new String();
code = a[1];
result.addValue(code);
so now map name-udf1-name1.
and now map nameudf2name2.
Check if it works..
Reward if helps..
Thanks,
Vijaya.
Hello Vijaya,
In the UDF2 I have coded this:
String code = new String();
code = a[1];
result.addValue(code);
And I got the next exception:
RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:Messages/ns0:Message1/D32_MATERIAL/MATERIAL/UNIDPR. The message is: Exception:[ java.lang.ArrayIndexOutOfBoundsException: 1] in class com.sap.xi.tf._MM_MAT_IDoc_2_Necora_ method GetUnidpr$[ ]
The UDF1 has been sucessfully executed.
Do you know what could be the error?
I guess must be a problem with the cardinality.
Thanks and regards,
Manuel.
Hi Manuel..
This might be because there is no second value(a[1]) .i.e..
only one occurance of fields node..
<FIELDS>
-
<NAME>COLOUR</NAME>
-
<VALUE>Green</VALUE>
</FIELDS>
not present
*<FIELDS>*
*----<NAME>SIZE</NAME>*
*----<VALUE>9X12</VALUE>*
*</FIELDS>*
*so add a condition in th second udf..*
If (a.length = 2)
then only return a[1].
Hope this is clear..
please reward if helps...
thanks,
Vijaya
Hi Manuel,
Have u tried with the above udf's ?
I'm not getting the output.Could u pls suggest vijaya.....Where is the problem..
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manuel,
Have u tried with the above udf's ?
I'm not getting the output.Could u pls suggest vijaya.....Where is the problem..
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mauel,
U have to select context.Since there is a return value, result should be there.
Regards,
Radhika.
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.