on 10-17-2011 2:16 PM
Hi,
I have a source structure which is as shown below
<Add_com ( 0.n)>
< Com_type
<Com_element>
</Add_com>
This maps to Flat structure
<Phone>
<fax>
<Email>
The logic is if the com_ type = 02 map the com_element to email, if 01 map to fax & for 04 map to phone
For some reason, the source is sending com_type but in some cases if there is no value for element, ti does not send the element itself. In one case, i have only email ( no phone & fax)
Now i am ending up with 10 com_type ( diff for phone & fax & email) . For this i have 4, com_element (only email id). When i ran the mapping all them ( phone fax & email)are filled with email address.
can you pls advice, how should i map this so that when the phone & fax value are not there, it should remain blank. Mu current mapping is
if Com_type eq 04
use come_elemet = fax
if com_type eq 02
use com_element as phone
In display queue see 10 com_type & 4 com_element. In the result all of the phone, fax & email has same value.
Regards
Hi,
that's classic with Idoc: when field is empty in ECC, field does not appear in Idoc.
That's why in PI, we have to use node function "mapWithDefault" with default value "" (nothing). In your case, it's on field Com_element.
Regards.
Mickael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does using the standard function "mapWithDefault" help?
You may use this function after you specify the createIf function( if you are using that one)
rgds
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
When the source XML comes i see 10
<ADDITIONAL_COMMUNICATIONS xmlns="">
under which i have 10 <COMMUNICATION_TYPE> with values from 01, 02 to 04
The issue is in some case <COMMUNICATION_ELEMENT is missing ( as there is no value in source & it does not send)
My mapping is directly to Tel, fax & phone. I don't map <ADDITIONAL_COMMUNICATIONS xmlns="">.
The mapping is if 02 map the email 04 phone 01 fax.
With this i get 4 like this
<ADDITIONAL_COMMUNICATIONS xmlns="">
<COMMUNICATION_TYPE xmlns="">02</COMMUNICATION_TYPE>
<COMMUNICATION_ELEMENT xmlns="">XXX@xx</COMMUNICATION_ELEMENT>
</ADDITIONAL_COMMUNICATIONS xmlns="">
rest of 4 are
<ADDITIONAL_COMMUNICATIONS xmlns="">
<COMMUNICATION_TYPE xmlns="">04</COMMUNICATION_TYPE>
</ADDITIONAL_COMMUNICATIONS xmlns="">
Rest 2 are
<ADDITIONAL_COMMUNICATIONS xmlns="">
<COMMUNICATION_TYPE xmlns="">01</COMMUNICATION_TYPE>
</ADDITIONAL_COMMUNICATIONS xmlns="">
Now with this when i look at the queue
I see 10 COMMUNICATION_TYPE & 4 COMMUNICATION_ELEMENT
When the mapping kicks in it is mapping in all 10 to Email address. So for Fax, phone also i am getting the email id
Current mapping is
/ns1:Z_OOOO_XXXX_BUPA_MAINTAIN/IT_BUT020/item[1]/TEL_NUMBER=ifWithoutElse(stringEquals(/ns0:XXXBUSINESSPARTNER/BUSINESS_PARTNERS/ADDRESS_IDS/ADDITIONAL_COMMUNICATIONS/COMMUNICATION_TYPE, const(value=04)), /ns0:XXXBUSINESSPARTNER/BUSINESS_PARTNERS/ADDRESS_IDS/ADDITIONAL_COMMUNICATIONS/COMMUNICATION_ELEMENT, keepss=false)
If COMMUNICATION_TYPE = 04 map to telephone
Hi,
Try with this logic.
if COMMUNICATION_TYPE = constant02>mapwithDefault>COMMUNICATION_ELEMENT--->email
if COMMUNICATION_TYPE = constant04>mapwithDefault>COMMUNICATION_ELEMENT--->phone
if COMMUNICATION_TYPE = constant01>mapwithDefault>COMMUNICATION_ELEMENT--->fax
in each map with default use respective default phoneNum, or mail address or fax no.
Regards,
Priyanka
Hi harry101_SAP
Try this.
Commnuication_Type = 02 ................>
Com_element........mapWithDefault.....>ifWithoutElse.........> Email
Commnuication_Type = 01 .......................>
Com_element........mapWithDefault...........>ifWithoutElse.........> Fax
Commnuication_Type = 04 .......................>
Com_element........mapWithDefault...........>ifWithoutElse.........> Phone
This logic create the elements when are available else put the default value.
Regards
Lucho
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.