none
Problem in EDI to Flat File Map RRS feed

  • Question

  • Hello Gurus!

    I'm new in biztalk.

    I need to map a EDI message (ORDERS) to a flat file map. My problem is in the DTM loop.

    Inbound message (EDI format):

    UNB

    UNH

    BGM+220+123456'

    DTM+2:20110827:102'

    DTM+137:20110727:102'

     

    Outbound message:

    123456|20110727|20110827

     

    I have a DTM looping in the source message, but, in the destination message, I don't have a looping: I have a single record.

     

    If DTM+2, I have to map the information in the 3rd field of the destination record.

    If DTM+137, I have to map the information in the 2nd field of the destination record.

     

    I've tried Table looping + Table extractor, but without success.

     

    Could somebody help me?

     

    Thanks and regards/

     

    Glauber

     

     

     

    Tuesday, July 26, 2011 7:09 PM

All replies

  • Several ways to do it. Set a condition to fire the date when it meets what you like. Another option is to use a scripting functoid. The easiest is to use a condition of = based on the source. You may also need a looping functoid.
    Please Indicate "Mark as Answer" if this Post has Answered the Question
    Tuesday, July 26, 2011 7:43 PM
  • Hi Glauber,

    Add two Scripting functoids with Inline XSLT to your map.

    To extract DTM+2 add the following to the Scripting functoid Inline script and connect the functoid to the destination record.

    <Name_off_Field_3>
    <xsl:value-of select="/*[local-name()='EFACT_D96A_ORDERS]/*[local-name()='DTM'][./*[local-name()='C507' ]/*[local-name()='C50701'] = '2']/*[local-name()='C507' ]/*[local-name()='C50702']"/>
    </Name_off_Field_3>

    To extract DTM+137 add the following to the Scripting functoid Inline script and connect the functoid to the destination record.

    <Name_off_Field_2>
    <xsl:value-of select="/*[local-name()='EFACT_D96A_ORDERS]/*[local-name()='DTM'][./*[local-name()='C507' ]/*[local-name()='C50701'] = '137']/*[local-name()='C507' ]/*[local-name()='C50702']"/>
    </Name_off_Field_2>

    If you are receiving a variant of the D96A, fx EAN007 or EAN008, change EFACT_D96A_ORDERS to EFACT_D96A_ORDERS_EANXXX

    Best regards

    Rasmus Jaeger

     

     

     

     

     

     

    Wednesday, July 27, 2011 8:01 AM
  • Hello Carlos

    I already tried this solution, but without success.

    Thanks a lot for your answer!

    Regards

    Wednesday, July 27, 2011 12:35 PM
  • Hello Rasmus Jaeger

    Thanks for your help. But the problem persists.

    I made a mistake when he said that the message is 'ORDERS'. The correct message is 'ORDRSP' - release D96A, variant EAN005. And I change the scripts, as follow:

    <Dt_emissao>
    <xsl:value-of select="/*[local-name()='EFACT_D96A_ORDRSP_EAN005]/*[local-name()='DTM'][./*[local-name()='C507' ]/*[local-name()='C50701'] = '2']/*[local-name()='C507' ]/*[local-name()='C50702']"/>
    </Dt_emissao>

    <Dt_entrega>
    <xsl:value-of select="/*[local-name()='EFACT_D96A_ORDRSP_EAN005]/*[local-name()='DTM'][./*[local-name()='C507' ]/*[local-name()='C50701'] = '137']/*[local-name()='C507' ]/*[local-name()='C50702']"/>
    </Dt_entrega>

    I don't know what is happen.

    Wednesday, July 27, 2011 12:48 PM
  • Have you looked into the book Pro BizTalk Mapping? It has quite a few examples on how to do what you are trying to achevie. I used that book a lot when I was learning BizTalk. In fact, I still do use it.
    Please Indicate "Mark as Answer" if this Post has Answered the Question
    Wednesday, July 27, 2011 4:49 PM
  • Yes Carlos! I checked the book, but I didn't found any example to my map.

    I found a lot of examples mapping fields of a single record to a loop. But I'll check it again.

    Thanks and Regards

    Wednesday, July 27, 2011 6:50 PM
  • On Chapter 11m starting on page 231 on should be able to help you. It may not be 100% specific, but it should give you an idea of what you need to do.
    Please Indicate "Mark as Answer" if this Post has Answered the Question
    • Proposed as answer by Carlos T. _ Friday, August 5, 2011 6:07 PM
    Wednesday, August 3, 2011 12:36 PM
  • Hi,
     
    You will likely encounter further issues alike. If you do not want your map to contain a huge number of scripting functoids (or do the scripting with pure XSL/T alltogether thereby circumventing the mapper at all), I would highly recommend to use an XML based format in between. This will lower the overall complexity of the map and will decouple the two interfaces from each other.
     
    This internal format can either be custom are be based on a public format, like OpenTRANS.
     
    Regards
     
    Joerg Fischer
     
     
     
    "Glauber Carrico" schrieb im Newsbeitrag news:41f0d99f-6947-46b3-942c-567d554f6721...

    Hello Gurus!

    I'm new in biztalk.

    I need to map a EDI message (ORDERS) to a flat file map. My problem is in the DTM loop.

    Inbound message (EDI format):

    UNB

    UNH

    BGM+220+123456'

    DTM+2:20110827:102'

    DTM+137:20110727:102'

     

    Outbound message:

    123456|20110727|20110827

     

    I have a DTM looping in the source message, but, in the destination message, I don't have a looping: I have a single record.

     

    If DTM+2, I have to map the information in the 3rd field of the destination record.

    If DTM+137, I have to map the information in the 2nd field of the destination record.

     

    I've tried Table looping + Table extractor, but without success.

     

    Could somebody help me?

     

    Thanks and regards/

     

    Glauber

     

     

     


    Jörg Fischer
    Tuesday, August 9, 2011 12:34 PM