Data Archiving in SAP

August 3, 2017 | Author: Anupa Wijesinghe | Category: Databases, Database Transaction, Information, Computer File, Object (Computer Science)
Share Embed Donate


Short Description

Download Data Archiving in SAP...

Description

Contents Introduction .................................................................................................................................................. 3 Advantages of database archiving ............................................................................................................ 3 What is an Archiving Object? ........................................................................................................................ 3 Archive Information System ......................................................................................................................... 3 How to find the relevant Info Structure for each object .......................................................................... 4 How to activate info structures ................................................................................................................ 5 How to fill an Info Structure...................................................................................................................... 6 How to create a new info structure .......................................................................................................... 9 Archiving Configuration steps ..................................................................................................................... 11 Cross – Archiving Object Customizing..................................................................................................... 11 Archiving Object – Specific Customizing ................................................................................................. 12 Define Delete jobs ............................................................................................................................... 13 Basis Customizing .................................................................................................................................... 14 Application Specific Customizing ............................................................................................................ 16 Define “Residence time” for Archiving object .................................................................................... 16 Sales Document Archiving .......................................................................................................................... 18 Archiving object Sequence ...................................................................................................................... 18 Archiving – Step by Step ............................................................................................................................. 19 Pre-requisites to archive sales documents ............................................................................................. 19 Step 01: Pre-Processing .......................................................................................................................... 19 What are Spool Parameters and why? ............................................................................................... 21 Check Suitability for Archiving ............................................................................................................ 23 Step 02: Writing ...................................................................................................................................... 25 Step 03: Delete ........................................................................................................................................ 28 Step 04: Read .......................................................................................................................................... 30 Archiving management tool........................................................................................................................ 31 Archiving statistics ...................................................................................................................................... 32 Retrieving SD documents from archiving ................................................................................................... 33 Retrieving Delivery Documents .............................................................................................................. 33

Retrieving Billing Documents .................................................................................................................. 35 Read archived SD documents from document relationship browser (DRB) .............................................. 35 What is DRB? ........................................................................................................................................... 35 Read archived SD documents from archive Info system ............................................................................ 38 Useful SAP Notes on SD Archiving .............................................................................................................. 41

Introduction As the time goes on any database system can suffer from performance issues due to large volume of data. Once data volume is high, it uses more resources hence system performance get dropped. To avoid such cases, data which is no longer used by the system should be removed from the database and kept in a separate place for later references. During archiving, data is automatically compressed by up to a factor of 5. This process is known as Archiving.

Advantages of database archiving 

Resolves storage space and performance problems caused by large volumes of transaction data



Makes master data easier to handle and to keep up to date



Ensures statutory data retention rules are observed



Ensures that data can be re-used at a later date, for example in new product development.

What is an Archiving Object? The archiving object is the core of the SAP archiving concept. The archiving object determines what is archived and how. It also describes which database objects must be handled together as a commercial object and which must be interpreted independently. Data in the R/3 Database can only be archived using archiving objects, which describe the data structure and context.

Archive Information System The Archive Information System (AS) is a generic tool for indexing data archives and is fully integrated into the SAP Data Archiving environment. The indexes created with this tool, which are called Archive Information Structures, are used to display archived data. First you should check if an information structure already exists that you could use for reporting. You can then change this information structure to suit your needs. If there is no information structure available that you can use, you can create a new one. You define the information structure to be used for archive reporting. In doing this, you specify which source fields from the archive are copied to which fields in the information structure. You do this with the help of application-specific field catalogs, which are included in the features of the Archive Information System.

In simple terms, if you need to retrieve data after archiving took place, you need to activate all relevant info structures for that archive object first.

How to find the relevant Info Structure for each object Transaction: SARA 

Press button option Same can be directly reached through the transaction SARI.

 

Click on button User search help or Press “F4” under “Archiving Info structure” field



Use search option in the F4 help



Enter relevant archive object under

field and press Enter key



You’ll be able to see all relevant “Info structure” for that object here.

