Skip to Content
avatar image
Former Member

Spilting a Message Sending in Exact Order

Hello All,

I am Working in a Scenario Interface where Data is being Sent to PI from EWM and the Data Send contains Multiple Line Items which is then individually sent to SQL Database.

Now For example if PI Receives an XML for example with 3 Line Items. Suppose the First two Line Items has Quantity as 0 and the Last Line Item has a Quantity of 160. Now Ideally SQL should Receive the Data as 0,0,160 in the same order. ( Sometimes it Works Fine as SQL receives the Data in the exact Correct Order) But in Most Cases SQL receives the Data in different Order Say Example first the Line Item with Quantity as 0 Then The Line item with Quantity as 160 and Again lastly the Line Item with Quantity as 0.

Whereas it Should be in Order of 0,0,160.

If i Monitor the Communication Channel i find that the Message with Quantity 160 gets processed successfully and Send and Received before the Other Line item with Quantity as 0.

Can Anyone please help me as how can I solve this Glitch so that the split messages go in exactly the Same order as its present in the Receiving Payload.

I Tried checking the Option of Maintain Order at Runtime but then all the Messages goes into Holding state so i again have to unchecked the Option

Any Kind of Help is Greatly Appreciated.

Thank you and Merry Christmas.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Dec 17, 2013 at 12:06 PM

    Hello,

    Why don't u use SP and send all the data to DB and then let SP update table sequentially?

    Thanks

    Amit Srivastava

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 17, 2013 at 12:10 PM

    To guarantee the same order in target syste, you must activate the option of Maintain Order at Runtime.

    However, holding state means that there is some error in a previous message which cause other messages stuck in runtime. You have to solve the original error in order to avoid Holding messages.

    Cancel the first System Error and next messages will be processed.

    Regards,

    Carme.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 17, 2013 at 01:23 PM

    Hi Promit

    You need to sort the messages based on the quantity in the mapping itself. Once you have the sorted output , you need to use maintain order at run-time option.

    The only drawback will be if any message fails , the other have to wait. But that's the property of EOIO.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 06, 2014 at 09:29 PM

    Hi Promit,

    From what I understand, you get an XML which can contain n number of records... lets say record 1, record 2 and record 3. You want the messages to be passed on the the database table in the same format as in 1,2 and 3. Now to do that I would suggest the easiest solution is to use the XML Document Format for the Message Protocol XML SQL Format in an effective way. Look into the XML structure:

    <root> <-------------- You are probably multiplying the record at this level, so you get different SQL Call.

    <StatementName>

    <dbTableName “INSERT”>

    <table>realDbTableName</table>

    <access>

    <col1>val1</col1>

    <col2>val2new</col2>

    </access>

    </dbTableName>

    </StatementName>

    <root>

    However, if you use the XML in the below format:

    <root>

    <StatementName>

    <dbTableName “INSERT”>

    <table>realDbTableName</table>

    <access> <-------------- Multiplying the record at this level, so you get one SQL Call.

    <col1>val11</col1>

    <col2>val12</col2>

    </access>

    <access> <-------------- Multiplying the record at this level, so you get one SQL Call.

    <col1>val21</col1>

    <col2>val22</col2>

    </access>

    </dbTableName>

    </StatementName>

    <root>

    Your SQL would be something like:

    insert into readDbTableNave values(val11, val12),(val21,val22)....

    Try and play around with the XML structure and you would see its working

    Look into this: Document Formats for the Receiver JDBC Adapter (SAP Library - Partner Connectivity Kit)

    This way you can get rid of Exactly Once In Order as well.

    Add comment
    10|10000 characters needed characters exceeded