Segment count in EDIFACT ORDERS

Hi,
Can anyone advise which function to use to calculate the number of segment in the message trailer (EDIFACT D98A ORDERS UNT/0074)?
Regards,
Scott.

I had to do a two activities to get the count:
(1) Create a variable contains the list of element containing the name "Segment"
<xsl:template match="/">
<tns:SegmentList>
<xsl:for-each select="//*[position() &lt;= 99]">
<xsl:if test="contains(name(), 'Segment')">
<tns:SegmentName>
<xsl:value-of select="name()"/>
</tns:SegmentName>
</xsl:if>
</xsl:for-each>
</tns:SegmentList>
</xsl:template>
</xsl:stylesheet>
(2) Use an assign activity to perform the countNodes
<assign name="Assign_SegmentCount">
<copy>
<from expression="ora:countNodes('Variable_segmentList','/ns3:SegmentList/ns3:SegmentName')"/>
<to variable="SendPurchaseOrder_send_InputVariable" part="body"
query="/ns4:Transaction-ORDERS/ns4:Segment-UNT/ns4:Element-0074"/>
</copy>
</assign>
Cheers,
Scott.

Similar Messages

  • 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>

  • Count of Service Orders issue in the Bex Report

    Hi Experts,
    I have a report displaying the Count of Service Orders. The count of service orders I have brought using replacement path variable.
    The count is getting displayed correctly. When I have the service order in a single record.
    The moment I drag and drop the material from the Free Characteristic pane. The count of Servie order increases because the same service order is repeated for Material A ( in the First Line) and Material B ( in the Second Line ).
    And my report doesn't have any keyfigure to built an Exception Aggregate.
    Can anyone please tell me how do I make my Count to read only the unique Service orders.
    Thanks

    Hi Shanthi Bhaskar,
    Thanks for your link.
    I have already referred to this link and created the count of Service orders. But it is not uniquely identifys the service order numbers.
    Irrespective how many number of time the same service order gets repeated in the report it should only give me a count as 1 for other service order as 2.
    Hope its clear.
    Thanks

  • How to manage the same counter based on Order Number and Order Items

    Hi All,
       we need some help to build an infocube and a query as described in the following scenario.
    ODS 1 (Order Numbers aggregated at month level) defined as:
    - Order Month
    - Customer
    - Counter
    ODS 2 (Order Items aggregated at month level) defined as:
    - Order Month
    - Customer
    - Product
    - Counter
    We would like to build an InfoCube that allows us to create a query through which we are able to compare:
    -  ODS 1 - Counter, that means the number of orders without considering the product
    -  ODS 2 - Counter, that means the number of orders where a specific product is included
    For example:
    ODS 1:
    Order Month........Customer........Counter
    200701...............20001.............10
    200701...............20002.............5
    ODS 2:
    Order Month.............Customer...................Product..........Counter
    200701.....................20001.......................A....................1
    200701.....................20001.......................B....................10
    200701.....................20002.......................A....................4
    200701.....................20002.......................C....................5
    The desired query should show the following result
    Ord Month.Customer..Product.....Counter....Counter
    .................................................(ODS2).....(ODS1)
    200701......20001.......A..............1..............10
    200701......20001.......B..............10.............10
    200701......20002.......A..............4..............5
    200701......20002.......C..............5..............5
    Do you have any idea how to get this result?
    Thanks
    Kind Regards

    Hi Valeria,
        Have a look,
    <a href="http://sapbwneelam.blogspot.com/2007/08/sap-tables.html">How to... Count the occurrences of a characteristic</a>
    <a href="http://sapbwneelam.blogspot.com/">More Docs .....</a>
    Hope it Helps
    Srini

  • 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

  • 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

  • How to delete E1EDP19 002 segment frm the inbound ORDERS IDoc?

    Hi ABAP/EDI experts,
    I am implementing an User exit related to inbound Sales order EXIT_SAPLVEDA_001.
    Most of the time my IDocs contain the below segments.
    E1EDP19 001 (QUALF = '001')
    E1EDP19 002 (QUALF = '002')
    Sometimes, IDoc contain only E1EDP19  001 (QUALF = '001') segment.
    My problem is whenever i have two E1EDP19 segments, i want to delete the 1st E1EDP19 segment and retain the second E1EDP19 segment.
    Can anyone tell me the pseudocode for deleting the 1st E1EDP19 segment from the inbound orders IDoc.
    Am i using the correct user exit??
    Thanks,
    Creasy Matt
    Edited by: Creasy Matthew on Jan 22, 2009 12:56 AM

    Hi Matt,
    You can loop on idoc_data internal table. This table will be having all the data and the segments.
    data: l_count type i value 0,
            l_tabix type sy-tabix.
    LOOP AT idoc_data WHERE docnum = idoc_contrl-docnum.
    CASE idoc_data-segnam.
    WHEN e1edp19.
    l_tabix = sy-tabix.
    l_count = l_count + 1.
    if l_count = 2.
       l_tabix = l_tabix -1.
      delete idoc_data index l_tabix.
    endif.
    ENDCASE.
    ENDLOOP.
    I hope this will work.
    Please let me know if any issues.

  • Unable to acknowledge a outbound EDIFACT ORDERS document.

    Hi,
    We are sending a EDIFACT ORDERS ( D98A version ) to one of our partner and it is successfully reaching the destination folder. Since we are expecting the funtional acknowledgement from partner i have checked the "Functional ack " and also set the "FA Handled by B2B " to "YES" . So once the data reached to the partner message status is "MSG_WAIT_FA" . Although the partner is sending functional acknowledgement back to us and it is successfully consumed by Oracle B2B still the messaage status for EDIFACT ORDERS is "MSG_WAIT_FA" . Please help me to resolve this issue.
    Below are the configuration what i did.
    1) Created a new agreement for D3 CONTRL
    2) The Functional Ack Handled by B2B=true
    3) checked FA handled by B2B = Yes in D98A ORDERS agreement
    4) Functional Ack = checked in D98A ORDERS agreement
    5) Both ORDERS and CONTRL agreements Saved-->Validated and deployed.
    6) I have created the listening channel for CONTRL agreement.

    Hi Anuj,
    Thank you so much for your advise. There was a mismatch in the control number in CONTRL document. Now its working fine. Thank you once again.

  • Why we should assign Profitability Segment Number in sales Order

    Dear Gurus,
    Can any one tell me why we should assign profitability Segment Number in Sales Order?
    While i am createing the sales order system is asking to assign profitability Segment Number and WBS Element. Even though there is no specific assignment of these fields for incompletion log.
    Can anyone tell me what exactly is the functionality behind this Profitability Segment number?
    Good answers are rewarded with points
    Thanks and Regards
    SAP SD
    Yoganand

    Hi,
    If CO-PA is active settlement transfer the costs and revenue of the sales order item to profitability segment in CO-PA, if not active it gets transferred to G/L account in FI.
    Regarding functionality of Profitability segment - Need to specify Characteristics in CO-PA for profitability segments and these characteristics are used for Information system and planning. Charcteristics which are not involved in profitablity segment remains in the line item of CO-PA. In essence charcteristics decides on profitablity segments.
    Regarding removal of Profitablity segment no in Sales order .Kindly refer back to the earlier threads.
    Thanks & Regards
    Madhu

  • Segment Count updated date shows a future date

    Hi all,
    When the cursor is moved on the Segment's count it shows future date as 'Updated Date'.
    It's happening for the fresh update count of any Segment/Segment Tree in the application. When the cursor is moved on the counts of any segment which was updated in the past show correct date.
    We tried doing a fresh 'Update Counts' and saving the Segment, still when the cursor moved on the count it shows a future date as updated date.
    Web server and Analytics server system dates are set to correct date.
    But in the Marketing Administration tool sessions show correct dates.
    Any quick update/help is greatly appreciated.
    Thanks in advance.

    with
    data_table as
    (select 'A' task,date '2013-12-01' started,date '2013-12-05' ended from dual union all
    select 'B',date '2013-12-03',date '2013-12-04' from dual union all
    select 'C',date '2013-12-04',date '2013-12-05' from dual union all
    select 'D',date '2013-12-06',date '2013-12-07' from dual
    date_periods as
    (select date '2013-12-01' started,date '2013-12-03' ended from dual union all
    select date '2013-12-03',date '2013-12-04' from dual union all
    select date '2013-12-04',date '2013-12-05' from dual union all
    select date '2013-12-06',date '2013-12-07' from dual
    select to_char(p.started,'yyyy-mm-dd') "Start",
           to_char(p.ended,'yyyy-mm-dd') "End",
           count(*) "Count",
           '('||listagg(t.task,',') within group (order by t.task)||')' "(Jobs)"
      from date_periods p
           left outer join
           data_table t
        on greatest(t.started,p.started) < least(t.ended,p.ended)
    group by p.started,p.ended
    order by p.started
    Start
    End
    Count
    (Jobs)
    2013-12-01
    2013-12-03
    1
    (A)
    2013-12-03
    2013-12-04
    2
    (A,B)
    2013-12-04
    2013-12-05
    2
    (A,C)
    2013-12-06
    2013-12-07
    1
    (D)
    Regards
    Etbin

  • Count on sales orders

    Hi All
       My requirement is result of report should display no. of sales orders per year/ Per sales organisation/per item. Anyone can suggest me how to proceed to create such type of report in BI7.0.
    Thanks
    Vani

    Hi Vani,
      If we have counter in cube for sales orders then we can create RKF on the counter by restricting it to year, sales org & material else what we can do is we can create a ckf or new formula to create counter for sales documents give exception aggregation as counter for all detailed values and take reference characteristic as sales document then restrict this key figure to year/sales org/item.
    we can achieve our requirement by doing this.
    Hope it helps,
    Thanks,
    Sathish.

  • Missing data: Profitability segment no. in Sale order creation

    Hi Gurus,
    while creating a Sales order, I am getting the Below Error;
    "Error while the Operating Concern being determined"
    Massage no: KE/AD817
    Error: Missing data: Profitability segment no.
    Its Urgent..
    Can anybody suggest....
    Thanks
    BKT

    Hi Bani,
    Please check if note 380102 helps in this case. From the long text of the error message you can find out which charachteristic is responsible for the error message.
    Regards,
    Abhisek

  • Desactivate Profit Segment in a Purchase Order

    Hello,
    When we post a purchase order the field "Profit Segment" is automatically filled. When we check the controlling document created it creates a line with CO Object: PSG - profit segment.
    Although we need to post cost center in one specific document type. If we put manually  the cost center and system puts automatically the profit segment in the end the controlling document will have 2 lines: CTR (cost center) and PSG (profit segment). In this case the cost center becomes with value type 11 "statistical actual".
    Since we need to do postings in SD in cost center with value type 4 "Actual" is it possible to deactivate the field "Profit Segment" in a specific document type?
    I've already tried to do it in transaction KE4W but the field "Profit Segment" is still with values and in controlling document the line PSG is still there. The only thing that happened was that Profitability Analysis document wasn't created.
    Best Regards,

    Hello,
    I've already checked the derivation rules in the system but there's anything that related with this.
    Best Regards,

  • OBIEE: Incorrect SQL - with count function uses ORDER BY instead GROUP BY

    I made a basic report that is a client count; I want to know how many clients the company have.
    But, when I run this report, OBIEE generates a ORDER BY sentence, instead a GROUP BY. Remember that I'm using count function, that is a agregation.
    The SQL generated was:
    select 'N0' as c1,
    count(*) as c2
    from
    (select distinct T1416.CLIENT_INTER_KEY as c1
    from
    (select *
    from prd.D_SERVICE where SOURCE_SYS in ('ARBOR','PPB') and DW_SERV_ST_ID in (100000003,100000009)) T1836,
    (select *
    from prd.D_CLIENT) T1416,
    (select *
    from prd.D_CUSTOMER_ACCOUNT where SOURCE_SYS In ('ARBOR','PPB')) T1515
    where ( T1416.DW_CLIENT_ID = T1515.DW_CLIENT_ID and T1515.DW_CUST_ACCT_ID = T1836.DW_CUST_ACCT_ID and T1836.MSISDN = '917330340' )
    ) D1
    order by c1
    The error that I receive is:
    "Query Status: Query Failed: [nQSError: 16001] ODBC error state: S1000 code: -1005018 message: [Sybase][ODBC Driver][Adaptive Server Anywhere]Illegal ORDER BY item Order Item: 'N0',
    -- (opt_OrderBy.cxx 429) .
    [nQSError: 16011] ODBC error occurred while executing SQLExtendedFetch to retrieve the results of a SQL statement."
    If I substitute ORDER BY with GROUP BY and test it in Sybase, Ithe query runs without any problem.
    select 'N0' as c1,
    count(*) as c2
    from
    (select distinct T1416.CLIENT_INTER_KEY as c1
    from
    (select *
    from prd.D_SERVICE where SOURCE_SYS in ('ARBOR','PPB') and DW_SERV_ST_ID in (100000003,100000009)) T1836,
    (select *
    from prd.D_CLIENT) T1416,
    (select *
    from prd.D_CUSTOMER_ACCOUNT where SOURCE_SYS In ('ARBOR','PPB')) T1515
    where ( T1416.DW_CLIENT_ID = T1515.DW_CLIENT_ID and T1515.DW_CUST_ACCT_ID = T1836.DW_CUST_ACCT_ID and T1836.MSISDN = '917330340' )
    ) D1
    group by c1
    Do you know why OBIEE generates this SQL??? Why uses, with a aggregation function, a ORDER BY and not a GROUP BY? How can I resolve this problem???
    Regards,
    Susana Figueiredo

    Verify your repository design and make sure that you have defined count aggregate on fact column. You would also need to define the content level of each dimension in fact table.

  • Sql count function in order by clause

    Post Author: krypton
    CA Forum: Data Connectivity and SQL
    Hi Guys
    Can i ask a quick question. I am trying to retrieve data remotely from a SQL Server via crystal reports.
    Within the Database Expert I have entered a SQL query to retrive the number of (call center) support calls raised by our customers:-
    Select `Primary_Company`, COUNT(`Calls`)From  `SPRT_Issue` GROUP BY  `Primary_Company`ORDER BY  COUNT(`Calls`) desc
    The customer's column is called 'Primary Company' and the calls they raise are in the 'Calls' column. the above is a normal sql query.
    However Crystal fails to run the query and generates an error message :-
    Failed to open a rowset. Details: 420: Driver&#93; Expected lexical element not found: <identifier>
    I dont understand why it wont run. In the ORDER BY clause if i replace field 'Calls' by the field 'Primary Company' then it works.
    I think the problem is that it wont accept the count function in the order by clause. which is what i want it to do i.e display the calls in descending order by each customer.
    Could someone tell me if there is a way around it.
    Thanks
    Krypton

    Post Author: krypton
    CA Forum: Data Connectivity and SQL
    Thanks Lynn
    I tried your suggestion. But there is one probelm.
    When i sort the data in descending order using the count(calls) field, the data is returned but the customer's name appears multiple times along with their calls raised.
    E.g, if customer Mark raised multiple calls i.e. 2, 5, and 10 calls, then the report will show
    Mark   2
    Mark  5
    Mark 10
    But is there a way to aggregate all the calls for mark and show them only once:
    such as Mark   17
    Thanks

Maybe you are looking for

  • Problem with the Motion Sensor

    I just bought my 15" MBP, and was just messing around with it. I downloaded LiquidMac(a program that simulates liquid on your screen and when you tilt your laptop the water flows to that corner of the screen). And i don't know if my motion sensors ar

  • Database seletion

    HI all,            I had written a select querry in which i had mentioned package size and i kept that query in while loop,my question is i want to select a new record other than the internal table has for every time the select query runs,can that po

  • How to create new country and cities under country?

    hello, i am using 11.5.5 apps version, want to create new country and cities under that country, please tell me what is the procedure for that. i am using demo vis: operations as user. Thanks yash

  • Different titles for different copies while printing an invoice

    hi guys !! I want to print different titles on copies as follows... 1st copy - "Original" 2nd copy - "Duplicate" 3nd copy - "Triplicate"... i have used system vairable SFSY-COPYCOUNT.... in my 'Copies Window'..i have the following program lines.. CAS

  • Universal power pack for Mac air, Mac pro and ipad

    Have an 10 hour flight comming up    Would like to purchase universal power pack for Mac air Mac pro and ipad