Skip to Content

Applies to:

SAP ECC6 – Data Archive. For more information, visit the Data Management and Integration homepage

Summary

This document helps people to understand the usage of archiving. It consists of step-by-step process of

Archiving Special Stock Records such as records for Batches and consignment Materials

Author(s): Lakshman

Company:Wipro Technologies

Introduction

Usage of SAP for our Day to Day Business Activities Results in Huge Amount of Enterprise Data.

It consequences are Data Overflow, Transactions running for long time and Performance Degradation. By

using Data Archiving Methodology we can clean up the Out of date data or any unused data and store it

offline. This leads to Performance improvement, Maximized System availability, Reduction of costs.

SAP provides us a solution for this Data Archiving process using which we can archive the data in a secure

and consistent manner. Archiving program uses certain checks and follows certain rules which ensure

consistency of data. By using this method we can archive master data such as Material Master, Batch

Master Records, HR master data and transactional data such as Sales Documents, Financial Documents,

Purchase orders etc.

Archiving process comprises of two mandatory steps

· Archive File Creation

· Deletion of files from the Database

These steps are discussed in detail for Batch Records and Consignment Materials

Archiving Configuration Setup

The first step of Configuration of Archiving Object starts from transaction AOBJ. Batches and Consignment

materials are archived via the object MM_SPTOCK

You can also see the list of tables from which data is going to be archived. The Transaction DB15 can be

used for this purpose

The Write and Delete Programs which are involved in this Object

Note: For Performing theWrite Step You should have required authorizations for executing SARA Transaction

How to Choose Data which is Eligible for Archiving

Generally in any SAP System Transaction Data forms the major part and it occupies huge space. Master

Data is changed rarely and it occupies lesser space compared to transactional data.

Data Archiving is used for both transactional and master data

In this case the data is Batch Master Records. Whenever your customer no longer needs the data you can

archive and delete that. For this to happen you have to flag that particular batch master which customer no

longer needs so that the archiving and deletion program will delete it.

When a batch master record is created, the deletion flag is hidden if the material master record is not flagged

for deletion at plant level or storage location level. If the material master record is flagged for deletion, the

system issues a warning on the initial screen. The Deletion flag field is then displayed, but the deletion flag

cannot be set. You can set the deletion flag at plant level for a Batch master Record using Transaction

MSC2N.

Archiving File Creation- Write Step

Open the Transaction SARA and Specify MM_SPSTOCK as the Archiving Object

Click on the Write Button.

Give the Variant name and Select Maintain Button

We can Run the Write Program of Archiving Object in Either Test Mode or Production Mode.

1) Test Mode Mean’s that no archive files are created

2) In Production Mode the archive file is created depending on the selection criteria and rules

defined for that archiving object

Initial Selection Screen for Write Program of MM_SPSTOCK object. You can give the list of material

number’s, Plant Data and respective Batch No’s which are no longer needed.

Various Check Boxes provided on the selection screen serves a different purpose

1) Consider batch record without deletion flag – Mean’s the record’s which are not having the deletion

flag set are taken into consideration while archiving

2) Check expiration data of batch – If the batch is expired it will be considered for archiving

3) Only Consider Batch record’s without stock – Only select’s the record for which the stock is NULL

and the rest of all are ignored

Select Complete option listed in the drop down box which will give you the complete output log in the spool.

Save the Variant and come back to the initial screen. Maintain the Start Date and Spool Parameters .Once

you maintain them traffic light will turn onto green. Now Press the execute button and it displays a status

message at the bottom “New Archiving Job was Scheduled.

You can check the job log and spool using SM37 once the job is completed successfully

Spool

Click on the spool and you will get the complete processing log for the write step

The log consists of details like No. of Written Data Objects, Size of archive file , Database space occupied

in MegaBytes and list of Batch Master records that have been written to the archive file

Delete Step

After successful completion of the write step next comes the delete step where the data being written on the

file is deleted using the delete program

Now press the Delete button. Once you click on it you will be redirected to screen shown below

