Tables backup using R3trans

Tables backup using R3trans

The SAP transport program R3trans is used to transport data between SAP Systems and for the migration between different SAP releases. R3trans is usually called from other programs (e.g. tp). Therefore, direct use of R3trans is only necessary in exceptional cases where the regular tools and methods are insufficient.

R3trans works with a control file where all the necessary actions (parameters) are mentioned in it. During execution R3trans reads the parameters from control file and executes.

Syntax: R3trans []

Here the basic idea is to take an export backup of single or more than one tables from an R/3 system and import the data into other R/3 system thereby providing option to export selective tables across different R/3 Systems.

Scope of the abstract:

Table(s) Export
The control file for an export has the following structure:

export# <># <>

Export options

Now we will discuss about the export options for table(s) export. Options are nothing but parameters mentioned in the control file.

Option 1:
CLIENT = 100
The option allows you to perform the export from all clients. Here export will be performed from the client 100.

Option 2:
COMPRESS = YES
You can export compressed data. The data is automatically unpacked at import.

Option 3:
FILE = /My_Bkp_Dir/My_Backup_file.dat
The data is exported to this file. The default is trans.dat in the current working directory.
Export Selection

There are various methods for specifying which data is to be exported. You can also specify selections directly (Using SQL select statement).
· SELECT * from Zmytable1

Here you can use select statement directly into your control file. You can use more than one table as well.
SELECT * from Zmytable1
· SELECT * from Zmytable2
· SELECT * from Zmytable3
· SELECT * from Zmytable4

The control file for an export appears as follows:

EXPORT
CLIENT = 100
COMPRESS = YESFILE = /My_Bkp_Dir/My_Backup_file.dat

SELECT * from Zmytable1
SELECT * from Zmytable2
SELECT * from Zmytable3
SELECT * from Zmytable4

Execute R3trans

Lets assume your control file for export is named as export.ctl. Then execute R3trans into the source systems:

$ R3trans export.ctl

This creates a file named My_Backup_file.dat into the /My_Bkp_Dir/ directory. Copy (or ftp) this file to your target system.
Table(s) Import

The control file for an import has the following structure:

import# <># <>

Import options

Now we will discuss about the import options for the table(s) exported on earlier step.

Option 1:
CLIENT = 200
By default, the import always takes place in the same client as the export. This option allows you to import into other clients. Here the data will be imported into client 200.

Option 2:
FILE = /My_Bkp_Dir/My_Backup_file.dat
The data will be imported from this file.

The control file for an import appears as follows:

Import
CLIENT = 200FILE = /My_Bkp_Dir/My_Backup_file.dat


Execute R3trans

Lets assume your control file for import is named as import.ctl. Make sure your data file is copied into right directory into your target system and execute R3trans into your target system as follows

$ R3trans import.ctl /en/e1/8e51341a06084de10000009b38f83b/frameset.htm

ads