on 05-06-2008 2:33 PM
Hi,
I need to implement the following scenario:
I have one source message type with this structure:
<Products>
<Product>
<product_code>Code01</product_code>
<product_description></product_description>
</Product>
<Product>
<product_code>Code02</product_code>
<product_description>Product 02</product_description>
</Product>
</Products>
The desired target message should be like this:
<Products>
<Product>
<product_code>Code02</product_code>
<product_description>Product 02</product_description>
</Product>
</Products>
If product_description is empty or doesn't exists in source target then that product should not be generated in target message.
How can i achieve this is message mapping?
Thanks,
Pedro Leal
Hi,
you can do it like this:
equalsS(<product_description>, Constant("")) --> not --> ifWithoutElse --> Product
then value is: <product_description>
Using the exist-function will not work for empty values!
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your answers.
But i'm getting the following error when i try to test mapping in IR:
Runtime exception during processing target field mapping /ns0:MRML_Contratacao_XI_BDC_ISU/Produtos/Produto. The message is: Exception:[java.lang.IllegalArgumentException: Cannot cast to boolean] in class com.sap.aii.mappingtool.flib3.Bool method equals[, "", com.sap.aii.mappingtool.tf3.rt.Context@3eff3eff]
Thanks,
Pedro Leal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
check the length of the product_description if !=0 then map this to createif whose output map it to the target node.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Constant("") -> equals-> not -> ifwithoutelse ->
Product_desc-> Product_desc--->Product_desc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pedro,
To achieve your requirment, you will have to use the node function exists and creatIf. Provide the condition like:
product_discription-> exists --> createIf -> Product.
The rest is 1...1 mapping.
Thanks and Regards,
Sanjeev.
PS: Award points if helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Mapping for product node:
If product_desc equalsS not null, then map product node (source) to product node (target).
Where equalsS is the standard function.
Regards
Bhanu
Intelligroup.
Edited by: Bhanu Tiruveedula on May 6, 2008 7:10 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use ifWithoutElse
if prod_desc NOT equal to empty(constant value) , then map constant to Product(target)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.