Skip to Content
0
Former Member
Oct 24, 2005 at 10:26 PM

Problem with condition IF THEN in Message MApping

27 Views

Hi,

We are not getting correct ouput when we use condition IF THEN without else in message Mapping .We are sending data from File to XI to R/3.

We are using file adapter and IDOC adapter to create customer in R/3.

In message Mapping we are creating Segment E1KNB1M and E1KNBKM based on condition.

IF THEN Condition used in mapping is as below

find the length of Compnaycode with LENGTH function.Pass that value as one of the parameter to function GREATER.Pass second parameter to function GREATER a constant (0).Pass the result to If without else function.If this is true pass Item to IF THEN function and Map the result to E1KNB1M.

Our mapping is not giving desired output in below scenario:

Source XML

<?xml version="1.0" encoding="utf-8" ?>

http://mazdausa.com/sapr3/fi/masterdata/customermaster">

<Idoc>

<Header>

<ID>H</ID>

<ACCTGRP>M002</ACCTGRP>

<CUSTNO>R51563</CUSTNO>

<NAME1>WAYNE MAZDA</NAME1>

</Header>

<Item>

<ID>L</ID>

<COMPCODE>US10</COMPCODE>

<BANKKEY>0000326</BANKKEY>

<BANKCNTRY>US</BANKCNTRY>

<BANKACCT>05893</BANKACCT>

</Item>

</Idoc>

- <Idoc>

- <Header>

<ID>H</ID>

<ACCTGRP>M002</ACCTGRP>

<CUSTNO>51563</CUSTNO>

<NAME1>WAYNE MAZDA</NAME1>

</Header>

</Idoc>

- <Idoc>

- <Header>

<ID>H</ID>

<ACCTGRP>M002</ACCTGRP>

<CUSTNO>V51563</CUSTNO>

<NAME1>WAYNE MAZDA</NAME1>

</Header>

- <Item>

<ID>L</ID>

<COMPCODE>US10</COMPCODE>

<BANKKEY>000326</BANKKEY>

<BANKCNTRY>US</BANKCNTRY>

<BANKACCT>0305893</BANKACCT>

</Item>

</Idoc>

</ns:CustomerMaster_Request_MT>

Here 3 Idoc are created under ZDEBMAS06.

First IDOC contain segment E1KNB1M and E1KNBKM as desired because first idoc in Source XML contains Item data.

Second IDOC contain segment E1KNA1M only as desired because second Idoc in Source XML does not contains item data.

Third IDOC does not contain Segment E1KNBKM and E1KNB1M which is not a desired output. It should contain these segments as third idoc in source XML have item data.

But we are getting right output in case we also have Item data under second IDOC in source XML.

Please let me know where I am doing wrong.

Thanks.

Rekha.