Press the archive selection button and you will get a Pop-up display which shows you the completed write

Session

Select the check boxes and click on OK button. Maintain start date and Spool parameters which is the same

as the one you maintained for the Write Step

You can see all the traffic lights converted to green once you’re done.Now click on the execute button.You

will get a status message “New Deletion jobs were scheduled”

You can check the job log in SM37.If you observe carefully ,can see two jobs completed successfully .one

job is the submit job which lasts for few seconds (ranging from 0 to 3 seconds) and the other one is the

actual job which does the deletion process.

Check the spool of the delete job. You will find some information related to the number of deleted data

objects and deleted database space in MB etc.

You can see the list of batch records in the spool which got archived successfully

Verify the results from the database tables MCHA whether the records are successfully deleted or not.

You can also check the same using MSC3N transaction.

Archive Administration –Management

Using the management option shown below in the initial screen we can view the technical settings and

Logical file path names

Click on the Technical settings .Observe the Logical file name maintained for this Archiving object

The logical file name details can be seen using the transaction code FILE. Open this transaction and you can

find the list of file names under Logical file name Definitions folder. Search your logical file and double

clicking on it will take you to the Details screen.

Problem Encounters

Quite often , We come across huge set of materials , say 100000 material master records which are requested for archiving by customer

Staright away , I advice not to run the archiving delete step by dumping all the 1L records at a time.

It would sometimes cause a ST22 dump as shown below

Capture.PNG

While the Dump clearly says that it’s because of duplicate records, it’s not so. It’s because of huge number of materials we dumped in.

It’s due to resource bottle neck. Remember the table fetches/clears the records not just only from MARA ,  but it accesses other tables which can be time consuming. You can check the list of database tables  used by the option “Database Tables” available on SARA transaction initial screen

It’s suggested that divide the set of materials into Sets say a 10 , each set consisting of 10000 , or  say 20 * 5000 and then execute the archiving steps

in sequence

Conclusion:

Batch Master Records are Archived and Deleted from the database successfully.

Related Content

Visit the following web pages

http://www.help.sap.com

http://www.sdn.sap.com/irj/sdn/nw-mdm?rid=/webcontent/uuid/f062dd92-302d-2a10-fe81-ca1be331303c

http://help.sap.com/saphelp_dimp50/helpdata/en/8d/3e59fd462a11d189000000e8323d3a/frameset.htm

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Jürgen L

    Please check your document, many pictures do not show up.

    The better place for this document is the ILM space which is the home space for data archiving.

    (0) 
    1. Lakshmana Srini Post author

      Thanks Jurgen,

      While posting the images , they are getting truncated on the extreme left side. I tried many times. Is there a better way for posting these images?

      (0) 
      1. Jürgen L

        I never had this issue of truncated pictures. You may need to post a discussion in the

        in SCN Bug Reporting if this problem is only after uploading of pictures and not with the original pictures. I hope you uploaded the pictures instead of copy paste them.

        Regarding the content. The document is pretty straight forward, like the examples in a training. But when you are back home and try it yourself you usually hit one problem after the other. Unfortunately you did not mention any of them.

        E.g. batches are a kind of master data, which means they can only be archived after you have archived all transaction data where they have been used e.g. delivery , inspection lots, billing documents… so you could explain a large variety of potential errors.

        I remember numerous discussions in MM forum where people did not set the right combinations in the selection screen and archived either the wrong data or could not archive anything, as this MM_SPSTOCK can be used to archive  3 different kind of batches. I even have a matrix in my own documentation to avoid entering the wrong combination. So i am missing some sentences on that issue.


        (0) 
        1. Lakshmana Srini Post author

          Thanks a lot for your suggestions. Initially I thought of explaining the basic steps to perform archiving especially for beginners who doesn’t have any knowledge on this topic.

          Anyways I will add few more points of what you said to the content . It will be a good idea to include the problems we frequently encounter while doing these process.

          (0) 

Leave a Reply