Sie sind auf Seite 1von 31

Archiving and Deletion in PI

Summary: This document provides both an introduction to the key concepts of SAP NetWeaver
Process Integration XM message archive and de!ete and overvie" of the tasks# reports that
comes into p!ay in concept of Archiving and $e!eting of XM messages%
Archiving & Deleting PI XML messages Process
&y and !arge Archiving app!ies to asynchronous '() and ()I)* messages on!y on the A&AP and
+A,A side% SXMSPMAST is the master tab!e that ho!ds the key information about each of the
messages going through the Integration engine% The data is persisted in this tab!e based on the
retention period defined for asynchronous and synchronous messages%
If a message enters the Integration Server the fie!d IT-A.TI)N of SXMSPMAST tab!e is set to
INIT% Then the interface is checked for the action to take# if it is !isted as an interface for archiving#
the fie!d IT-A.TI)N is changed to ARCH% )ther"ise it changes to DL
/Note: IT-A.TI)N fi!ed va!ue in SXM&PMAST tab!e that describes "hat action app!ies to the
messages but does not mean that that the action is a!ready took p!ace% So it0s on!y action status
info not that action a!ready done%
Deleting: A!! messages "ith IT-A.TI)N1$( "i!! be de!eted by report
2SXM&3$((T(3M(SSA4(S as soon as message processing is comp!ete 'message status is
fina!* and adapter status a!!o"s de!etion% The $e!ete 5ob de!etes on!y Pay!oad%
Message are de!eted from PI persistency !ayer if they
I% are no !onger in retention period
II% are f!agged for de!etion
III% have appropriate messages state
I,% have appropriate adapter state
Archiving: A!! messages "ith IT-A.TI)N1A2.6 have to be archived by report
2SXM&3A2.6I,(3M(SSA4(S first and "i!! then be de!eted by report
2SXM&3$((T(3A2.6I,($3M(SSA4(S 'simi!ar name as 2SXM&3$((T(3M(SSA4(S#
but tota!!y different messages are hand!ed7*
Message are Archived from PI persistency !ayer if they
I% are no !onger in retention period
II% are f!agged for Archiving
III% have appropriate messages state
I,% have appropriate adapter state
Archiving XM messages process invo!ves t"o steps before XM messages are de!eted# during
first step messages are read from PI persistence !ayer and stored to archive fi!es and in the
second step reads the previous!y "ritten message from archiving fi!es in order to verify the data
integrity% -ina!!y messages are de!eted from PI persistence !ayer%
ooking at archiving and de!etion in PI the fo!!o"ing XI specific runtime items have to be
XM messages and history entries in the A&AP Integration (ngine
XM messages in the +ava Adapter -rame"ork
Workitems in the &usiness Process (ngine '&P(*
Performance data co!!ected in the Integration (ngine
&e!o" are fe" points to be noted "ith respect to Archiving 8 $e!etion in PI:
9% &y defau!t on!y asynchronous messages '() and ()I)* "i!! be persisted on the A&AP and
+ava side%
:% Synchronous messages '&est (ffort* "i!! on!y be persisted if an error occurs during processing
or if the parameter L!""IN"#S$NC 'A&AP on!y* is set% Setting )44IN43S;N. is not
recommended to reduce processing overhead%
<% A!so on app!ications systems connected to XI via A&AP pro=ies the messages "i!! get
persisted and archiving>de!etion has to be configured%
?% Performance data on the other hand are persisted for both# synchronous and asynchronous#
messages 'tab!e SXMSP-2AW6*%
@% Per defau!t no de!etion 8 archiving is carried out in the Integration (ngine and &P(% Therefore
manua! interaction is necessary by the administrator of the XI system to setup a suitab!e de!etion
or archiving strategy%
A% In genera! on!y messages "ith a fina! status can be de!eted% Messages in error can not be
de!eted and have to be cance!!ed first% Whi!e in the Integration (ngine 'A&AP* cance!!ed
messages have to be archived they "i!! be per defau!t be de!eted direct!y in the Adapter
B% -or the archiving# different actions need to be taken# depending on the type of ob5ect you "ou!d
!ike to archive% Messages that have been processed correct!y are de!eted by defau!t% ;ou must
archive a!! messages that are not to be de!eted% To archive messages# you must first define their
corresponding interfaces and then schedu!e the archiving%
8. You require two archiving jobs to archive messages:
A 5ob to "rite the messages to the archive
A 5ob to de!ete the archived message
C% )n!y one 5ob is reDuired to de!ete messages%
Archiving of Messages:
a* To archive interfaces in the Integration Server# the interfaces have to be defined for archiving
via transaction SXM%#ADM &'
(De)ine Inter)aces )or Archiving an* Retention Perio*s(+
As and "hen any ne" interfaces are deve!oped# they "i!! have to be added to Archiving !ist%
Se!ect EMu!tip!e Se!ectionF buttons to add interface for archiving as sho"n be!o"%
)nce you se!ect a!! the interfaces and c!ick -G# a!! the interfaces "i!! be added to archiving !ist as
sho"n be!o"%
No" "e $efine 2etention Period for these Interfaces as sho"n
;ou can define a specific va!ue for retention as per your reDuirements%

)nce the retention period is defined# Schedu!e Archive and de!ete 5obs as sho"n be!o"%
"o to transaction SXM%#ADM & Sche*ule Archive ,o-s

Maintain EStart $ateF 8 ESpoo! ParameterF in order to schedu!e an archive 5ob as sho"n%
)nce a!! the parameters have been maintained# c!ick on ESchedu!e ArchivingF to schedu!e 5obs%
.heck if the archiving 5obs have been carried out%
(nter transaction SM<B and search for
H A2,3&.3XM&3W2PIdateJ 'archiving# step 9*
H A2,3&.3XM&3$(IdateJ 'archiving# step :*

Deletion of XML messages:
XM messages processed by the Integration (ngine are saved in the mu!tip!e database tab!es
"hen persisted% XM messages are saved in a hierarchy% (ach XM message has a master
entry that contains the most important data# such as the message I$# Kua!ity)fService or date of
e=ecution% This data is a!so used as search criteria in dynamic searches for XM messages% A!!
additiona! tab!e entries are attached to this master entry% -or each message version# the header
and body of the XM message and the message pay!oad are saved in a separate tab!e for each
version# a!ong "ith a version record%
The XM messages are not automatica!!y de!eted from the database tab!es% ;ou can determine
"hether an XM message is to be archived or de!eted# according to the interface% The de!etion
and archiving 5obs are schedu!ed in cyc!es using the administration interface%
If a message is to be de!eted# the first step is to set the f!ag Flagged for Deletion in the master
entry% The second step is then to de!ete a!! dependent tab!e entries%
If a message is to be archived# the first step is to set the f!ag Flagged for Archiving% ;ou can then
archive a!! dependent tab!e entries% -ina!!y# you can de!ete a!! archived tab!e entries%
&e!o" are t"o different procedures for de!eting XM messages from the database tab!es:
Simple Deletion roce!"re:
The simp!e de!etion procedure de!etes a!! XM messages f!agged for de!etion or archiving from
the database tab!es in records%
This procedure is recommended "hen sma!! vo!umes of XM messages are to be processed by
the Integration (ngine% 6o"ever# !arge data vo!umes have an adverse effect on performance
during the de!etion process% -or this reason# the s"itch procedure is recommended "hen
processing !arge vo!umes of messages%
To schedu!e de!ete 5obs# proceed as fo!!o"s:
9% In the Integration Engine Administration menu# choose Schedule Delete Jobs.

:% Se!ect the 5ob's* to be schedu!ed%

<% Specify the start time and date and specify the period you "ant to use and choose
.heck if the de!etion and archiving 5obs have been carried out%
(nter transaction SM<B and search for
H SAP3&.3XM&3$((T(3Ic!ientJ '$e!etion 5ob for XM messages*
H SAP3&.3XM&36IST3$((T(3Ic!ientJ '$e!etion 5ob for history entries*
Ta#le S$itch roce!"re:
The s"itch procedure is based on the fact that an identica! tab!e copy e=ists for each persistence
!ayer tab!e% The copies are shipped by SAP% To begin "ith# the origina! tab!es are the active
tab!es% A!! XM messages are saved in these tab!es%
When the de!etion 5ob is started# the tab!e entries are not physica!!y de!eted from the database
tab!es as in the procedure above# instead the f!ag Deleted is set in the master entry% The monitors
then no !onger disp!ay this XM message%
When a certain fi!! !eve! is reached 'current!y CLM as sho"n in screen shot be!o"*# the de!etion
5ob recogniNes that a reorganiNation 'or s"itch* is reDuired% The tab!e copies that "ere inactive
before no" become active tab!es% A!! ne" XM messages are "ritten to the tab!e copies% -or a!!
e=isting XM messages# the system checks "hether the de!ete f!ag in the master entry is set or
not% If it is not set# a!! corresponding tab!e entries from the origina! tab!es are copied to the tab!e
copies% )nce the a!! the tab!e entries have been copied# the origina! tab!es in the database are
de!eted and then recreated again immediate!y%
Set parameter EDR!P#MAX#TA%L#L!ADF to determine !eve!s at "hich S"itch procedure is
reDuired as sho"n in screenshot be!o"%
To Activate Tab!e S"itch procedures go to transaction SXM%#ADM Con)igure Delete
Now schedule delete jobs as per steps defined above.
In above case s"itch procedure "as not reDuired as the tab!es "ere on!y 9M fi!!ed as against
CLM configured in SXM&3A$M% ;ou can reduce the tab!e fi!! !eve! as per your needs so that the
s"itch process is carried out as sho"n be!o"
Choosing a Deletion roce!"re
The simp!e de!etion procedure is set as the defau!t% No steps are reDuired to activate the de!etion
procedure% It is easy to activate the switch procedure%
To do so# se!ect the Switch Procedure Active checkbo=% ;ou can do this at any point% The de!etion
5obs react automatica!!y%
;ou can on!y deactivate the s"itch procedure "hen the origina! tab!es are active and the counter
for the number of de!eted records in the origina! tab!es is at Nero% If this is not the case at the time
of configuration# this is noted by the system and the s"itch procedure is deactivated the ne=t time
that tab!e entries are copied from the tab!e copies to the origina! tab!e%
Archiving / Deletion of messages in the Adapter Framework
9%* )n!y messages in a fina! status can be de!eted or archived%
:%* Messages "ith errors have to be cance!!ed first% Manua!!y cance!!ed messages do not have to
be archived but can a!so be direct!y de!eted in the A-W% .ance!ing messages in the A-W is done
in the 2W& via OMessage MonitoringO% To find the messages in error choose your adapter engine
and either se!ect the $atabase )vervie" or the $atabase page 'se!ect status OA!! .ontaining
errorsO*% If you have many messages in error you can use the OMu!tip!e Se!ectionO button to
cance! messages%
<%* Messages on the +ava side are persisted in tab!e XI#A.#MS" for PI B%L 8 tab!e %C#MS" for
PI B%9*% This tab!e can not be monitored via transaction S(9A% Therefore you have to use
database too!s% To ana!yNe the overa!! number of messages you cou!d use the fo!!o"ing SK
statement: S((.T .)PNT '/* -2)M XI3A-3MS4%
?%* As a ru!e on!y those messages get archived# for "hich persist unti! date is e=pired% Persist unti!
date gets ca!cu!ated by the current send>receive time of a message# p!us the configurab!e Opersist
durationO va!ue% -or the centra! and decentra! Adapter (ngine's* Opersist durationF va!ue can be
configured as t"o properties of the +:(( Service
9%OSAP XI Adapter: XIO 'va!ue is in mi!!iseconds*: O=iadapter%outbound%persist$uration%defau!tO
:% O=iadapter%inbound%persist$uration%defau!tO
@%* Qeep in mind that the defau!t persist time for messages in the Adapter -rame"ork is <L days%
This means that messages "i!! be kept in the database for <L days unti! the de!etion 5ob removes
them% .hanging the retention period in the A-W "i!! on!y affect ne" messages that get processed
by the adapter engine%
A%* As of XI <%L# SP99# a user interface is avai!ab!e that a!!o"s you to manua!!y set the retention
time for messages to e=pired so that you can remove these messages from the database
immediate!y or archive them before de!eting them%
-or this purpose# ca!! the fo!!o"ing P2 in a bro"ser
(nter a number of days% -or the messages that "ere sent or received ear!ier than the number of
days you have specified# the retention time is reset so that you can de!ete them immediate!y from
the database%
&ear in mind that you can on!y de!ete or archive messages "hose retention time has e=pired and
at the same time# that have# a fina! status 'successfu! or fai!ed*% In addition# on!y messages
"ithout any configured archiving ru!es can be removed manua!!y from the database% If an
archiving ru!e e=ists for a message to be de!eted# it is de!eted automatica!!y after the schedu!ed
'or manua!!y started* archiving 5ob "as comp!eted%
B%* ;ou can check the successfu! e=ecution of the de!etion and archiving 5obs via the background
processing monitor in the 2W&% (nter the 2W&# navigate to O.omponent MonitoringO and c!ick
O$isp!ayO% .hoose the Adapter (ngine of your Integration Server host and hit the button
(%ac4groun* Processing(

Note that you can e=p!icit!y maintain de!ete 5obs in the 2untime Workbench '<%9* and that the
Omessaging+/ersistMessageRemover+chec4IntervalO is not used any more 'on!y for initia!
ca!cu!ations after insta!!ation*%
Growing XI performance tables (SXMSF!A"#$
9% The performance headers for XI messages 'SXMSP-2AW6 tab!e entries* must be
reorganiNed% Perform the steps !isted be!o" in seDuence%
:% A!! steps must be carried out in the Integration Server c!ient# "hich can be found in S(9A by
!ooking at tab!e SXMSC!N.5L% In the fie!d 0,AP(0 enter 6H7%6 and press -G H the
corresponding tab!e entry !ists the IS c!ient beside parameter (N4IN(3T;P( as sho"n%
<% Set the fo!!o"ing XI parameters using transaction SXM%#ADM &' Integration ngine Con)iguration &'
Category PR.%
?% Schedu!e an initia! sing!e run of the reorganiNation 5ob at a time of !o" "ork!oad% This 5ob may
run for severa! hours as it removes a!! XI message performance headers up to the previous 9@
days% .reate the 5ob in SM<A using the name SAP3XM&3P(2-32()24 and inc!uding program
step SXMS3P-32()24%
@% When the initia! reorganiNation 5ob is finished schedu!e t"o periodic background 5obs to
aggregate and reorganiNe XI performance data% Pse the fo!!o"ing settings:
%o# SA&XM'&(R)&A**R(*AT(
This 5ob reads the persisted runtime data from the persistence !ayer and aggregates it on an
hour!y basis% ;ou must schedu!e this 5ob once for each system by ca!!ing transaction De)ine ,o-
8SM9:; and using the fo!!o"ing va!ues:
+ob name: SAP#XM%#PR.#A""R"AT
+ob c!ass: C
Pnder Start condition Date!ime# specify the fo!!o"ing period:
Period: < hour
.hoose Step A"AP Program and specify the fo!!o"ing step:
Step: SXMS#P.#A""R"AT
4o to transaction SM<B and check the status of +ob SAP#XM%#PR.#A""R"AT

+ob SAP3XM&3P(2-32()24
This 5ob de!etes the runtime data once the time interva! defined by the configuration parameter
$A;S3T)3Q((P3$ATA has been e=ceeded%
;ou must schedu!e this 5ob once for each system by ca!!ing transaction Define Job 'SM<A* and
using the fo!!o"ing va!ues:
+ob name: SAP#XM%#PR.#R!R"
+ob c!ass: C
.hoose Start condition Date!ime# and specify the fo!!o"ing period:
Period: < hour
In Step A"AP Program# specify the fo!!o"ing step:
Step: SXMS#P.#R!R"

4o to transaction SM<B and check the status of +ob SAP#XM%#PR.#R!R"

'( R"ntime + Deleting $or, items
9% When you e=ecute receive steps# send steps# transformation steps# receiver determinations
and b!ocks# "ork items are generated in integration processes in each case% The system may
contain a very !arge number of "ork items as a resu!t% The tab!e S===IHAD has a !arge
number of entries in your system%
:% Messages that are processed by integration processes in "ork items can have synchronous
and a!so asynchronous origins% Asynchronous messages are a!ready persisted in the integration
server and can a!so be archived from there% Synchronous messages are not persisted%
<% The Duestion therefore arises as to "hether you can de!ete the "ork items or "hether you
must a!so archive them% In most cases# it shou!d suffice to archive the incoming message and the
outgoing message for asynchronous messages# or to archive the outgoing message for
synchronous messages in the sending system% If this is insufficient due to !ega! regu!ations# the
generated "ork items can a!so be archived or de!eted during message processing%
?% ;ou can use the report RS===ID or Transaction S==L to de!ete a!! "ork items# inc!uding
a!! of the attachments and dependent "ork items% Since the report 2SWWWI$( can a!so de!ete
"ork items that are not in a fina! status# it is recommended to make the se!ection according to the
OC!MPLTDO "ork item status# the creation date and "ork item type O.O%
@% If a !arge number of "ork items must be de!eted# you may have to restrict the se!ection criteria
by specifying sma!!er date ranges% Note that if you use the report incorrect!y# at "orst# a!! of the
"ork items in the system are de!eted% A!"ays run the report in test mode first by not se!ecting the
(Delete imme*iately( checkbo=% )nce you press -G# a!! "ork items having status as
R.)MP(T($S "i!! be de!eted%
9% Tab!e SXMSMSTAT disp!ays different status of the messages as sho"n%

:% Pse report RS=.#XI#INSTANCS#DLT to de!ete data records '"hich are f!agged as
erasab!e* from the cc&PM message persistence% The report de!etes the data "ithout any further
confirmation or consu!tation if you e=ecute it from the se!ection screen% If you "ant to e=amine the
data before the report de!etes it# you can ca!! the report RS=.#XI#INSTANCS#SH!=# "hich
you can use to disp!ay and e=amine the erasab!e messages%
<% .heck if there are messages "ith a "hite f!ag in transaction SXM&3M)NI or "ith message
state: L9 T Schedu!ed%
If this is the case# p!ease use report RSXM%#CANCL#N!#C!MMIT#MS"
?% Pse report RSXM%#SH!=#STAT7S to disp!ay the status of different messages in system as
sho"n be!o"

@% &ased on the resu!ts of report RSXM%#SH!=#STAT7S check the number of messages "ith
adapter status LL9# LLB and LLG%
Shou!d you find status LL9 and LLG# schedu!e fo!!o"ing report to refresh status of messages

A% ;ou use report RSXM%#CANCL#MSSA"S to cance! messages "ith status L9? and L9B
from the system rather than manua!!y cance!!ing them%
B% Make sure that there are no entries in transaction SMK9 8 SMK:%
G% Pse message monitoring in 2untime Workbench to check for messages having statuses other
than successfu! 'i%e% 6)$IN4# WAITIN4# $(I,(2IN4# S;ST(M (22)2 etc%*
C% ;ou have e=ecuted the report RSXM%#SH!=#STAT7S and you find many entries "ith
status <>% In the XI monitor# you cannot find so many messages "ith errors% In the XI monitor
'transaction SXI3M)NIT)2* you can a!"ays disp!ay the ackno"!edgements if you set the
fo!!o"ing se!ection parameters on the OA*vance* Selection CriteriaO tab page:
Oogica! Pipe!ine I$O as ECNTRAL#%AC?( and se!ect the checkbo= (=ith Ac4no@le*gment
9L% If you use the !oca! A!ert -rame"ork to generate a!erts e%g% by using Message based a!erting
you a!so have to consider de!etion 'archiving* of a!erts in your XI system% &ased on the number of
a!erts generated tab!e SALRT can gro" significant!y other"ise% To de!ete a!erts the e=ecute
report RSALRTPR!C in S(<G%
99% The app!ication !og is a too! to co!!ect# save and disp!ay !ogs% Many different app!ications
co!!ect messages in the app!ication !og "hich contain information or messages for the end user%
The app!ication automatica!!y !og serves as a temporary storage for messages% The !ogs are
"ritten on the database but they are not automatica!!y de!eted% There is no genera! procedure for
s"itching the app!ication !og on or off%
A !og usua!!y has an e=piration date# "hich is set by the app!ication that ca!!s the 0App!ication !og0
too!% If the app!ication !og does not set an e=piration date# the 0App!ication !og0 too! sets the
e=piration date as 9:><9>:LCG or 9:><9>CCCC#depending on the re!ease# "hich a!!o"s the !ogs to
stay in the system for as !ong as possib!e% The end user cannot set the e=piration date% The
e=piration date does not mean that !ogs "hich have reached that date "i!! automatica!!y be
de!eted% It is used to contro! the de!etion of !ogs "hen you ca!! the $e!etion report%
The $(3&(-)2( f!ag in the &A6$2 tab!e determines "hether or not the !og can be de!eted
even before the e=piration date is reached%
$(3&(-)2(1 SPA.( means that the !og can be de!eted before the e=piration date is reached%
$(3&(-)2(1RXS means that the !og can on!y be de!eted after the e=piration date%
-or SAP 2e!eases greater than ?%AA use Transaction SL"A to de!ete these !ogs from system%
If you a!so "ant to de!ete !ogs "hich have not reached the e=piration date you must set the
option OA!so !ogs "hich can be de!eted before the e=piration dateO%