on 02-12-2007 9:12 AM
I have the following message type to map:
<node_1>
</node_1>
<node_2
</node_2>
..
<node_x>
</node_x>
In one of these nodes is the message that I actually want. For example:
<node_7>
<a>
<a1>bla bla</a1>
<a2>blab la bla</a2>
</a>
</node_7>
The problem is I don't know which of these nodes .
Is there a simple way to deal with that? I'm not experienced with XSLT mappings and such techniques.
Gil,
You can use graphical mapping which uses the function ifexists or exists. if the source node has data then the source will be mapped to target. If ur req is to get the node (node_7) which has value and map that node alone to the target the simple thing is to have a udf defined with the context of the source node pointed to the root segment of the source. Have a java code which will read the data and map to the target.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If u are comfortable with java you can go for that. Its very easy to code in Java to get the required node. There are many blogs available on Java mapping.
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
Regards,
P.Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use node functions and check whethr they exists or not if they exists they have message and create it using create if node fucntion.
Thanks
Sreeram.G.reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can even try like this. If u r confident that <a> doesnt occur in only one <node_x> then use that <a> element in mapping with parent of <node_x> as context.
Give ur structures and target mapping requirement so that its easy to help u. I think this can be even solved by Graphical mapping if properly analysed.
Regards,
P.Venkat
Hi,
You can even try like this. If u r confident that <a>
doesnt occur in only one <node_x> then use that <a>
element in mapping with parent of <node_x> as
context.
Give ur structures and target mapping requirement so
that its easy to help u. I think this can be even
solved by Graphical mapping if properly analysed.
Regards,
P.Venkat
I've tried this already. I have defined a mapping for the following structure graphically.
<MT_BEW_DATEN_SP_response>
<statement_response>
<response_1>
<row>
</row>
</response_1>
</statement_response>
</MT_BEW_DATEN_SP_response>
I map this to the following message type:
<MT_SAP_BEW_DATEN>
<DATA>
<ITEM>
</ITEM>
</DATA>
</MT_SAP_BEW_DATEN >
I map is displayed in red.
Message was edited by:
Gil Ritter
Hi Gil,
Use exists function in graphical mapping to check the existence of your message.. then direct it to if..then block......in its output use creatif to create target node..
Then inside the node, set the field to Split by value function to target message field.
Hope this solves your query.
Thanks,
Rajeev Gupta
Gil
it can be performed using graphical mapping but litle bit of logical evaluation needs to be done like in <a href="/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool. This would be totally different from ur scenario but context handeling will come to rescue in graphical way
For example,
The target node Item's mapping will be like
The first if then else
<row>(from response_1)existsif
<row>(from response_1)--then
result --Item
The else part of the first first <i>if then else</i> is mapped to result of <i>second if then else</i>
Second if then else
<row>(from response_2)existsif
<row>(from response_2)--then
This will continue till the end of <response_x>
Also, you need the same approach for eac node with in <Item>.
Regards
Jai Shankar
> Gil
>
> it can be performed using graphical mapping but litle
> bit of logical evaluation needs to be done like in
> <a href="https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub
> /wlg/3468">here</a>. This would be totally different
> from ur scenario but context handeling will come to
> rescue in graphical way
I don't understand how this blog can help me.
If I define my mapping as described above but I got problems if the <row> node isn't in <response_1> even If I change the context of <row> to <response_1>.
If I test my mapping with the IB test tool with a message where <row> has <response_2> as parent node than <response_2>, <row> and all child nodes are displayed in red at the source side. So no mappings on <row> -> <ITEM> will be executed. In the blog the names of the nodes are always known. I never know the name of the parent node.
> For example,
>
> The target node Item's mapping will be like
>
> The first if then else
>
> <row>(from response_1)existsif
> <row>(from response_1)--then
> result --Item
>
> The else part of the first first <i>if then else</i>
> is mapped to result of <i>second if then else</i>
> Second if then else
>
> <row>(from response_2)existsif
> <row>(from response_2)--then
>
> This will continue till the end of <response_x>
>
> Also, you need the same approach for eac node with in
> <Item>.
>
> Regards
> Jai Shankar
Okay, this way is clear but my problem is that I don't know x. Maybe x is 10 or x is 100.
Hi Gil
The pointer i had given you is to undestand the logical part involved. By having some logical valuations inplace and by playing around with context your reqi can be sortedout. Also you can make use of java/abap mapping if this takes more time.
There might be n number of response but all are confined to a strucutre that is defined. It is the strucutre that is carrying the data and by setting some context changes make sure that the Queue has no context change and the data are like a string of array. with this and having a udf in place we can do that. As said java mapping will also be comparitively handy.
regds
Prabhu
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.