on 04-08-2009 7:45 AM
Hello! I need to save business partner structure to CRM via IDOC.
So, I have Tax Numbers in source structure looks like:
<TaxNumbers>
<Numbers>CRM003, BBP000</Numbers>
</TaxNumbers>
And in IDOC there are one multi-valued element
<TaxNumbers> - occurrence is unbounded
<KEYS>...</KEYS>
<TaxNumbers>
So, could you help me how to develop mapping program in this case?
Hi,
UDF:
String[] b=a[0].split(",");
for (int i=0; i<b.length; i++)
result.addValue(b<i>);
Map like below.
NumbersUDF-TaxNumbers(Target)
NumbersUDF-SplitByValue(EachValue)--KEYS
Regards,
Prakasu.M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Creation of UDF select queue.Give any name for UDF.
Map like below.
Numbers(Change Context)UDF-TaxNumbers(Target)
Numbers(Change Context)--UDF-SplitByValue(EachValue)--KEYS
Change Context-Right click the Numbers and Change the context to parent node.
UDF- Which you created.
Regards,
Prakasu.M
Okey, it works. There was an error in code:
String[] b=a[0].split(",");
for (int i=0; i<b.length; i++)
result.addValue(b);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, now I have:
<TaxNumbers>
<Keys>[Ljava.lang.String;@165cd718</Keys>
</TaxNumbers>
<TaxNumbers>
<Keys>[Ljava.lang.String;@165cd718</Keys>
</TaxNumbers>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have this errors:
Source text of object Message Mapping: mm_test1_to_test2 | http://test.mrcb.ru/1 has syntax errors:
Source code has syntax error: D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\server0\.\temp\classpath_resolver\Mapd5c1aa10243111deba85000c29aeb543\source\com\sap\xi\tf\_mm_test1_to_test2_.java:76: cannot find symbol symbol : class string location: class com.sap.xi.tf._mm_test1_to_test2_ string[] b=a[0].split(","); ^ D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\server0\.\temp\classpath_resolver\Mapd5c1aa10243111deba85000c29aeb543\source\com\sap\xi\tf\_mm_test1_to_test2_.java:76: array required, but java.lang.String found string[] b=a[0].split(","); ^ D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\server0\.\temp\classpath_resolver\Mapd5c1aa10243111deba85000c29aeb543\source\com\sap\xi\tf\_mm_test1_to_test2_.java:78: cannot find symbol symbol : variable result location: class com.sap.xi.tf._mm_test1_to_test2_ result.addValue(b<i>); ^ Note: D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\server0\.\temp\classpath_resolver\Mapd5c1aa10243111deba85000c29aeb543\source\com\sap\xi\tf\_mm_test1_to_test2_.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\server0\.\temp\classpath_resolver\Mapd5c1aa10243111deba85000c29aeb543\source\com\sap\xi\tf\_mm_test1_to_test2_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 errors
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you explain me in few words, how can I solve my problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<Numbers>CRM003, BBP000</Numbers>
split the value in the field - use an udf for this and write out each value as an entry in the resultset
the result can then be easily mapped to your target
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
an advance UDF will create context. You can map the output of the UDF to the root node of the target field also which is unbounded and it will take care of creating multiple occurrences.
In short you will handle both root node and field value mapping.
Advanced UDFs - http://help.sap.com/saphelp_nw04/helpdata/en/f8/2857cbc374da48993c8eb7d3c8c87a/content.htm
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.