Data archiving: material documents

This blog will explain how to archive material documents via object MM_MATBEL. Generic technical setup must have been executed already, and is explained in this blog.

Object MM_MATBEL

Go to transaction SARA and select object MM_MATBEL.

Dependency schedule:

In case you use production planning backflush, you must archive those first.

Main tables that are archived:

  • MKPF
  • MSEG
  • NAST (for the specific records)

Technical programs and OSS notes

Write program: RM07MARCS

Delete program: RM07MADES

Read program: RM07MAAU

Relevant OSS notes:

Application specific customizing

In the application specific customizing for MM_MATBEL you can maintain the document lifetime settings:

Executing the write run and delete run

In transaction SARA, MM_MATBEL select the write run:

Select your data, save the variant and start the archiving write run.

Give the archive session a good name that describes plant and year. This is needed for data retrieval later on.

After the write run is done, check the logs. MM_MATBEL is fast archiving and has high percentage of archiving (up to 100%).

Deletion run is standard by selecting the archive file and starting the deletion run.

Data retrieval

Start the data retrieval program and fill selection criteria:

In the second screen select the archive files. Now wait long time before data is shown.

Faster data retrieval is via archive explorer transaction SARE (for the archive explore the infostructures must be filled first, see this blog):

Fill out the document criteria:

From the result list double click on the line and jump to MIGO transaction to view the archived document.

Data archiving: archiving infostructures

Several retrieval functions in SAP data archiving require the setup of archiving infostructures.

More on archiving data retrieval in general can be found in this blog.

Activation of infostructures

Using transaction SARJ you can configure the infostructures for archiving:

Using display, you can see the fields that are put in archiving infostructure:

On the first screen you can activate the infostructure by pushing the Activate button.

Activation is only activating the structure for future archive runs, not for past runs. For these you need to fill the structures first.

Filling the structures for existing archive files

Filling the structures for existing archive files is bit hidden. Goto transaction SARJ and select the object. Now choose menu Environment and choose Fill Structure.

In the next screen select the files you want to fill (these are normally yellow):

After selection, choose the Fill Structures button to start the batch job filling them. Don’t select too much. It is intense on reading the archive.

Green ones are done. Red ones have failed.

Most common cause for failures is that the variant for the WRITE program was set so the same document got archived twice into different archive files.

What can be done? If it is OK to have the same document in different files, you can ignore the archive session entries with error in SARI.

To avoid having duplicate keys in the infostructure in future, you can add the filename as an extra key field to the infostructure. This can be done as follows:

– SARJ ->Infostructure -> Display
– Technical data
– Change the field “File Name Processing” from ‘D’ to ‘K’

Archiving infostructure status

Use transaction SARI to check the status of the archiving infostructures:

From here you can go to the Status to check the status of the files.

Archive explorer jumps to SARE transaction for the explorer.

Customizing jumps to the SARJ transaction described above.

Data archiving: data retrieval

When you perform data archiving, from time to time you need to give support on data retrieval issues.

This blog will explain some of the general data retrieval concepts.

Questions that will be answered in this blog are:

  • How does single record retrieval work?
  • How can I use the archive explorer?
  • How can I get a list of data from the archive?

Single record retrieval

Single record retrieval is different per archiving object.

Some objects (like FI_DOCUMNT) are nicely integrated. In FB03 the system will check first database, then look into the archive inforecords to find if the document is archived. And then it will show the document in same layout.

Most objects have archive read program which you can find in SARA:

Now run the read program:

And fill out the record(s) you need:

Now you need to select the data files:

If you didn't label your files correctly, you need to select them all, which makes data retrieval slow.

Results are shown:

Results might look ok, or very basic. This is different per archiving object.

Use of archive explorer for table level

An alternative way is the use of the archive explorer. This will give details on table level.

Start transaction SARE:

Fill out the required object and archive infostructure. In this case we used change document. In the second screen fill the object:

Now you can see list of changes:

Double click on the record to see the tables:

Double clicking on the table will give the actual table line content.

Filling infostructures

More on infostructures can be read in this dedicated blog.

List transactions

Some transactions (especially in FICO domain) have integrated reporting with the data archive. We will use transaction FBL3N as example.

Start FBL3N:

Then click on Data Sources, include Archive, and select the needed files:

If you didn't label your files correctly, you need to select them all, which makes data retrieval slow.