on 2015 May 08 5:14 PM
Hi Guys,
Could you please help me on a mapping logic that I need.
I have the following source xml format. The source and target message are the same.
<MessageType>
<Node>
<ItemCount>1000</ItemCount>
<BASE>ABC</BASE>
</Node>
<Node>
<ItemCount>1001</ItemCount>
<AMOUNT>ABC</AMOUNT>
</Node>
<Node>
<ItemCount>1002</ItemCount>
<RATE>ABC<RATE>
</Node>
</MessageType>
If RATE Exists then, it will output all Nodes.
Else, if it does not exist, it will only output first occurrence of the node.
Thanks and Regards,
Neil
Hi Neil,
Try the below UDF.
Execution Type: All Values Of Context
public void mapNode(String[] rate, ResultList result, Container container) throws StreamTransformationException {
boolean found = false;
for (String str : rate) {
if (str.equals("true"))
found = true;
result.addValue("");
}
if (!found) {
result.clear();
result.addValue("");
}
}
Use below mapping.
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Neil,
If Praveen has solved your issue you should to close the thread according this
Please, try to follow a good behavior in the forum: http://scn.sap.com/docs/DOC-18590
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.