Important: You have to find relevant info structures for all your archiving objects before archiving any data. Then you need to activate those.

How to activate info structures Transaction: SARA 

Press button option Same can be directly reached through the transaction SARI.

 

Press on button. Transaction: SARJ will get you to the same window as well. Enter relevant info structure

 

Press button If it’s successful, system will give a message like this;

Important: Same has to be done for all relevant info structures in all relevant archive objects. For example, for archiving object: SD_VBAK; you have to activate below info structures.

How to fill an Info Structure This step is optional. (Only if you have done archiving without activating Info structures) During an archiving delete run all (activated) archive information structures belonging to an archiving object are filled automatically. Also the Archive Development Kit (ADK) transfers all data records found in the archive to the AS interface. From the defined info structure, the AS filters the data from the data records transferred and enters it in a transparent database table together with an access key. This table serves as the basis for later searches. This function allows you to fill an information structure with data from the available archives if the delete program has already processed those archives. Transaction: SARA



Click on

button

You can directly access this window from the transaction SARI



Click on



Enter “Archive Object” and press



You can view the status of all relevant info structures here from the traffic light system.

button button



Mark all info structure with red light and click on



Choose processing time as “Dialog” for below message



You’ll get a message as below

 

Press Enter After that all traffic lights should turned to green

button

How to create a new info structure This step is optional. If required; you can create new info structures to read archived data. An information structure is only valid for one archiving object. Several information structures can be defined for one archiving object. Eg: For archiving object SD_VBAK; you have below set of info structures.

Transaction: SARA 

Click on



From

 

From press button Give a ID, Description, relevant archive object and Field Catalog for new info structure as follows



Press

button screen, click on

button



Enter relevant Development Package (Get it from Technical/Basis consultant)



Press



Now from

, add fields you want to be in the selection criteria

from “Optional fields” table to “Info structure fields” table by highlighting and clicking button



Once done, Press

Now you have created a new info structure. You need to activate this structure before using it for archiving. To activate it; please refer; “How to activate info structures” section in this document.

Archiving Configuration steps Transaction: SARA This transaction is a one stop shop for all archiving related settings, such as customizing, pre-processing, archiving, deleting, reading, management, etc. Before archiving an object, you need to customize relevant settings. 

Enter relevant Archive object



Press

button

Cross – Archiving Object Customizing 

Accept all default settings in

section

You can review the defaults and update them appropriately. For example, you may want the system to check for files in the file system or for stored files, have the system verify the archive file existence before deleting, indicate the maximum amount of data you can write to the archive file, and give the name of the server group name for a background job.

Archiving Object – Specific Customizing 

Click on section

under

 

Press Under “Settings for Delete Program”, you have to maintain given 2 variants

 

To maintain “Test Mode Variant”, click on Mark “Test Mode” option

 

Click on button Enter a name under “Meaning” field. Here I’ll user same Name as Meaning.



Press



Press

 

Now click on “Live Mode Variant” and press Create the variant there as per above mentioned steps.

button

button and come to

screen button

This has to be done to all relevant objects. Define Delete jobs Once archiving is done, you need to delete archived data from the data base. You can setup this in 3 ways. This you can define under “Delete Jobs” section.

Select



if you want to manually carry out deleting.

Once done, Press

Basis Customizing In this step you have to define the archive file path. This path is a global setting for the entire client. (Object Independent) You can specify the external storage system and based on the configuration, the system automatically transfers the archived files to the subsystem. You should link the external storage system to the SAP system for file transfer. If you haven't specified the external storage system, you can use the SAP Content Management Infrastructure. As the name specified, this is done by basis consultants. 

Click on

Here you specify cross- client file paths.

under

section



Highlight “ARCHIVE_GLOBAL_PATH - Global path for archiving files” line and click on node in “Dialog Structure” section



Highlight the relevant System details and click on

option.



As per my example, my archive files are saved to “G:\usr\sap\archive\”

