Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
avinashkumar2232
Explorer
0 Kudos
824

There may be situations where you need to export and import SAP tables from OS level, this can be achieved using R3trans utility in SAP.

Setp 1 :- Collect all the list of tables to be exported.

Step 2 :- Check enough disk space available in the directory where you are going to perform export.

Step 3 :- Create two control files for R3trans which will be used for export & import.

For example :- create control file named as export.ctl and the control file should contain entries like below

export
client=<client no>
file=export_data.dat
select * from <table_name_1>
select * from <table_name_2>
:
:
select * from <table_name_n>


The below are the calling options for R3trans, you can use the below options based on your requirement

 You can specify the following options for calling R3trans:

  • -c <f1> [<f2>] Conversion
    Copies file <f1> to file <f2> by converting the character set to the local character set. If <f2> is omitted, R3trans copies to trans.dat (see Automatic Character Set Conversion with R3trans).
  • -d DB connect
    Check if connect to database is possible and if the ABAP Dictionary is available.
  • -i <file> direct import from data file without specifying a control file (see Import)
  • -l <file> Output of a table of contents to the log file
  • -n Brief information about new features of R3trans not yet documented
  •  -t Test mode All modifications in the database are rolled back.
  •  -u <int> Unconditional mode This option invalidates the rules of the correction and transport system. Each mode can be concatenated (for example -u 12).
  •  -v Verbose mode
    Writes dots to <stdout> and writes additional details to the log file.
  •  -w <file>
    The transport log is written to this file. The default file is trans.log in the current directory.
  •  -x Check whether connection to database can be made

Example:- R3trans export.ctl -w export_log.log

Step 4:- Once export is completed export_data.dat file will get generated.

Step 5:- Use the same .dat file to perform the import, create the import control file (import.ctl) as below

import
client=<client no>
file=export_data.dat


Step 6:- Call R3trans command with the import control file to start import, the table entries will get imported automatically.

Example:- R3trans import.ctl -w import_log.log

Note:- You can even use R3trans to delete a client from OS level, which will remove all the contents of the table with respect to a single client. For that you need to create a control file as below

delete
client=<client no>
select * from 
 
after creating control file you can issue the command as

 Example:- R3trans delete.ctl -w delete_log.log
Labels in this area