Many to One Mapping

Home Page Forums BizTalk 2004 – BizTalk 2010 Many to One Mapping

Viewing 2 reply threads
  • Author
    Posts
    • #23019

      Hi,

              I have a Scenario where  I have a repeating segment  E1EDS01 at the source side……

       

      <E2EDS01GRP>
             <E1EDS01>
              <DATAHEADERREC>
                 <SEGNAM>E2EDS01</SEGNAM>
                    <MANDT>333</MANDT>
                     <DOCNUM>1234567</DOCNUM>
                     <SEGNUM>0000599</SEGNUM>
                    <PSGNUM>000000</PSGNUM>
                    <HLEVEL>02</HLEVEL>
               </DATAHEADERREC>
        <SUMID>001</SUMID>
        <SUMME>9</SUMME>
        <SUNIT />
        <WAERQ />
        <SEGMENTPAD />
        </E1EDS01>
        </E2EDS01GRP>
        <E2EDS01GRP xmlns=”>
       <E1EDS01>
           <DATAHEADERREC>
            <SEGNAM>E2EDS01</SEGNAM>
             <MANDT>333</MANDT>
             <DOCNUM>33333</DOCNUM>
             <SEGNUM>000052</SEGNUM>
            <PSGNUM>000000</PSGNUM>
            <HLEVEL>02</HLEVEL>
          </DATAHEADERREC>
        <SUMID>002</SUMID>
        <SUMME>92342.25</SUMME>
        <SUNIT>USD</SUNIT>
        <WAERQ />
        <SEGMENTPAD />
        </E1EDS01>
        </E2EDS01GRP>
        </ZORDERS05>
      The Target Schema is the EDI 855 CTT Segment Which I need only one Segment.
      CTTLoop1
           CTT
              CTT01
              CTT02
               |
               ‘
               ‘
             CTT07
      My condition is If E1EDS01-> SUMID = 001 THEN CTT01 = SUMME
                                  If E1EDS01-> SUMID = 002 THEN CTT02 = SUMME
      But When I am Simply mapping using equal and Value mapping functoid 2 CTT Segments are generating….But I need to restricy it to one Segment with both of thye above rules for CTT01 aND CTT02.

       

    • #23031

      Any pointers?

    • #23038

      if i understand things correctly, then you should be able to solve it by using Value mapping (flattening) functiod instead of the value mapping one

      • #23041

        I’m doing that…But the target element CTT is a repeated segment…so its generating two records of CTT Like…

        <CTTLoop1>

             <CTT>

                        <CTT01>9</CTT01>

            </CTT>

        </CTTLoop1>

         

        <CTTLoop1>

             <CTT>

                        <CTT02>92342.25</CTT02>

            </CTT>

        </CTTLoop1>

         

        I Need it Like

         

        <CTTLoop1>

             <CTT>

                       <CTT01>9</CTT01>

                        <CTT02>92342.25</CTT02>

            </CTT>

        </CTTLoop1>

           So I have to restrict CTTLoop1 to Only one Segment. Anyway Thanks for your reply…

         

         

         

         

        • #23043

          You need to implement explicit looping. Link something that only occurs once (preferably a parent to the E2EDS01GRP) into a looping functoid, then link that to the CTT node. This will limit it to one occurrence of the CTT.   It may be able to see the different SUMIDs if you are sourcing the loop iteration from a parent. 

          If it can’t see both of the source nodes you need at run time, there are two methods to get the values:

          1. One is to value map into a cumulative concatenate (this forces the if test across all occurrences in the document). 

          2. The other is to cache the values to global variables in a scriptoid, and then extract the values from globals in two other scriptoids.

          • #23047

            I tried with E2EDSP1GRP but its an Loopiing segment…so not working….I could not understand point 2 and 3 …can u explain a bit…?

Viewing 2 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.