Application Specific Customizing Define “Residence time” for Archiving object What is Residence time? The residence time refers to the amount of time that has to pass before a business object to be archived. Residence time is measured in number of days and is entered in application-specific Customizing for a specific archiving object. The residence time can begins either with the creation date of the document, or with the last change date. Transaction: SARA 

Press



Click Section

button under “Application-Specific Customizing”

Same can be accessed from the transaction VORA as well. 

Enter Sales Organization, Sales Document type & Residence time in days here



Press

and get the TR number

Note: If you haven’t maintained the above step, you’ll get below error message during the archiving process. Message no. VB801 - Internal error: DYNSQL_GENERATE_WHERE_CLAUSE (4)

Eg:

Sales Document Archiving Archiving object Sequence Archiving has to be done in a sequence. For example, to archive sales document, you need to archive delivery, billing first. (It’s like you need to archive all depended data of it first.) In order to find depended objects, go to transaction SARA. 

Enter the object under “Archiving object” field

 

Press You can see the dependent objects in graphical mode.

With the network graphic, you can display an overview of the existing archiving objects, their interdependencies, and the status of the most recent archiving.  

By double clicking each box, you can directly go to relevant archiving screen. By dragging the navigation box in the navigation area, you can get all dependent objects.

Archiving – Step by Step Scenario Eg: I’ll get single sales document and archive. SO # 1000093

Pre-requisites to archive sales documents Please refer SAP Note 481577 - Archivability criteria for sales documents

Step 01: Pre-Processing Some archiving objects require a program that prepares the data for archiving. This program flags data to be archived, but it does not delete any data from the database. Preprocessing programs must always be scheduled manually and are run from Archive Administration. This is not available for all archiving objects. Transaction: SARA 

Enter relevant object

 

Press Enter a variant ID

  

Click on button Set relevant selection parameters. (As per my example; EI have to enter the Sales Document no) Mark below tick boxes

 

Press button Give a description under “Meaning” field

button



Press



Click on



Click on

button button to enter a start time for archiving process.

Based on scheduling or immediate execution, you have to setup data in this screen. 

If it’s a immediate execution, click on



Click on

button

,

Now you need to maintain Spool Parameters for the archiving process. What are Spool Parameters and why? Controls the print output of the generated archiving log. You can choose Properties to maintain additional properties of the spool request. You do not generally change these properties for each spool request. If you have not configured any printer Enter LP01 or LOCL .These output types comes with the system and just create spool and the spool will be deleted based on the Basis Configuration. Spool parameters that are already specified in the user defaults or in the user-specific print parameters are automatically applied. Otherwise, you only have to specify the spool parameters for the execution of the first ction in an archiving session. They are retained until the end of the archiving session.



Click on

 

Press Once above 2 steps are completed, traffic lights has to be turned to green.

 

Now press button You’ll get a system message like this.

 

To check the log on processing status, click on button In the “Job Overview” you can see the status of the job.

in same screen.



Click on the line and press

 

Now press and come to Now you need to write the Archive file.

button to see details.

You can check whether any SD document can be archived by executing below report. Check Suitability for Archiving Transaction: SE38 

Go to the transaction.



Enter the report name as S3VBAKPT and press

 

Enter sales document number you want to check



Press



You can see the result as follows

. (This report is for SD documents only)

Make sure you mark below tick boxes under “Document Selection” section

Step 02: Writing This program creates archive files and writes data to them. It does not delete the data from the database. You can specify in archiving object-specific Customizing, whether the delete program is automatically started after an archive file is created.



In the

maintain the relevant object.

 

Press button Enter a variant ID for write data to archive file.

 

Click on Click on below options

By selecting residence time calculation. 

button to create a variant.

you specify, last change will have an impact on

Make sure you set “Production Mode” option



Set below settings for logs

 

Click on button to maintain variant attributes Enter description for variant in “Meaning” field



Press



Press



Press

button



Press

to start immediately.



Press



Press

 

Press Now you should be able to see all traffic lights are turned to green.



Now press



Click on



Press

and come to

screen

button

button button to see the log. button till you get “Finished” Status



Click on

