Skip to Content

There are times when it’s not possible to get a new message on PI and the easiest way would be to restart the same message which was already processed. On ABAP stack messages it was possible to achive this with the use of the functionality presented in one of my articles: Michal’s PI tips: Restarting successfully processed messages.

How to do it on PI’s Java stack messages (single stack PI’s – AEX for example)?

Assumptions:

a) we should only try to restart successfully processed messages on development environments (never on TEST nor PRD)

b) you need to know that this approach is not supported by SAP and can cause serious issues in case you do it incorrectly

c) this approach is valid for >= PI 7.11 (where messages are stored in BC_MSG table) 

It seems it’s possible to build a simple application which will do a few changes in SAP PI DB tables and this will allow restarting successfully processed messages. I will not show the application as it’s not necessary at this point, only the idea on how to achive the reqirement.

Our potencial message can look as shown in Figure below.

/wp-content/uploads/2012/07/delivered_111_122264.jpg

In order to change be able to restart it, first thing we need to do is to change it’s status from “DLVD” to “NDLV” (from delivered to not delivered) in BC_MSG table.

update BC_MSG set status = ‘NDLV’ where MSG_ID = ‘MESSAGE_ID_WHICH_WE_RE_REPROCESSING’

This statement will change the status of the message to Not Delivered (second message).

/wp-content/uploads/2012/07/not_delivered1111_122265.jpg

In case our adapter is using a duplicate check we won’t be able to reprocess it yet – we’d need to make sure it’s not visible in another table as well – XI_AF_SVC_ID_MAP. That’s why we need to remove records from this table too and there can be more then one – not only message ID but also message ID and direction – (INBOUND).

/wp-content/uploads/2012/07/removing1111_122266.jpg

You can use one statement (in this case two to highlight that there can be more then one rows for one message).

delete from XI_AF_SVC_ID_MAP where MSG_ID1 = ‘MESSAGE_ID_WHICH_WE_RE_REPROCESSING’  

delete from XI_AF_SVC_ID_MAP where MSG_ID1 = ‘MESSAGE_ID_WHICH_WE_RE_REPROCESSING(INBOUND)’  

This should allow you to reprocess the message from PI tools – RWB, MDT.

Note:

Please remember that this approach is not supported by SAP and should never be used on TEST, PRD systems.

To report this post you need to login first.

15 Comments

You must be Logged on to comment or reply to a post.

  1. Sunil Chandra

    Michal.. Your blog is always such a pleasure to visit.. where do your out of box ideas come from.. do you have some secret idea generating machine 😉  

    Keep those ideas flowing..keep blogging.

    Cheers,

    Sunil Chandra

    (0) 
    1. Michal Krawczyk Post author

      Hi,

      >>>do you have some secret idea generating machine

      indeed – working on many things and experiencing many issues which need to be solved 🙂

      Regards,

      Michal Krawczyk

      (0) 
  2. Trevor Naidoo

    Trickster Michal at it again 🙂

    I like the disclaimer too and the fact that it was mentioned a couple of times 😈 .

    One always needs these workarounds though…:-)

    (0) 
  3. Nageshwar Reddy

    With increased security consciousness in the organizations and considering SAP recommendation to leave alone the database, the usability of this approach is very limited. Often, other alternatives of recreating the message might be easier to deal with.

    Thanks for sharing.

    (0) 
  4. Abhijit Maiti

    Hi Michal,

    Could you let me know why it should not be use in TEST system but can be use in DEV system?

    Generally we use test system for testing purpose.

    Regards,

    Abhijit

    (0) 
  5. Dingjun Jia

    Hi Michael,

    Thanks for your tip. Can you please share which role is required to view the table XI_AF_SVC_ID_MAP in open SQL Data Browser in NWA?

    Thanks

    Dingjun

    (0) 
  6. Avinash Ayanala

    Hi Michael,

    Wow it was very informative i never thought that it is possible to process again the successfully processed message thanks for the info.

    Regards,

    Avinash

    (0) 
  7. Vicky G

    I tried running the same statement in SQL Command Editor in DBACOCKPIT. But I get the following error:

    update BC_MSG set status = ‘NDLV’ where MSG_ID = ’53bb3f5b-4f28-1760-e100-8000a1f1ff54′

    ORA-00903: invalid table name.

    But when I run a select statement ( select status from bc_msg ) on bc_msg table it works fine.

    Please advice.

    (0) 
  8. Mayur Patel

    Michael,

    Thanks for the blog… it is very similar to what we are trying to achieve. We are trying to achieve message reprocessing but, on a mass scale and in an automatic fashion on time based trigger. Is it possible to kick of reprocessing without going to RWB and manually? We would like to reprocess all messages between two timeframes.

    Thanks.

    (0) 

Leave a Reply