none
Mapping Issues RRS feed

  • Question

  • Below given are  the Source XML and the Destination XML and the RequiredOutput XML. I just need to map the Message field in the input file to the CAM_WS_STATUS field of the destination schema to get the required output.

    First issue is 

    1. When i use a loop functoid i am unable to connect the  Response field in the destination  , i am able to connect the source field BAPIRET2 to the looping functoid ,what would be the reason

    2. So i use an XSLT as below (Condition is Type field should be E)

     

     

    <ns0:CAM_WS_STATUS xmlns:p1="http://Microsoft.LobServices.Sap/2007/03/Rfc/" xmlns:p2="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" xmlns:ns0="http://CAM.Integration.MSCRM.Schemas.CREATE_QUOTE_Response/"> 
     <xsl:for-each select="//p1:ZSD_BAPI_QUOTE_CHECKResponse/p1:RETURN/p2:BAPIRET2[p2:TYPE= 'E']">
       <xsl:value-of select="p2:MESSAGE" />
     </xsl:for-each>
    </ns0:CAM_WS_STATUS>
    

     

    3. I get the output as below

    <ns0:Response xmlns:ns0="http://CAM.Integration.MSCRM.Schemas.QuoteResponse">
     <ns0:CAM_WS_STATUS xmlns:ns0="http://CAM.Integration.MSCRM.Schemas.CREATE_QUOTE_Response/">Invalid Distribution channelInvalid Division</ns0:CAM_WS_STATUS> 
     </ns0:Response>
    

    But i need to make the output  as per the XML give below(Required Output XML)

    Source XML

    <?xml version="1.0" encoding="utf-8"?>
    <ZSD_BAPI_QUOTE_CHECKResponse xmlns="http://Microsoft.LobServices.Sap/2007/03/Rfc/">
    	<RSUBRC>1</RSUBRC>
    	<RETURN>
    		<BAPIRET2 xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/">
    			<TYPE>E</TYPE>
    			<ID>ZCIC</ID>
    			<NUMBER>1</NUMBER>
    			<MESSAGE>Invalid Distribution channel</MESSAGE>			
    		</BAPIRET2>
    		<BAPIRET2 xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/">
    			<TYPE>E</TYPE>
    			<ID>ZCIC</ID>
    			<NUMBER>2</NUMBER>
    			<MESSAGE>Invalid Division</MESSAGE>
    			<LOG_NO></LOG_NO>			
    		</BAPIRET2>
    </RETURN>
    </ZSD_BAPI_QUOTE_CHECKResponse>
    

    Destination XML

    <ns0:Response xmlns:ns0="http://CAM.Integration.MSCRM.Schemas.QuoteResponse">
     <CAM_WS_STATUS>CAM_WS_STATUS_0</CAM_WS_STATUS> 
     <SAP_QUOTE_NUMBER>SAP_QUOTE_NUMBER_0</SAP_QUOTE_NUMBER> 
     </ns0:Response>
    

    Required Output XML 

    <ns0:Response xmlns:ns0="http://CAM.Integration.MSCRM.Schemas.QuoteResponse">
    	<ns0:CAM_WS_STATUS xmlns:ns0="http://CAM.Integration.MSCRM.Schemas.CREATE_QUOTE_Response/">Invalid Distribution channel</ns0:CAM_WS_STATUS>
    	<ns0:CAM_WS_STATUS xmlns:ns0="http://CAM.Integration.MSCRM.Schemas.CREATE_QUOTE_Response/">Invalid Market Usage for Sales area</ns0:CAM_WS_STATUS>
    	<ns0:CAM_WS_STATUS xmlns:ns0="http://CAM.Integration.MSCRM.Schemas.CREATE_QUOTE_Response/">Invalid Sales Office</ns0:CAM_WS_STATUS>
    </ns0:Response>
    

     

    Regards

    Suresh


    Friday, August 19, 2011 5:10 AM

Answers

  • Suresh, 

    There is a difference between the field and a record . You can loop over a record and not a field or element. So try mapping the repeated source record to the looping functoid and that will do it. If possible give a screenshot of what you are trying to do.

     

    Cheers


    --------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    • Marked as answer by SureshRKumar Friday, August 19, 2011 7:01 AM
    Friday, August 19, 2011 6:51 AM

All replies

  • Why were you trying to connect the source field to looping functoid. You can put a looping functoid over source record and connect to destination record and then do a normal mapping of the underlying elements/fields.

     

    Cheers


    --------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Friday, August 19, 2011 5:38 AM
  • I tried to use the looping functoid to connect the source and the destination but i can only connect the source field and not the destination field.

    any guess why i am unable to connect the Response field in the destination schema 


    Regards Suresh
    Friday, August 19, 2011 6:28 AM
  • Suresh, 

    There is a difference between the field and a record . You can loop over a record and not a field or element. So try mapping the repeated source record to the looping functoid and that will do it. If possible give a screenshot of what you are trying to do.

     

    Cheers


    --------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    • Marked as answer by SureshRKumar Friday, August 19, 2011 7:01 AM
    Friday, August 19, 2011 6:51 AM
  • Thanks Bali...Some how i was not able to recollect...
    Regards Suresh
    Friday, August 19, 2011 7:02 AM