on 07-05-2006 8:00 AM
Hi All,
I have a field called <b>Note</b> in my target message. The occurrence is 0..1. And in my source message there are many fields which are to be mapped to this field. For example if the source message is:
<sourceMessage>
-
Other Elements----
<name>Sandeep</name>
<phone>88665434</phone>
<location>Bangalore</location>
</sourceMessage>
In the target message this should appear as follows:
<targetMessage>
-
Other Elements----
<note>Sandeep</note>
<note>88665434</note>
<note>Bangalore</note>
</targetMessage>
How can I achieve this using the graphical mapping tool (Message Mapping). Can any node functions help?
Many Thanks,
Sandeep
Use the feature "Duplicate Subtree".
http://help.sap.com/saphelp_nw04/helpdata/en/2f/5bc63d15431352e10000000a114084/frameset.htm
Click right on the target field node to open the context menu.
Regards
Stefan
Message was edited by: Stefan Grube
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep,
Do post the solution at the end...we'd like to know what worked in the end:)
Regards,
Sushumna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep
You could also use SplitByValue node function as it creates a new context, if your target node is only one.
Also if your
<b>Note</b> node's occurence is 0 to 1 you cannot have multiple <b>Note</b> nodes. You have to change the occurence.
Regards
Padmaja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep,
I think you can use a user defined function to achieve this.
Give all the input nodes as parameters to the UserDefinedFunction.
Then for each value add that value to the resultList.
Map the output of the UserDefinedFunction to the target node.
The code for this is
public void create(String[] a,String[] b,String[] c,ResultList result,Container container){
result.addValue(a[0]);
result.addValue(b[0]);
result.addValue(c[0]);
}
where create is the user defined function.
the mapping will be like
name ----------
phone ------- create -------- note
location ----------
Hope this helps.
regards,
P.Venkat.
Message was edited by: Venkataramanan
Message was edited by: Venkataramanan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep,
Use the "createif" node to create the node in the target side for every tag present in the source side. And then give the value of the source node in it.
Go through the following blog by Sravya regarding node functions:-
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
Regards,
Sushumna
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 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.