IDocs are archived in several tables and to reduce the load on Database without losing any IDocs, you can store them in archives at the operation level. Keep in mind that IDocs with error status can not be archieved. You can archive IDocs with status 3,18,19,21,31,33,38,40,41,53,57,68,70,73. If you are not able to archive IDocs with these status codes you can enable archiving option by using transaction code WE47. You are recommended to archive your IDocs if they are not older than 5 years, for those older than 5 years you may not need them anymore so you can delete them at your own risk.
RSEXARCA and RSEXARCB are archiving programs. RSEXARCB is similar to RSEXARCA except for the selection screen. The selection options for RSEXARCB are designed for periodic scheduling. RSEXARCD deletes archived IDocs from the database while RSEXARCR reads IDocs from an archive. And another program RSEXARCL Retrieves IDocs from the archive into the database
See below a step by step procedure for archiving IDocs.
https://i2.wp.com/www.sapdocs.info/wp-content/uploads//abap.png?fit=224%2C224224224yzmercanhttp://sapdocs.info/wp-content/uploads//sapdocs-logo-2.pngyzmercan2009-02-10 11:31:042009-02-10 11:40:31Step by Step Procedure for Archiving IDocs