Step By Step Guide To Archiving And Deleting Of XML .

Transcription

Step by Step Guide to Archivingand Deleting of XML Messages inSAP NetWeaver PIApplies to:SAP NetWeaver Process Integration 3.0 / 7.0 / 7.1.SummaryThis document explains the step by step procedure of archiving and deleting of XML messages in SAPNetWeaver Process Integration. The document covers the archiving and deleting procedure only atIntegration Engine level (ABAP Stack).Author:Netrey R. PowdwalCompany: Tata Consultancy ServicesCreated on: 27 August 2010Author BioNetrey is SAP NetWeaver PI Consultant from Tata Consultancy Services. He has 4 years of experience inthe industry with SAP ABAP and Process Integration expertise.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com1

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PITable of ContentsIntroduction: . 3Configuration: . 4Global path for archiving files: . 5Assignment of physical path to logical path: . 5Logical file name definition: cross client . 6Archiving object-specific customizing: . 6Activation of archive infostructure: SAP BC XMB . 7Interfaces for archiving: . 7Rentention periods: . 8Asynchronous messages: . 8Synchronous messages: . 8History Entries:. 8Archive Job Scheduling:. 9Viewing archived messages:. 10Delete Job Scheduling: . 11Housekeeping Job ZBC XMB REFRESH ADAPTER STATUS: . 12Conclusion: . 13Related Content . 14Disclaimer and Liability Notice . 15SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com2

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIIntroduction:Problem statement: Tables that store the XML messages in PI are rapidly growing and you are running outof disk space. As a temporary measure, you increased the table space, but this is afterall a temporarysolution. The disk space is limited and if you go on increasing the disk space like this then you will run out ofthe entire disk space soon and it will affect the performance of the system badly. It might also bring the entirePI system down and all message transfers will come to halt. The growing table space is a serious threat tothe system and you need to quickly find a solution to clear the XML messages and reduce the disk spaceusage.Preparations: Before we start the configuration, it’s a good idea to note down the current status of thesystem. i.e. current table space comsumption so that we can compare the results after archiving and deletingto see the reduction in table space. For this, go to transaction SARA, enter the archiving object BC XMB andclick on Database Tables button. Select All Tables radio button and click on Space Statistics button to seethe table space statistics.Note: As mentioed earlier, this document deals with messages at Integration Engine level only. It does notinvolve handling of messages at Java stack (Adapter Engine).The main tables that grow rapidly with growing traffic in PI are, SXMSPMAST: Integration Engine: Message Queue (Master) SXMSCLUR: XMB Resources Cluster SXMSCLUP: XMB Property ClusterGo to transaction SE11 and open these tables and check the Number of Entries in each of these.Program RSXMB DEL TO ARCH:This is a very useful program. There are mainly 2 types of messages in PI; messages that are marked forarchiving and those marked for deletion. By default, the message will be marked for deletion. We need toexplicitly confiture interfaces so that those messages will be marked for archiving. This configuration needsto be done even before sending the very first message in PI. If this configuration is not done already then allmessages in PI will be marked for deletion.We can use the program RSXMB DEL TO ARCH to change the deletion flag of these message to archivingflag. Note that this action is irreversible. Field ITFACTION of the table SXMSPMAST stores the flag. We cancheck this table after executing the program to see if the flag has been updated properly.This program takes a great amount of time to execute depending on the amount of messages that are readas per input criteria. It is recommended to run this program in background. Also, enter the maximum possiblevalue in Maximum Runtime (s) parameter (E.g. 86,400 seconds). Do not forget to remove the Test Modecheckbox before executing.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com3

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIConfiguration:Now we come to the actual configuration part. Follow the given path to reach the following screen.SPRO SAP Reference IMG Cross Applicaton Components General Application Functions Mass DataArchiving Cross-Archiving Object CustomizingCheck if all the settings are as per shown in the screen below.Cross-Object Customizing Data Archiving: DetailsSAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com4

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIGlobal path for archiving files:Now follow the below path to configure the archive file settings.SPRO SAP Reference IMG Cross Applicaton Components General Application Functions Mass DataArchiving Create Logical File PathHere I have created a logical file path ARCHIVE GLOBAL PATHAssignment of physical path to logical path:Once we create a logical path, it has to be assigned to the physical path on the disk. Click on ‘Assignment ofPhysical Paths to Logical Path’. Mention the physical path as shown below. FILENAME is a placeholderwhich will contain the actual file name at runtime.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com5

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PILogical file name definition: cross clientClick on ‘Logical File Name Definiton’ to specify the file name format for the archive file. I have created a filewith the format PARAM 1 PARAM 3 DATE TIME PARAM 2 .ARCHIVE. Here, PARAM 1,PARAM 2, PARAM 3, DATE and TIME are variables that will be populated at runtime. Including Date andTime in file name ensures the uniqueness of the file name.Archiving object-specific customizing:Follow the path SPRO SAP Reference IMG Cross Applicaton Components General ApplicationFunctions Mass Data Archiving Archiving Object-Specific Customizing. Select archiving object‘BC XMB’ and click on ‘Details’. Select the logical file name that we created in earlier step. Check all thesettings are as per the screenshot below. Select the radio button ‘Start Automatically’ under Delete Jobs.This will start the ‘archive-delete’ job once the archive job is complete. I am using the naming conventionarchive-delete job here to avoid confusion with the delete job. Delete job deletes all messages which aremarked for deletion whereas archive-delete job deletes messages which are marked for archive once theyare archived by the archive job.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com6

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIActivation of archive infostructure: SAP BC XMBOpen transaction SARJ (or follow the path SARA Information System Customizing). Press F4. SelectArchive Infostructure SAP BC XMB for archive object BC XMB and click on Activate.Interfaces for archiving:Follow the path SXMB ADM (t-code) Define Interfaces for Archiving and Retention Periods. Mention all theinterfaces for which you intend the archive the messages. Click on Multiple Selection Select all requiredinterfaces Press F8. All interfaces will apprear under ‘Interfaces to Be Archived’. Messages of all interfacesthat are excluded here will be marked for deletion.In future, if new interfaces are added to the system then entry has to be made here for archiving. Otherwise,those messages will also be marked for deletion by default.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com7

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIRentention periods:Once you are done adding all the interfaces to the list, click on Retention Periods button to jump to thefollowing screen. Here you can mention the period for which the messages should be retained in databasebefore they are archived or deleted. Below is the explanation of various parameters maintained in thescreenshot below.Asynchronous messages:XML Messages Without Errors Awaiting Deletion: (1 Day) Messages which are older than a day and aremarked for deletion will be deleted forever from the database tables. This will not affect the messages whichare marked for archive.XML Messages Without Errors Awaiting Archiving: (30 Days) Messages which are older than 30 days andare marked for archive will be archived to a file and deleted from the database tables.Synchronous messages:XML Messages Without Errors Awaiting Deletion: (1 Day) Messages which are older than a day and aremarked for deletion will be deleted forever from the database tables.XML Messages Without Errors Awaiting Archiving: (0 Days) Synchronous messages which are successfulwill be deleted immediately.History Entries:History Entries for Deleted XML Messages: (30 Days) History entries are required for QOS Exactly Once. Itis recommended to keep history entries at least for 7 days.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com8

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIArchive Job Scheduling:Now we are ready to schedule the jobs. Go to transaction SXMB ADM and select Schedule Archiving JobMaintain Start Date and Spool Parameter and click on Schedule Archiving. Once the job is scheduled, clickon Job Overview to see the job.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com9

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIViewing archived messages:Go to transaction SXMB MONI and select Archived XML Messages (Seach Using Archive)Select the archive file and press Enter. Note that if the File Status is shown as Delete Completed thenarchiving was done successfully.You will see the messages which were archived.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com10

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIDelete Job Scheduling:Go to transaction SXMB ADM and select Schedule Delete Jobs. Select both the checkboxes, enter the startdate, time and period (to schedule periodic job) and press F8. Click on Jobs button to see the scheduleddelete job. Once the delete job is complete, you will be able to see the total number of records affected in theJob Log.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com11

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIHousekeeping Job ZBC XMB REFRESH ADAPTER STATUS:Create a job with program SXMS REFRESH ADAPTER STATUS and schedule it periodically to updatestatus of successful messages. If you have receiver Idoc communication channels, sometimes the deliverystatus of the Idocs is not know to the PI system and the message status does not change to Final. Thesemessages are excluded when the delete job runs. To avoid this, schedule this job, say weekly, to update themessage status.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com12

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIConclusion:Congratulations! You have successfully configured PI system to archive and delete XML messages. Now thenext step is to verify the configuration. In the beginning we had noted down the system status beforearchiving. Now same steps need to be performed to check the system status after archiving i.e. we will checkthe number of table entries of all critical tables mentioned above. This will ensure that the messages wereactually archived and deleted and the setup was successful.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com13

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIRelated ContentPI Archiving Conceptual Overview Wiki on SCNArchiving and Deletion in PI on SAPTechnichalArchiving and Deleting on SAPHelpIntroduction to Data Archiving on SAPHelpSAP Notes:872388 – Section 5 – k – 2.872388 – Section 5 – k – 1.10423797893521239882842187862423SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com14

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PIDisclaimer and Liability NoticeThis document may discuss sample coding or other information that does not include SAP official interfaces and therefore is notsupported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,and anyone using these methods does so at his/her own risk.SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article orcode sample, including any liability resulting from incompatibility between the content within this document and the materials andservices offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of thisdocument.SAP COMMUNITY NETWORK 2010 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com UAC - uac.sap.com15

Integration Engine level (ABAP Stack). Author: Netrey R. Powdwal Company: Tata Consultancy Services Created on: 27 August 2010 Author Bio Netrey is SAP NetWeaver PI Consultant from Tata Consultancy Services. He has 4 years of experience in the industry with SAP