cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve PI Messages from Archive

Former Member
0 Kudos

Good day everyone,

After days of research, I still haven't found if there is a way to retrieve a message that is already archived. I am looking for a Class or a program that would retrieve a message from the Archive so I can resend the message in background. Does anybody know any program, class or function module that does this? Or is this just NOT possible? Right now, all I have created is a program that resend messages that are currently in the persistence layer (table SXMSPMAST). My goal this time is to get the message from Archive and not persistence layer. Hope someone can help me. Thanks so much.

Chris C.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi guys and gals,

I have managed to solve this problem. So far, I haven't found a Program/Class that could help me resend an archived message so what I did is get the necessary details of a message (including payload if necessary) using function module SXMB_SELECT_MESSAGES_ARCH. Then, I created a new integration message instance and recreate the archived message to a new message ID. If anyone of you need more details about the solution, don't hesitate to ask or send me a message so I can reply with the detailed procedure on how to solve this problem. Thanks.

Chris C.

Edited by: Capt_Chris on Mar 17, 2010 8:04 AM

Edited by: Capt_Chris on Mar 17, 2010 8:04 AM

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Chris,

Could you please share approch how did you achieved it.its looks really interesting for.

I am unable to find email id of yours in Bussines card.

many thanks,

Raj

Former Member
0 Kudos

Good day Raj,

I'm sorry for this late reply. It's been a while since I got to log-in in SDN since I have been very busy with work. Here is the detailed solution that I was able to devised.

There are two types of archived messages, those that are still in the persistence layer and those that are already deleted in the persistence layer. This solution is based on "resending" messages that are already COMPLETELY archived messages. When I said completely I meant those message that are already deleted in the persistency layer.

I'll be explaining the processing that my customized program undergoes about resending Archived messages.

1. First step is to get the list of COMPLETELY archived messages. To do this, all you need to do is retrieve the message ids (MSGGUID) together with the Pipeline id (PID) from table standard table SXMSPHIST for all records with REORG value of 'ARC'.

*remember: We're getting the archived messages that were already deleted in the persistency layer. These messages do NOT exist in table SXMSPMAST anymore.

2. Next will be retrieving the payload and some important message details for all the messages you got in step 1. To do this use Function module SXMB_SELECT_MESSAGES_ARCH. You need to export the message ids and the pids of the messages you retrieved in step 1.

3. Since we got the important data for the messages, what we need to do next is to create the same exact message in the integration engine. Remember, this should be done for each message that you want to resend. Here are the steps:

3.1 Create an integration message instance using cl_xms_message_xmb=>createxmbmessage( ).

3.2 Add the following details in the message instance:

3.2.1 Set Quality of Service using method set_quality_of_service

3.2.2 Set processing mode using method set_processing_mode

3.2.3 Set Queue ID using method set_queue_id (if necessary)

3.2.4 Set time sent using method set_time_sent

3.2.5 Set sender details using method set_sender

3.2.6 Set receiver details using method set_receiver

3.2.7 Set interface using method set_interface

3.2.7 Set message class using method set_message_class

3.2.8 Add the payload in the message instance using method add_payload_with_bin_content.

  • make sure to catch the exception cx_xms_exception when adding the payload data (xstring format).

... to be continued in the next message...

Former Member
0 Kudos

4. Since we have completed the message instance, now we need to create an integration engine instance using cl_xms_main=>create_engine( ) exporting 'X' in the execute flag and passing the message instance in the CHANGING field.

5. Don't forget to use "commit work" after processing.

I hope I made it as clear as possible. If you have further questions and/or classifications, please don't hesitate to ask.

Kind Regards,

Chris