locked
Problem converting EDI to XML due to segment level error (PCD) RRS feed

  • Question

  • Hello, this is my first post here.

    I have an EDI document that I need to convert to an XML document. I've done this for other customers previously with success.

    I've set up 2 parties, receive port, receive location and a send port. The document is a INVOIC D96A EAN008.



    The Invoice (ÌNVOIC D96A EAN008)

    UNA:+.? '
    UNB+UNOC:3+102981890627:82+7393528000000:14+080501:0603+506++++1++1'
    UNH+1+INVOIC:D:96A:UN:EAN008'
    BGM+380+168100008221'
    DTM+137:20080430:102'
    DTM+167:20080401:102'
    DTM+168:20080430:102'
    RFF+AP:168100008221'
    NAD+SU+NO981890620MVA::91++Secret Solutions AS+Postbox 358 Bergen+Oslo++0176+NO'
    FII+RB+55378772+BK'
    RFF+VA:NO981890620MVA'
    CTA+AD+:Kjetil Knudsen'
    COM+0047-22036300:TE'
    COM+0047-22036301:FX'
    NAD+BY+PBSE::91++Secret Servicehandel SE AB (GFSE)+Box 52345+Stockholm++63645+SE'
    NAD+CN+30100::92++SSH Sentralt'
    CUX+2:SEK:4'
    PAT+3++66:1'
    DTM+13:20080505:102'
    PCD+16:17.00:13'
    LIN+1'
    PIA+5+Pay Toll Gate:SA'
    IMD+F++:::Pay Toll Gate'
    QTY+59:1'
    QTY+47:294595'
    MOA+203:141405.60'
    PRI+AAA:141405.60'
    PCD+3:0'
    LIN+2'
    PIA+5+Pay Toll Gate Dunni:SA'
    IMD+F++:::Pay Toll Gate Dunning FEE'
    QTY+59:1'
    QTY+47:1752'
    MOA+203:840.96'
    PRI+AAA:840.96'
    PCD+3:0'
    LIN+3'
    PIA+5+Pay Toll Gate Remin:SA'
    IMD+F++:::Pay Toll Gate Remind TAX'
    QTY+59:1'
    QTY+47:29104'
    MOA+203:13969.92'
    PRI+AAA:13969.92'
    PCD+3:0'
    UNS+S'
    CNT+1:325451'
    CNT+2:3'
    MOA+125:156216.48'
    MOA+176:0.00'
    MOA+9:156216.48'
    MOA+79:156216.48'
    TAX+7+VAT+++:::0+S'
    MOA+125:156216.48'
    MOA+124:0.00'
    UNT+53+1'
    UNZ+1+506'


    I am left with short XML output and an error message.

    XML output (missing data)

    <?xml version="1.0" encoding="utf-8"?>
    <ns0:Efact_Contrl_Root IsGeneratedAck="true" xmlns:ns0="http://schemas.microsoft.com/Edi/Edifact">
        <ns1:UNH xmlns:ns1="http://schemas.microsoft.com/Edi/EdifactServiceSchema">
            <UNH1>9</UNH1>
            <UNH2>
                <UNH2.1>CONTRL</UNH2.1>
                <UNH2.2>4</UNH2.2>
                <UNH2.3>1</UNH2.3>
                <UNH2.4>UN</UNH2.4>
            </UNH2>
        </ns1:UNH>
        <UCI>
            <UCI1>506</UCI1>
            <UCI2>
                <UCI2.1>7393528000000</UCI2.1>
                <UCI2.2>14</UCI2.2>
            </UCI2>
            <UCI3>
                <UCI3.1>102981890627</UCI3.1>
                <UCI3.2>82</UCI3.2>
            </UCI3>
            <UCI4>4</UCI4>
            <UCI5>4</UCI5>
        </UCI>
        <SG1Loop>
            <ns0:UCM>
                <UCM1>1</UCM1>
                <UCM2>
                    <UCM2.1>INVOIC</UCM2.1>
                    <UCM2.2>D</UCM2.2>
                    <UCM2.3>96A</UCM2.3>
                    <UCM2.4>UN</UCM2.4>
                    <UCM2.5>EAN008</UCM2.5>
                </UCM2>
                <UCM3>4</UCM3>
                <UCM4>15</UCM4>
                <UCM5>PCD</UCM5>
            </ns0:UCM>
            <SG2Loop>
                <ns0:UCS>
                    <UCS1>26</UCS1>
                    <UCS2>15</UCS2>
                </ns0:UCS>
            </SG2Loop>
        </SG1Loop>
        <ns2:UNT xmlns:ns2="http://schemas.microsoft.com/Edi/EdifactServiceSchema">
            <UNT1>5</UNT1>
            <UNT2>9</UNT2>
        </ns2:UNT>
    </ns0:Efact_Contrl_Root>



    and the error message is

    Error message

    Error encountered during parsing. The Edifact transaction set with id '1' contained in interchange (without group) with id '506', with sender id '102981890627', receiver id '7393528000000' is being suspended with following errors:

    Error: 1 (Segment level error)
        SegmentID: PCD
        Position in TS: 26
        15: Use of segment, data-type or segment not supported in this position



    I'm using EDIReceive on the Receive Location and XML Transmit on the Send Port.

    According to this document www.stylusstudio.com/EDIFACT/D96A/INVOIC.htm, PCD stands for Percentage Details. I've tried another inovice with the same problem, are they sending it wrong or is the EDI engine in BTS choosing the wrong schema or something?


    If anyone have a clue, please let me know. Thank you.
    Thursday, June 26, 2008 8:12 AM

Answers

  • According to the schema, it appears that the PCD segment should occur before the MOA/PRI segments.

     

    From your transaction:

    LIN+1'
    PIA+5+Pay Toll GateTongue TiedA'
    IMD+F++::Stick out tongueay Toll Gate'
    QTY+59:1'
    QTY+47:294595'
    MOA+203:141405.60'
    PRI+AAA:141405.60'
    PCD+3:0'

    Order from the schema:

    LIN

    PIA

    IMD

    MEA

    QTY

    PCD

    ALI

    DTM

    GIN

    GIR

    QVR

    EQD

    FTX

    MOA

    PRI

     

     

    Thursday, June 26, 2008 6:00 PM

All replies

  • According to the schema, it appears that the PCD segment should occur before the MOA/PRI segments.

     

    From your transaction:

    LIN+1'
    PIA+5+Pay Toll GateTongue TiedA'
    IMD+F++::Stick out tongueay Toll Gate'
    QTY+59:1'
    QTY+47:294595'
    MOA+203:141405.60'
    PRI+AAA:141405.60'
    PCD+3:0'

    Order from the schema:

    LIN

    PIA

    IMD

    MEA

    QTY

    PCD

    ALI

    DTM

    GIN

    GIR

    QVR

    EQD

    FTX

    MOA

    PRI

     

     

    Thursday, June 26, 2008 6:00 PM
  • Of course you are right, thank you.

    I've been struggeling with this 2 days ;/
    Friday, June 27, 2008 7:43 AM
  • Check the max. value for fields. you may find some usefull links at www.editoxml.com
    Friday, September 12, 2008 2:42 PM