Skip to Content

It turnes out that sometimes we need to be able to not only use User Defined Message Search in PI to find related messages on the basis of their content but also to be able to use this functionality outside of our PI system. How can we achive that? We have a standard web service which allows to get the message data on the basis of the message ID as per my article:  PI/XI: how to get a PI message from java stack (AAE) in PI 7.11 from ABAP? but how to get the message ID on the basis of the User Defined Message Search ? We can also do this by creating a simple “select” web service on our PI system. The flow can look like this:

Sync WS (with SOAP adapter) <- ->  PI  <- -> JDBC  (to call PI’s DB)

Step 1

Create a User Defined Message Search configuration as per my article:

PI/XI: Selecting messages using the content of the message in SAP PI 7.3 – teaser

Step 2

I named the search criteria – KRAW – as shown in Figure below.

/wp-content/uploads/2012/07/cofig_condition_119537.png

You can easily check that the extractor for search criteria – KRAW exists in table – XI_AF_LMS_EXTRACTOR as shown in the figure below.

/wp-content/uploads/2012/07/xpath_table_119536.png

Step 3

Now the fun part – on the basis of the extractor’s name (KRAW) and the User Defined Message Search’s value (in our case – “Michal Krawczyk”) we can get the message ID from table XI_AF_LMS_DATA and we can use the message ID to get the content of the message as per my article metioned at the beginning of this blog.

/wp-content/uploads/2012/07/result_table_119535.png

Further notes:

If we need we may also use another table: XI_AF_LMS_FILTER to check that the filter was created from our configuration:

filter_Table.png

Hopefully soon we will get a web service from SAP which will have the same functionality but in the meantime we can create our own on the basis of the tables metioned here.

To report this post you need to login first.

9 Comments

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

    1. Michal Krawczyk Post author

      Hi,

      no, mate – I only remember requirements like that on SDN forum and me saying – “no it’s not possible” hence the blog – to show that it is possible 🙂

      Regards,

      Michal Krawczyk

      (0) 
  1. R-jay Galbizo

    Hi Michal,

    Assuming you’re using the SFTP adapter to get all xml files setting it as * to. How can you define a filter on it’s filename? Other filters I have are working except for filename (which i want to include as well).

    I have defined it as:

    Nothing was populated. Not sure if this approach is feasible.

    Cheers,

    R-jay

    (0) 
  2. Shreyashri Kar

    Hi all,

    Could anyone please elaborate where in PI server can we find the above mentioned tables XI_AF_LMS_EXTRACTOR, XI_AF_LMS_DATA & XI_AF_LMS_FILTER.

    I am new to PI single stack & hence having trouble in getting accustomed.

    Appreciate your kind response.

    Regards,

    Shreya

    (0) 

Leave a Reply