Monday 8 July 2019

Step-by-Step Archiving of Material Documents

1. Step by Step Archiving Procedure for Material Documents Archiving:


Archiving Object MM_MATBEL is used for the archiving of Material Documents.To perform data archiving in the SAP system, SARA transaction code is used. This is the standard method for executing the Archival.

1.1 Write Job:


1. Go to transaction SARA and enter the Archiving Object MM_MATBEL and hit Enter.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Click on the write button and choose Maintain button to maintain a Variant for the Archival. Enter the Variant name and hit Create button.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Used variants in detail:

MM_MATBEL – Material documents

Archiving should be executed on the following criteria:

– Plant

– Posting Date (from, up to)

– Detail Log “Complete”

– Log Output “Application Log”

Detail log and Log output will be same for all Archiving Objects.

Short texts have to get maintained with the following criteria:

– Object Name

– Company Code

– Fiscal year

– Period

Enter the Posting Date / Plant for which the Archival should happen and click on Variant Attributes button.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Enter the description for the Variant and click on save button.

Click on Back button and the Variant name will appear for Archival as shown below. Click on Start date button, choose immediate button in the screen that follows and click on check and save button

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Click on Spool Params. Button, enter LOCL_ZH as Output device and click on Continue button.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Now click on tick button. Archiving Object is ready for Archival, with the Variant being saved.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Click on Execute button as indicated above, for the Archival to happen. Once the Execute button is clicked, the following screen appears.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Click on the Job Overview or check logs in SM37 button, for viewing the Archiving session created.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Choose the corresponding Spool no. in the screen that appears, and click on Display Contents button.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Here in above screen shot you can see ” Material Document archived and deleted”. In AOBJ we have done the customization that once the write job is finished it will automatically triggered deletion job. If, AOBJ was not configured for automatic triggering of deletion job then we need to follow the deletion step separately. I am describing the deletion step below.

1.2 Deletion Job:


1.2. Go back to the initial screen of SARA transaction and click on the Delete button, for the deletion of the Archived records.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Click on Archive selection button, choose the Archiving session number in the screen that appears, by checking the checkbox against it and click on Continue button.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Click on Start date button, choose immediate button from the screen that appears and click on check and save button (as done in Write Step).

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Click on Spool params button, enter LOCL as Output device and click on Continue button.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Now the Archiving Object is ready for Deletion.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Click on Execute button as indicated above, for the Deletion to happen. Once the Execute button is clicked, the following screen appears.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Click on the Job Overview button or check logs in SM37.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Deletion Job finished successfully.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

1.3 Storage Job


1.3. Go back to the initial screen of SARA transaction and click on the Storage system button, to store the files on storage.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

Click on store files button.

Click on Archive Selection, choose the Archiving session number in the screen that appears, by checking the checkbox against it and click on Continue button.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP Guides

From SM37 or Job overview we can check the job logs for store job.

No comments:

Post a Comment