to view details.

You have created the Archive file successfully. 

Press

and come to

Step 03: Delete The data is usually deleted from the database, but in some circumstances, the archived data is only flagged for deletion in the database. You can specify in Customizing for archive objects whether archive files are to be automatically passed to an archive system via ArchiveLink after processing. 

Click on

button to delete the archived files from the database.



Click on

with your user ID



Mark tick boxes for the relevant archive session.



Press



Press

button



Press

to start immediately.



Press



Press



Press You should be able to see all traffic lights are turned to Green.

 

Now press button. You’ll get Make sure you un-tick “Test Mode” button



Press



Press



Once job is finished, click on

button

message.

to check the log. button till you get “Finished” status for the job. to see the log

If the deletion is successful, you will not able to access the sales document in VA02, VA03 transactions.

Same process is applicable for each archive object. Eg: SD_VBAK - Sales Documents RV_LIKP – Deliveries SD_VBRK - Billing Documents

Step 04: Read You can read archive data via this option. Transaction: SARA 

Enter relevant archive object and press



Press



Enter the relevant document number

button

button

 

Press button If you know the relevant archive session, then select that or mark all archive sessions



Press

button

Archiving management tool In the transaction SARA, if you press button, you can see Sessions, Files Archiving Objects, Job details, Physical File Name, Logical Path, File Name, size and the status.



Enter the object



Press

button

Archiving statistics This is used to see statistics about space saved in MB. From the transaction SARA, 

Enter the archiving object



Press

button option.

You should be able to see the statistics of the data archiving for that object.

Retrieving SD documents from archiving Some archived documents can be viewed directly from SAP transactions.

Retrieving Delivery Documents When you archive delivery documents, you can read them via VL03N transaction. But, system issues a message as follows,

You can see the

icon in the header area as well.

To view connected documents (Sales order, billing, etc) you have to use the menu option, Environment > Relationship Browser

It will display all documents that are connected to this delivery.

Retrieving Billing Documents Transaction: VF07 Once billing documents are archived, you can read them from the transaction VF07. 

Enter the billing document number



Press Enter key

Read archived SD documents from document relationship browser (DRB) What is DRB? Using the DRB, you can display linked objects or documents. Generally, these are documents resulting from a common business transaction or belonging to a common process. The DRB groups the documents together across applications. Typical accounting and logistics documents are included in the DRB.

As of SAP Web Application Server Release 6.20, workflow logs and I-docs are also displayed in the DRB. All objects are connected to the DRB so as to allow access to archived data.

Transaction: ALO1 

Select the relevant category

 

Press Enter relevant document number



Select

 

Press You’ll get the archived data as follows

By using

option

you can view details of the delivery document well.

Read archived SD documents from archive Info system Transaction: SARA 

Enter archive object and press

button



From button

screen, click on



From button

screen; press



Enter relevant “Archive lnfostructure” and press



Enter relevant document number you want to retrieve and press



You should be able to see the relevant document overview

 

Click on button to view the document Select the relevant data object and press Enter

You’ll be able to view the document as follows



If you select

option, you’ll be able to view data relationship browser.

Useful SAP Notes on SD Archiving Below listed are some useful SAP notes on SD archiving.        

547748 - FAQ Archiving of Sales Documents 492938 - FAQ Document Relationship Browser 481577 - Archivability criteria for Sales Documents 488970 - Archivability criteria for billing docs 99388 - Archive Information System 102446 - Archiving objects, Application Area, Customer Messages 497768 - Reloading archived deliveries (object RV_LIKP) 373568 - Archiving SD Reloading documents not supported

Author: Anupa Wijesinghe E-Mail: [email protected] / [email protected] Website: www.learnsaptips.com View my profile in LinkedIn Follow me on Twitter

Disclaimer This article is done based on my research and readings, unless otherwise stated. The views expressed are my own and not of anyone else. Author accepts no liability for the content of the articles in this website or for the consequences of any actions taken on the basis of the information provided. Using this information is at the users own discretion and responsibility.

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF