Mapping iDoc to EDIFACT: Segment Count

Hi experts,
I am mapping a DELVRY05 iDoc to an EDIFACT DESADV document. Everythings fine so far, but I'm encountering troubles with filling the EDIFACT UNT Segment with the number of segments in the generated message.
I am using the OPI2 conversion module and so I get a nice xml structure for the EDIFACT message. Is there a way to count created xml nodes? I think this would solve my issue.
Thanks for your answers!

That is an example for the source idoc
<?xml version="1.0" encoding="UTF-8"?>
<DELVRY05>
   <IDOC BEGIN="1">
      <EDI_DC40 SEGMENT="1">
         <TABNAM>EDI_DC40</TABNAM>
         <MANDT>100</MANDT>
         <DOCNUM>0000000002603007</DOCNUM>
         <DOCREL>700</DOCREL>
         <STATUS>30</STATUS>
         <DIRECT>1</DIRECT>
         <OUTMOD>2</OUTMOD>
         <IDOCTYP>DELVRY05</IDOCTYP>
         <MESTYP>DESADV</MESTYP>
         <SNDPOR>SAPKTS</SNDPOR>
         <SNDPRT>LS</SNDPRT>
         <SNDPRN>KTS100</SNDPRN>
         <RCVPOR>A000000016</RCVPOR>
         <RCVPRT>KU</RCVPRT>
         <RCVPFC>WE</RCVPFC>
         <RCVPRN>0004088156</RCVPRN>
         <CREDAT>20101123</CREDAT>
         <CRETIM>115322</CRETIM>
         <SERIAL>20101123115321</SERIAL>
      </EDI_DC40>
      <E1EDL20 SEGMENT="1">
         <VBELN>0080775647</VBELN>
         <VSTEL>0132</VSTEL>
         <VKORG>0130</VKORG>
         <LGNUM>132</LGNUM>
         <INCO1>EXW</INCO1>
         <INCO2>Leonding</INCO2>
         <ROUTE>009999</ROUTE>
         <VSBED>25</VSBED>
         <BTGEW>0.500</BTGEW>
         <NTGEW>0.500</NTGEW>
         <GEWEI>KGM</GEWEI>
         <VOLUM>0.000</VOLUM>
         <ANZPK>00000</ANZPK>
         <PODAT>20101123</PODAT>
         <POTIM>115321</POTIM>
         <E1EDL22 SEGMENT="1">
            <VSTEL_BEZ>Neuson Ersatzt.Linz II</VSTEL_BEZ>
            <VKORG_BEZ>Neuson Linz</VKORG_BEZ>
            <LGNUM_BEZ>LVS Neuson Linz Ersat. II</LGNUM_BEZ>
            <INCO1_BEZ>Ab Werk</INCO1_BEZ>
            <ROUTE_BEZ>NK Linz</ROUTE_BEZ>
            <VSBED_BEZ>Spedition</VSBED_BEZ>
         </E1EDL22>
         <E1EDL21 SEGMENT="1">
            <LFART>LF</LFART>
            <EXPKZ>X</EXPKZ>
            <LIFSK>10</LIFSK>
            <LPRIO>00</LPRIO>
            <KDGRP>02</KDGRP>
            <TRAGR>0100</TRAGR>
            <TRSPG>03</TRSPG>
            <E1EDL23 SEGMENT="1">
               <LFART_BEZ>Auslieferung</LFART_BEZ>
               <LIFSK_BEZ>zu verpacken</LIFSK_BEZ>
               <KDGRP_BEZ>Handel</KDGRP_BEZ>
               <TRAGR_BEZ>Transportgr. NK</TRAGR_BEZ>
            </E1EDL23>
         </E1EDL21>
         <E1EDL18 SEGMENT="1">
            <QUALF>ORI</QUALF>
         </E1EDL18>
         <E1ADRM1 SEGMENT="1">
            <PARTNER_Q>AG</PARTNER_Q>
            <PARTNER_ID>0004088156</PARTNER_ID>
            <LANGUAGE>EN</LANGUAGE>
            <FORMOFADDR>Firma</FORMOFADDR>
            <NAME1>Caterpillar Ltd.</NAME1>
            <STREET1>Peckleton Lane</STREET1>
            <POSTL_COD1>LE9 9JT</POSTL_COD1>
            <CITY1>Leicester</CITY1>
            <TELEPHONE1>14558258-00</TELEPHONE1>
            <COUNTRY1>GB</COUNTRY1>
         </E1ADRM1>
         <E1ADRM1 SEGMENT="1">
            <PARTNER_Q>SP</PARTNER_Q>
            <PARTNER_ID>0006006873</PARTNER_ID>
            <LANGUAGE>DE</LANGUAGE>
            <NAME1>DHL Express</NAME1>
            <STREET1>BleibtreustraÃu0178e 2</STREET1>
            <POSTL_COD1>1110</POSTL_COD1>
            <CITY1>Wien</CITY1>
            <TELEPHONE1>1 76600-3286</TELEPHONE1>
            <TELEFAX>1 76600-3475</TELEFAX>
            <COUNTRY1>AT</COUNTRY1>
            <REGION>W</REGION>
         </E1ADRM1>
         <E1ADRM1 SEGMENT="1">
            <PARTNER_Q>WE</PARTNER_Q>
            <PARTNER_ID>0004088156</PARTNER_ID>
            <LANGUAGE>EN</LANGUAGE>
            <FORMOFADDR>Firma</FORMOFADDR>
            <NAME1>Caterpillar Ltd.</NAME1>
            <STREET1>Peckleton Lane</STREET1>
            <POSTL_COD1>LE9 9JT</POSTL_COD1>
            <CITY1>Leicester</CITY1>
            <TELEPHONE1>14558258-00</TELEPHONE1>
            <COUNTRY1>GB</COUNTRY1>
         </E1ADRM1>
         <E1ADRM1 SEGMENT="1">
            <PARTNER_Q>OSP</PARTNER_Q>
            <PARTNER_ID>0132</PARTNER_ID>
            <LANGUAGE>DE</LANGUAGE>
            <NAME1>Neuson Ersatzt. Linz II</NAME1>
            <COUNTRY1>AT</COUNTRY1>
         </E1ADRM1>
         <E1ADRM1 SEGMENT="1">
            <PARTNER_Q>OSO</PARTNER_Q>
            <PARTNER_ID>0130</PARTNER_ID>
            <LANGUAGE>DE</LANGUAGE>
            <COUNTRY1>AT</COUNTRY1>
         </E1ADRM1>
         <E1EDT13 SEGMENT="1">
            <QUALF>006</QUALF>
            <NTANF>20101123</NTANF>
            <NTANZ>000000</NTANZ>
            <NTEND>20101123</NTEND>
            <NTENZ>000000</NTENZ>
            <ISDD>00000000</ISDD>
            <ISDZ>000000</ISDZ>
            <IEDD>00000000</IEDD>
            <IEDZ>000000</IEDZ>
         </E1EDT13>
         <E1EDT13 SEGMENT="1">
            <QUALF>003</QUALF>
            <NTANF>20101123</NTANF>
            <NTANZ>000000</NTANZ>
            <NTEND>20101123</NTEND>
            <NTENZ>000000</NTENZ>
            <ISDD>00000000</ISDD>
            <ISDZ>000000</ISDZ>
            <IEDD>00000000</IEDD>
            <IEDZ>000000</IEDZ>
         </E1EDT13>
         <E1EDT13 SEGMENT="1">
            <QUALF>001</QUALF>
            <NTANF>20101123</NTANF>
            <NTANZ>000000</NTANZ>
            <NTEND>20101123</NTEND>
            <NTENZ>000000</NTENZ>
            <ISDD>00000000</ISDD>
            <ISDZ>000000</ISDZ>
            <IEDD>00000000</IEDD>
            <IEDZ>000000</IEDZ>
         </E1EDT13>
         <E1EDT13 SEGMENT="1">
            <QUALF>007</QUALF>
            <NTANF>20101123</NTANF>
            <NTANZ>000000</NTANZ>
            <NTEND>20101123</NTEND>
            <NTENZ>000000</NTENZ>
            <ISDD>00000000</ISDD>
            <ISDZ>000000</ISDZ>
            <IEDD>00000000</IEDD>
            <IEDZ>000000</IEDZ>
         </E1EDT13>
         <E1EDT13 SEGMENT="1">
            <QUALF>010</QUALF>
            <NTANF>20101123</NTANF>
            <NTANZ>000000</NTANZ>
            <NTEND>20101123</NTEND>
            <NTENZ>000000</NTENZ>
            <ISDD>00000000</ISDD>
            <ISDZ>000000</ISDZ>
            <IEDD>00000000</IEDD>
            <IEDZ>000000</IEDZ>
         </E1EDT13>
         <E1EDT13 SEGMENT="1">
            <QUALF>015</QUALF>
            <NTANF>20101123</NTANF>
            <NTANZ>000000</NTANZ>
            <NTEND>20101123</NTEND>
            <NTENZ>000000</NTENZ>
            <ISDD>00000000</ISDD>
            <ISDZ>000000</ISDZ>
            <IEDD>00000000</IEDD>
            <IEDZ>000000</IEDZ>
         </E1EDT13>
         <E1EDL33 SEGMENT="1">
            <ALAND>AT</ALAND>
            <EXPVZ>3</EXPVZ>
            <IEVER>3</IEVER>
            <E1EDL34 SEGMENT="1">
               <EXPVZ_BEZ>StraÃu0178enverkehr</EXPVZ_BEZ>
               <IEVER_BEZ>StraÃu0178enverkehr</IEVER_BEZ>
            </E1EDL34>
         </E1EDL33>
         <E1EDL28 SEGMENT="1">
            <ROUTE>009999</ROUTE>
            <ROUID>NK LINZ</ROUID>
            <DISTZ>0.000</DISTZ>
            <E1EDL29 SEGMENT="1">
               <ROUTE_BEZ>NK Linz</ROUTE_BEZ>
            </E1EDL29>
         </E1EDL28>
         <E1EDL24 SEGMENT="1">
            <POSNR>000010</POSNR>
            <MATNR>000000001000248477</MATNR>
            <MATWA>000000001000003928</MATWA>
            <ARKTX>PNEUMATIC SPRING</ARKTX>
            <ORKTX>Gasfeder 350N/L185/Hub64</ORKTX>
            <SUGRD>0001</SUGRD>
            <MATKL>000040900</MATKL>
            <WERKS>0131</WERKS>
            <LGORT>E002</LGORT>
            <LFIMG>1.000</LFIMG>
            <VRKME>ST</VRKME>
            <LGMNG>1.000</LGMNG>
            <MEINS>ST</MEINS>
            <NTGEW>0.500</NTGEW>
            <BRGEW>0.500</BRGEW>
            <GEWEI>KGM</GEWEI>
            <VOLUM>0.000</VOLUM>
            <LADGR>0131</LADGR>
            <TRAGR>0100</TRAGR>
            <VKBUR>0131</VKBUR>
            <VTWEG>02</VTWEG>
            <SPART>01</SPART>
            <GRKOR>000</GRKOR>
            <POSEX>000000</POSEX>
            <VFDAT>00000000</VFDAT>
            <EXPIRY_DATE_EXT>0</EXPIRY_DATE_EXT>
            <VGBEL>0001416863</VGBEL>
            <VGPOS>000020</VGPOS>
            <ORMNG>         1.000</ORMNG>
            <EXPIRY_DATE_EXT_B>0</EXPIRY_DATE_EXT_B>
            <E1EDL25 SEGMENT="1">
               <LGORT_BEZ>Ersatzteill. 02</LGORT_BEZ>
               <LADGR_BEZ>Neuson Ersatzteile</LADGR_BEZ>
               <TRAGR_BEZ>Transportgr. NK</TRAGR_BEZ>
               <VKBUR_BEZ>Neuson Ersatzteile</VKBUR_BEZ>
               <VTWEG_BEZ>NK Ersatzteile</VTWEG_BEZ>
               <SPART_BEZ>Produktsparte 01</SPART_BEZ>
            </E1EDL25>
            <E1EDL26 SEGMENT="1">
               <PSTYV>ZERS</PSTYV>
               <MATKL>000040900</MATKL>
               <PRODH>409</PRODH>
               <UMVKZ>1</UMVKZ>
               <UMVKN>1</UMVKN>
               <UEBTO>0.0</UEBTO>
               <UNTTO>0.0</UNTTO>
               <E1EDL27 SEGMENT="1">
                  <PSTYV_BEZ>Normalpos Ersatzteil</PSTYV_BEZ>
                  <MATKL_BEZ>Gasfeder</MATKL_BEZ>
                  <PRODH_BEZ>Gasfeder</PRODH_BEZ>
                  <WERKS_BEZ>Wacker Neuson Linz GmbH ET</WERKS_BEZ>
               </E1EDL27>
            </E1EDL26>
            <E1EDL35 SEGMENT="1">
               <STAWN>83024900</STAWN>
               <EXPRF>10000</EXPRF>
               <EXART>1</EXART>
               <HERKL>FR</HERKL>
               <GRWRT>          0.00</GRWRT>
               <E1EDL36 SEGMENT="1">
                  <STXT1>Beschläge und ähnliche Waren, aus</STXT1>
                  <STXT2>unedlen Metallen, für anderweit nicht</STXT2>
                  <STXT3>genannte Zwecke (ausg. Scharniere, Lauf-</STXT3>
                  <STXT4>rädchen oder -rollen und Baubeschläge)</STXT4>
                  <EXPRF_BEZ>Ausfuhr o. voran. zollr. Best.</EXPRF_BEZ>
                  <EXART_BEZ>Kauf/Verkauf</EXART_BEZ>
                  <HERKL_BEZ>Frankreich</HERKL_BEZ>
               </E1EDL36>
            </E1EDL35>
            <E1EDL43 SEGMENT="1">
               <QUALF>C</QUALF>
               <BELNR>0001416863</BELNR>
               <POSNR>000020</POSNR>
               <DATUM>20101123</DATUM>
            </E1EDL43>
            <E1EDL41 SEGMENT="1">
               <QUALI>001</QUALI>
               <BSTNR>TEST FAH</BSTNR>
               <BSTDT>20101123</BSTDT>
            </E1EDL41>
         </E1EDL24>
      </E1EDL20>
   </IDOC>
