cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping - Remove Node

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (6)

Answers (6)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

how does your mapping look like?

Try it like I mentioned above, should work

Regards

Patrick

GabrielSagaya
Active Contributor
0 Kudos

Just double right click on the mapping editor then u will get a window...use Equals function it will give boolean output and for output of this function use not..

nisarkhan_n
Active Contributor
0 Kudos

check the length of the product_description if !=0 then map this to createif whose output map it to the target node.

GabrielSagaya
Active Contributor
0 Kudos

Constant("") -> equals-> not -> ifwithoutelse ->

Product_desc-> Product_desc--->Product_desc

former_member194786
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

use ifWithoutElse

if prod_desc NOT equal to empty(constant value) , then map constant to Product(target)