</DELVRY05>
and thats what for the moment is the output for the EDIFACT before OPI2 conversion module. UNT segment count is hardcoded set to 1.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:EDIFACTMessage xmlns:ns0="http://cbsgmbh.com/xi/EDIFACT/99A">
   <Header>
      <SenderID>Test_SenderSystem</SenderID>
      <ReceiverID>Test_ReceiverSystem</ReceiverID>
      <MessageType>EDIFACTMessage</MessageType>
   </Header>
   <ListOfDespatchAdvises>
      <DespatchAdvise>
         <HEADING>
            <UNH>
               <UNH01>0000000002603007</UNH01>
               <UNH02>
                  <S00901>DESADV</S00901>
                  <S00902>D</S00902>
                  <S00903>98B</S00903>
                  <S00904>UN</S00904>
               </UNH02>
            </UNH>
            <BGM>
               <BGM01>
                  <C00201>351</C00201>
               </BGM01>
               <BGM02>
                  <C10601>0000000002603007</C10601>
               </BGM02>
               <BGM03>9</BGM03>
            </BGM>
            <DTM>
               <DTM01>
                  <C50701>11</C50701>
                  <C50702>00201011230000</C50702>
               </DTM01>
            </DTM>
            <DTM>
               <DTM01>
                  <C50701>132</C50701>
                  <C50702>00201011230000</C50702>
               </DTM01>
            </DTM>
            <DTM>
               <DTM01>
                  <C50701>137</C50701>
                  <C50702>00201011230000</C50702>
               </DTM01>
            </DTM>
            <MEA>
               <MEA01>PD</MEA01>
               <MEA02>
                  <C50201>G</C50201>
               </MEA02>
               <MEA03>
                  <C17401>KGM</C17401>
                  <C17402>0.500</C17402>
               </MEA03>
            </MEA>
            <MEA>
               <MEA01>PD</MEA01>
               <MEA02>
                  <C50201>N</C50201>
               </MEA02>
               <MEA03>
                  <C17401>KGM</C17401>
                  <C17402>0.500</C17402>
               </MEA03>
            </MEA>
            <MEA>
               <MEA01>PD</MEA01>
               <MEA02>
                  <C50201>WT</C50201>
               </MEA02>
               <MEA03>
                  <C17401>KGM</C17401>
                  <C17402>0.500</C17402>
               </MEA03>
            </MEA>
         </HEADING>
         <DETAIL>
            <CPS>
               <CPS01>1</CPS01>
               <CPS03>3</CPS03>
            </CPS>
            <SG16>
               <LIN>
                  <LIN02>000010</LIN02>
               </LIN>
               <PIA>
                  <PIA01>1</PIA01>
                  <PIA02>
                     <C21201>0001416863</C21201>
                     <C21202>PO</C21202>
                  </PIA02>
               </PIA>
               <PIA>
                  <PIA01>1</PIA01>
                  <PIA02>
                     <C21201>000020</C21201>
                     <C21202>PL</C21202>
                  </PIA02>
               </PIA>
               <PIA>
                  <PIA01>1</PIA01>
                  <PIA02>
                     <C21201>TEST FAH</C21201>
                     <C21202>ON</C21202>
                  </PIA02>
               </PIA>
            </SG16>
         </DETAIL>
         <SUMMARY>
            <UNT>
               <UNT01>1</UNT01>
               <UNT02>0000000002603007</UNT02>
            </UNT>
         </SUMMARY>
      </DespatchAdvise>
   </ListOfDespatchAdvises>
</ns0:EDIFACTMessage>

Similar Messages

  • Mapping IDoc - only one Segment is mapped!

    Hi, well i am trying FCC IDoc to File. FCC i already discussed quite extensive with no result. So i checked the other parts of my scenario where i found out that only one of my source segments in the idoc is mapped.
    Source:
    <?xml version="1.0" encoding="UTF-8"?>
    <ZBC01_OUTPUT_ZEIT>
       <IDOC BEGIN="1">
          <EDI_DC40 SEGMENT="1">
             <TABNAM>EDI_DC40</TABNAM>
             <SERIAL>20070612110222</SERIAL>
          </EDI_DC40>
          <ZBC01_OUTPUT_ZEIT SEGMENT="1">
             <DUMMY01>** Y0000</DUMMY01>
             <AUSWEISNR>1775</AUSWEISNR>
             <DUMMY02>00400FFFF00</DUMMY02>
             <TAG>1306</TAG>
             <DUMMY03>01</DUMMY03>
             <SALDO>+90000</SALDO>
             <DUMMY04>.</DUMMY04>
          </ZBC01_OUTPUT_ZEIT>
          <ZBC01_OUTPUT_ZEIT SEGMENT="1">
             <DUMMY01>** Y0000</DUMMY01>
             <AUSWEISNR>1776</AUSWEISNR>
             <DUMMY02>00400FFFF00</DUMMY02>
             <TAG>1306</TAG>
             <DUMMY03>03</DUMMY03>
             <SALDO>+4</SALDO>
             <DUMMY04>.</DUMMY04>
          </ZBC01_OUTPUT_ZEIT>
          <ZBC01_OUTPUT_ZEIT SEGMENT="2">
             <DUMMY01>** Y0000</DUMMY01>
             <AUSWEISNR>1777</AUSWEISNR>
             <DUMMY02>00400FFFF00</DUMMY02>
             <TAG>1306</TAG>
             <DUMMY03>02</DUMMY03>
             <SALDO>+820</SALDO>
             <DUMMY04>.</DUMMY04>
          </ZBC01_OUTPUT_ZEIT>
       </IDOC>
    </ZBC01_OUTPUT_ZEIT>
    Target-Output in test environment:
    <?xml version="1.0" encoding="UTF-8"?>
    <MTZEIT>
         <ZeitRecordSet>
              <ZeitDetailsStructure>
                   <DUMMY01>** Y0000</DUMMY01>
                   <AUSWEISNR>1775</AUSWEISNR>
                   <DUMMY02>00400FFFF00</DUMMY02>
                   <TAG>1306</TAG>
                   <DUMMY03>01</DUMMY03>
                   <SALDO>+90000</SALDO>
                   <DUMMY04>.</DUMMY04>
              </ZeitDetailsStructure>
         </ZeitRecordSet>
    </MTZEIT>
    So it's only the first segment of the source.
    The source datatype (IDoc) has the occurence of 1.999999999 and the attributes in it 0..1.
    The target has
                                      Occurence
    MTZEIT                       1..1
    -ZeitRecordSet             1..unbounded
    --ZeitDetailsStructure    1..unbounded
    ---DUMMY01                0..unbounded
    ---AUSWEISNR            0..unbounded
    ---others                       0..unbounded
    The Output should contain all segmets given from source. What is wrong?
    br Jens

    Hi Sumit
    Well my problem is not solved, unfortunately i am not able to put the single given segments among each other in the target file.
    RecordsetStructure:ZeitRecordSet, ZeitDetailsStructure
    ZeitDetailsStructure.fieldFixedLengths = 8,4,14,4,2,6,1
    ZeitDetailsStructure.fieldNames = 'DUMMY01','AUSWEISNR','DUMMY02','TAG','DUMMY03','SALDO','DUMMY04'
    ZeitDetailsStructure.fieldSeparator = 'nl'
    ZeitRecordSet.endSeparator='nl'
    the target file is written like:
    Y0000177500400FFFF00   13060190000.   ** Y0000177600400FFFF00   1306034    .  ** Y0000177700400FFFF00   130602+820  .               
    any ideas?!
    Solved it on my own now....thx   !
    Message was edited by:
            Jens S

  • How to map IDoc segment with qualifiers

    Hi everyone!
    I have the following problem: In an IDoc of type DESADV01 there can be several segments of type E2EDS01. Each segment has a different qualifier, which is the value of the field SUMID in this case. My target structure (type EDIFACT) now has several segments, each again with a sort of qualifier. Now I have to map the values of certain source segments to the respective target segments.
    Exaple (in XML format):
    Source
      <E1EDS01 SEGMENT="1">
        <SUMID>021</SUMID>
        <SUMME>0000000001.000</SUMME>
        <SUNIT>KGM</SUNIT>
      </E1EDS01>
      <E1EDS01 SEGMENT="1">
        <SUMID>022</SUMID>
        <SUMME>0000000001.000</SUMME>
        <SUNIT>KGM</SUNIT>
      </E1EDS01>
    Target
      <S_MEA>
        <C_C502>
          <D_6313>N</D_6313>
        </C_C502>
        <C_C174>
          <D_6411>KGM</D_6411>
          <D_6314>1</D_6314>
        </C_C174>
      </S_MEA>
      <S_MEA>
        <C_C502>
          <D_6313>G</D_6313>
        </C_C502>
        <C_C174>
          <D_6411>KGM</D_6411>
          <D_6314>1</D_6314>
        </C_C174>
      </S_MEA>
    (i have omitted several details here, but I'm only interested in the general procedure anyway).
    So in general the source segment with qualifier "021" should be mapped to a target structure with qualifier "N" etc.
    How can this be done using standard XI mapping techniques?
    Regards, Joerg

    Hi everyone!
    Thanks for your input data - unfortunately this wasn't quite what I was looking for. However I thik I solved my original problem and I just wanted to share this solution with you - maybe it helps others, maybe some of you have suggestions what I could do differently.
    To sum up the requirement: There can be multiple input segments, each with a certain qualifier. These input segments have to be mapped to the target segments, respectively - however, the qualifiers change. There can be several segments with qualifiers that do not match the requirement, and required segments might be missing.
    So here's what I came up with:
    Use the qualifier of the source segments as an input to a <b>FixValues</b> function. In this function, map the desired qualifiers to the value <b>true</b>, use <b>false</b> as the default value. Map the output of the <b>FixValues</b> function to a <b>createIf</b> function and use this to create the desired output segment. This way, for each of the required segments, one target segment will be created. All other segments (with unwanted qualifiers) will be removed.
    So far, this technique worked for me - do you have improvements/suggestions?
    Regards, Joerg

  • How to map idoc segment field E1IDB02-FIIKONTO with BSEG-ESRNR.

    Hi,
    I have searched for lot of threads in the forum , and also i tried myself but i am not able to map this fields segment with my logic, so please anyone kindly contribute in mapping idoc segment field  with the logic given below:
    idoc type :PAYEXT  outbound idoc.
    message type: PEXR2002
    This is my logic: i need to populate the ISR number(BSEG-ESRNR  ) in idoc segment field( E1IDB02-FIIKONTO)
    DATA : str1 TYPE string,
          len1  TYPE i,
          len2  TYPE i,
          str2  TYPE string,
          str3  TYPE string.
    str1 = '01-1234-4'. ---> BSEG-ESRNR  "ISR Subscriber Number
    REPLACE FIRST OCCURRENCE OF '-' IN str1 WITH '_'.
    REPLACE ALL OCCURRENCES OF  '-' IN str1 WITH space.
    CONDENSE str1.
    len1 = STRLEN( str1 ).
    IF len1 LT '9'.
    len2 = '9' - len1.
    CASE len2.
       WHEN '1'.
         REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '00'.
       WHEN '2'.
         REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '000'.
       WHEN '3'.
         REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '0000'.
       WHEN '4'.
         REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '000000'.
       WHEN OTHERS.
    ENDCASE.
    ELSEIF len1 EQ '9'.
    REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '0'.
    ELSEIF len1 GT '9'.
    REPLACE ALL OCCURRENCES OF '_' IN str1 WITH space.
    CONDENSE str1.
    ENDIF.
    Thanks in Advance.

    Resolved.

  • I facing one situtation in mapping  Custmosied IDOC  a new segment is add t

    HI Gurus
    I facing one situtation in mapping  Custmosied IDOC  a new segment is add to that IDOC.... i want to display values in queues in mapping test.. but queue is empty it showing ,,,
    already i have checked IDX2 .. in that it is updated about the segement .. let me know solutiuon y it is not populate in that segemnt ..\
    thanks in advance.

    Hi ,
    Have you imported the IDOC into ESR after the changes were done in the ECC side?
    Is the mapping done for the new segment/fields properly?
    Please check what values are passed in the segment from ECC?Try triggering a message from WE19 with test values and check if you are receiving the same?
    Please explain little more on this...
    Regards,
    Srinivas

  • Mapping IDOC to XML - Context problem

    Hello,
    I am trying to map up to 2 segments from an ORDERS IDOC into one segment in my PO XML. 
    In the target PO XML document both segments UltimateCustomer and ParticipatingDealer are under the heading SalesOrderData.
    <Header>
    ...<SalesOrderData>
    .......<UltimateCustomer>
    ............<Name>
    ............<address>
    ....................<street>
    ....................<city>
    ......<ParticipatingDealer>
    ............<Name>
    ............<address>
    ....................<street>
    ....................<city>
    So I only create the SalesOrderData segment if at least one of the two E1EDKA1 segments exists where PARVW = ZO or ZU then I want to repliate those segments into their target fields.
    ZO - Ultimate Customer
    ZU - Participating Dealer
    When both values exist I am only getting the data from the first segment (ZO or ZU) but not both.  With the following mapping.
    If PARVW (IDOC Context) = ZO or PARVW (IDOC Context) = ZU ...CreateIf...SalesOrderData
    If PARVW = ZO...CreateIf...UltimateCustomer.
    If PARVW = ZU ...CreateIf...ParticipatingDealer.
    I tried many context combinations to get both segments to appear but the only time I could get them both to appear is if I force the creation of SalesOrderData.  (Constant[]...SalesOrderData).  This of course creates a blank node when ZO and ZU do not exist.  Which is not a good solution.
    Any suggestions?
    Thanks,
    Matt

    chk this:
    Mapping of "Header":
    PARVW(context IDOC)----
    --------------------equals ----
    Constant(ZO)
    -------------------------------------OR-----IfWithoutElse(Constant()----then)--------collapseContext------HEADER
    PARVW(context IDOC)----
    --------------------equals ----
    Constant(ZU)
    Mapping of "UltimateCustomer":
    PARVW----
    --------------------equals ----IfWithoutElse(Constant()----then)-----removecontext---------UltimateCustomer
    Constant(ZO)
    Mapping of "ParticipatingDealer":
    PARVW----
    --------------------equals ----IfWithoutElse(Constant()----then)-----removecontext---------ParticipatingDealer
    Constant(ZU)
    Mapping of "name" under "UltimateCustomer":
    PARVW----
    ---------------equals ----IfWithoutElse(Name(from source)---then)--removecontext----splitbyvalue(each value)--Name
    Constant(ZO)
    In the same way (like "Name" field mapping) proceed for the rest of the target fields....

  • Problem with mapping [Idoc to EDI]

    Hi experts,
    i am facing a new problem in my mapping (idoc to edi scenario)
    my target is as follow:
    InvoiceDME
    >Invoice 1..1
    >>InvoiceHeader 1..1
    >>>IncotermsCode 1..1
    My Idoc is as follow:
    IDOC
    >E1EDK17 0..20
    >>QUALF
    >>LKOND
    >>LKTEXT
    There can be 2 scenarios in my source:
    1st:
    IDOC
    >E1EDK17
    >>QUALF = 001
    >>LKOND = lkond001
    >>LKTEXT
    2nd:
    IDOC
    >E1EDK17
    >>QUALF = 001
    >>LKOND = lkond001
    >>LKTEXT
    >E1EDK17
    >>QUALF = 002
    >>LKOND = lkond002
    >>LKTEXT = lktext002
    If QUALF=002 then I have to take both values of LKOND and LKTEXT and map them to incotermcode
    else if qualf=001 alone, then map LKOND to incotermcode
    my mapping is as follow:
    http://www.flickr.com/photos/30317046@N05/2862446903/
    as you can see, the problem is if i am in my second scenario, i get the wrong value in incotercode (lkond001 instead of the concatenate of LKOND and LKTEXT for QUALF = 002)
    Do you have any idea how I can solve this??
    Thanks a lot,
    Regards,
    Jamal

    Actually i used java mapping:
        //write your code here
    try
         String returnString = "";
         for (int i = 0; i < QUALF.length; i++)
              if (("002".equals(QUALF<i>.trim())))
                   returnString = returnString +" "+ LKOND<i> +" "+ LKTEXT<i>;
                   result.addValue(returnString);                   
    catch(Exception e)
         e.printStackTrace();
    and the condition on the 'count' of QUALF (if = 2 then else)
    Thanks,
    Regards,
    Jamal

  • Functional Specs for Mapping Idocs to EDI

    Hello Friends ..
    Am new to world of EDI...
    can any one explain ..wat do u mean by devolping functional specs for mapping IDocs to EDI..
    If you can provide me with examples or if you guys can suggest any site where i can browse some material about EDI..i wud really appreciate...
    Best Regards

    Hi Rohan,
    >>>do u mean by devolping functional specs for mapping IDocs to EDI..
    you have to know which idoc fields you have to map to EDI message fields
    take a look at those links:
    they will show how do you map different IDOC message types to EDI messages
    <b>IDOC - EDI mappings:</b>
    http://www.sapgenie.com/sapedi/mapping.htm
    <b>Analysis of the compatibility of EDIFACT messages in the form of SIMPL-EDI with the IDoc Interface:</b>
    http://www.sapgenie.com/sapgenie/docs/SIMPL-EDI-E_ORDERS.doc
    Regards,
    michal

  • ALE: mapping IDoc fields to change document fields - TBD22 for ADRMAS iDoc

    Hi,
    I am currently try to find a table or way to extract the information of the TBD22 table (ALE: mapping IDoc fields to change document fields) for the iDocs/ Message Types:
    ADRMAS
    INTERNAL_ORDER
    PROJECT
    I am looking for a table that shows me to which SAP R/3 tables and fields the segments and fields of the above mentioned messages will be mapped to.
    When I add one of the above mentioned message types to the table TBD22 selection criteria I always receive the notification: "No table entries found for specific key".
    Could anybody determine Which table I have to use or why I cannot extract this information?
    Thanks in advance!
    Best regards

    Hi,
       Since we can not map the target IDOC when any of the field changes using nodefunctions , you can write UDF and check the same i.e if field1 changes or field2 changes or field3 changes then trigger new IDoc. This is one of the options that you can try...please try it once.
    Regards
    Priyanka

  • Problem in Segment count

    Hi guys,
    I have a problem with segment count.
    I.e. I want to count the customer , on the RESPONSE fact table, with a response by MAIL channel and response date >03/11/2009.
    On the segmentation module i create a segment:
    start with RESPONSE_METOD='EMAIL' (count 107 customer)
    Keep RESPONSE DATE > 03/11/2009 ( count 12 customer)
    TOTAL COUNT OF SEGMENT 12 customer. It's wrong because the correct answer is 7 customer.
    instead
    if i create a single "level of segmentation", as follow, it's work:
    Start with RESPONSE_METOD='EMAIL' and RESPONSE DATE > 03/11/2009 (TOTAL COUNT 7 customer)
    How is possible? I try to generate log file to look query but i receive the error "no log found" ( in rpd file i set log level at 2 for the user)
    Best reguards for some suggestion
    Bye

    Hello User -
    Try setting the log level = 7 for the user in the RPD, then save the RPD, clear cache in both RPD and presentation services, and re-run the request. This should allow you access to see the log in "Settings > Administration > Manage Sessions".
    Once you do this, maybe you can paste the log in your next post and we can better attack the issue?
    I hope this helps, and please give points if you found this useful!
    Regards,
    Jason

  • Using PI to map IDoc BENEFIT3 to EDI 834

    Has any used PI/XI to map IDoc BENEFIT3 to EDI 834?  We are looking to use this approach but have had problems finding a standard map.  You would think SAP would have one since they stand by their BENEFIT3 IDoc being sufficient to map to the 834.  This will take forever to do it from scratch or even without an example.  Help please.

    Hi
    You can do 1:n multimapping
    in message mapping in messages tab ..add both the structures in target tab and do the mapping
    and in operation mapping add both the message interface on the target side
    PLease go through this blog
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

  • I have a scenario,  ECC-PI-Message broker. ECC sending IDOC to  PI, PI execute mapping and  sending data to Message borker.(with almost one to one mapping)., IDOC(AAE)-PI-JMS. Now my requirement is., from PI  after mapping we need to save file in SAP fold

    I have a scenario,  ECC-PI-Message broker. ECC sending IDOC to  PI, PI execute mapping and  sends data to Message borker(thru JMS channel).(with almost one to one mapping)., IDOC(AAE)-PI-JMS. Now my requirement is., from PI  after mapping we need to create file with same data what ever send to Message broker and put the file in SAP folder without touching mapping. Is it possible? Please advise with the steps. We are using the ICO for this senario. Quick response is appriciated.

    Hi Pratik,
         http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42?quicklink=index&overridelayout=true
    This link might help.
    regards
    Anupam

  • How to map Idoc fields with external file

    Hi All,
    How to map Idoc fields with external file.
    I want to check the settings where Idoc fields are mapped with external file.
    Thanks in advance.
    Regards,
    Govind.

    If you have configured a fileport where on trigger of IDOC you are creating the file, you can look at the message type documentation and get the offset values for each field in each segment

  • HOW TO MAP IDOC TO XML

    Hi,
      I need to map IDOC to xml but the problem is I have 400 fields in IDOC which  are to be mapped to 20 elements in XML.
          As it a tedious process to go to 400 fields for each xml element.Is their any better way to find correct field in IDOC with very minial time rather going 400 fields for each xml element.
    thanks
    sreeram

    hi,
    >>1)Even SAP it self does not encourage to use ABAP >>MAPPING and
    i dont know where you have read this, but ABAP mapping is one of the most popular/ most efficient and highly recomended by SAP. I have used it in tons of places.
    >>2)More over Iam not ABAP resource.
    you could also do a java mapping.
    there is no other easy way if you are not doing abap/java mapping. you are then left with the only option of using the graphical editor.
    cheers,
    Naveen
    Message was edited by: Naveen Pandrangi

  • Segment Count is wrong in Oracle B2B

    Hi,
    Greetings to B2B Gurus!!!
    We are processing 810 invoice files for one of customer and facing an issue with Segment Count (SE01). When i process the files via B2B, payload message is failed with validation error. If i remove validation check, EDI file got generated without any issues. Please find the sample edi file that got generated.
    Total Number of Lines from SE-ST = 30 but the value shows 38.
    ST*810*1118
    BIG*20130320*5024274872**30440*30440**DI
    N1*ST*RAILWAY
    N3*100 NE JEFFERSON TRFWAY
    N4*TOPEKA*KS*66607
    N1*BT*BNSF RAILWAY
    N3*2500 LOU MENK DR
    N4*FORT WORTH*TX*76131
    N1*RE*Ricoh USA, Inc.
    N3*P.O. Box 660342
    N4*DALLAS*TX*752660342
    ITD*01*3****20130330
    IT1*R*4414*QB*10****SN*C86007989
    PID*F****413606 TOPEKA KS 30440RICOH, MP2000 USAGE ITEM FOR TOTAL COUNTERS
    REF*91*602134
    IT1*R*4414*QB*10****SN*C86007989
    PID*F****413606 TOPEKA KS 30440RICOH, MP2000 USAGE ITEM FOR TOTAL COUNTERS
    REF*91*602134
    IT1*R*4030*QB*10****SN*C86007989
    PID*F****413606 TOPEKA KS 30440RICOH, MP2000 USAGE ITEM FOR TOTAL COUNTERS
    REF*91*602134
    IT1*R*3838*QB*10****SN*C86007989
    PID*F****413606 TOPEKA KS 30440RICOH, MP2000 USAGE ITEM FOR TOTAL COUNTERS
    REF*91*602134
    TDS*27286
    TXI*CS*0****1
    TXI*CT*0****1
    TXI*ST*22.42**CD*KS
    CTT*4
    SE*38*1118
    Any help on this highly appreciated.
    Thanks,
    Saravana

    Hi Saravana,
    Are you passing the segment count from from back-end or you are using segment count macro in the EDI XML so that B2B can generate the count for you?
    When i process the files via B2B, payload message is failed with validation error.If B2B is generating segment count, then this might be the reason behind incorrect count. May I know exactly what validation error do you get?
    Regards,
    Anuj

Maybe you are looking for

  • I'm so screwed....What are my options?

    My iPhone fell out of my pocket tonight and almost completely flushed down the toilet....I got it out and now it's buried inside a bowl of rice inside a ziploc baggie BUT.... There are no other phones available right now. It's only been a few hours b

  • Date  format in awm

    Do anyone know how to change date formal in awm? my time dim take the date like '01/13/2007' and I want like '13/01/2007' I have Error Occured: ORA-01843 and I think is because of the format of the date... what do u think? thank you

  • A question about" fn:substringAfter"?

    The EL ${fn:substringAfter("http://www.wutka.com", "http://") } returns "www.wutka.com". But if the "http://www.wutka.com" is a value in a variable in the session or page, such as '${urlName}', or '<c:set var="url" value=${urlName}/>' , how to return

  • Integrating third party components in java

    Hi All, I have a doubt, as in .net u can add third party components in ur application and use the functionality of that e.g u can add third party datagrid in .net, In similar way are there any third party components in java, if yes how do we integrat

  • ITunes Image Optimization

    Is there a purpose for image optimization? Why won't Apple let it's users decide to optimize photos or not?