Import Process

Objectives

After completing this lesson, you will be able to:
  • Analyze the different steps during the import of transport requests
  • Explain the use of tp commands

Steps in the Import Process

When importing several transport requests simultaneously, tp processes each import step collectively for all transport requests to be imported. The required steps for each request are listed in the transport buffer file. The contents of the transport buffer file are organized as a table in which each column represents an import step. The numbers in the columns indicate either whether the import step is necessary, or the number of objects in the request that require the specific step.

When you import all transport requests listed in the figure "tp Processing Sequence", together, the first import step DDIC is processed for transport requests where it is required (DEVK900827, DEVK900840 and DEVK900865), then the ACTIV step is processed (for the same transport requests), then the MAIN I step for all transport requests, and so on.

The tp import all command, therefore, does not process all steps for one transport request before moving on to the steps for the next transport request. For example, if you detect an error in a program that has already been exported, you will need to correct the program and release the corresponding transport request for the correction. Import all requests then will import the transport requests of the whole transport buffer in the correct sequence and the faulty program will be overwritten. Because the generation step is the last step and is performed only once for all programs in the trnsport requests, the faulty program does not affect your production system. Only the correct version of the program will be generated.

There are four major steps when importing transport requests (see the figure "Steps During Import"):

  1. Importing dictionary objects
  2. Handling of dictionary objects
  3. Importing "everything else"
  4. Handling of "everything else"

These steps in the import process are, in detail:

DDIC: ABAP Dictionary import
In an import with R3trans, all ABAP Dictionary structural data is imported inactively, thus enabling you to perform this import step in an SAP system that is not yet in downtime.
  • Log file: <source SID>H9<number>.<target SID>
  • Transport tool: R3trans
ACTIV: ABAP Dictionary activation
Runtime descriptions (nametabs) are generated. This is the beginning of the downtime.
  • Log file: <source SID>A9<number>.<target SID>
  • Transport tool: Job RDDMASGL (starting report RDDMASGL)
ACTIV: ABAP Dictionary distribution
After activation and running logical checks for the new dictionary structures, the distribution program decides what actions are required to adopt the object on database level.
  • Log file: DS<date>.<target SID>
  • Transport tool: Job RDDIS0L (starting report RDDGENBB with variant DIST)
ACTIV: Structure conversion
If necessary, changes are made to table structures.
  • Log file: N<date>.<target SID>
  • Transport tool: Job RDDGEN0L (starting report RDDGENBB with variant CONV)
ACTIV: Move nametabs
The new ABAP runtime objects are put into the active runtime environment, database structures are adjusted, if necessary.
  • Log file: P<date>.<target SID>
  • Transport tool: Job RDDMNTAB (starting report RDDMNTAB)
MAIN I: Main import
All other objects and data are imported.
  • Log file: <source SID>I9<number>.<target SID>
  • Transport tool: Job R3trans
VERS: Versioning
Versions of repository objects are only created if tp parameter VERS_AT_IMP is active.
  • Log file: <source SID>V9<number>.<target SID>
  • Transport tool: Job RDDVERS* (starting reports RDDVERS*)
XPRA: Execution of Reports after import and of "After Import Methods"
XPRAs are programs that are started during import in the target system. The XPRA object has the same name as the program.
  • Log file: <source SID>R9<number>.<target SID>
  • Transport tool: Job RDDEXECL (starting report RDDEXECL)
GENERA: Generation of ABAP programs
During this step, the ABAP programs are generated.
  • Log file: <source SID>G9<number>.<target SID>
  • Transport tool: Job RDDDIC3L (starting report RDDDIC3L)

Note

It is also possible to import non-ABAP objects using the enhanced Change and Transport System (enhanced CTS, formerly known as CTS+). In this case, an additional deployment step for importing the objects into the non-ABAP system takes place after the main import. The corresponding log file is <source SID>T9<number>.<target SID>, the transport tool is job RDDEPLOY.

When transporting SAP HANA content with the help of SAP HANA Transport for ABAP (HTA), the additional job RDDHANAD for SAP HANA deployment is triggered. This job creates the log file <source SID>C9<number>.<target SID>.

R3trans is a transport tool at operating system level used to transport data between SAP systems. R3trans is usually called by other programs such as tp, the transport control program.

For transports between SAP systems, to access the database, tp indirectly calls R3trans by causing UNIX to issue a fork(), Windows to issue a CreateProcess(), and AS/400 to issue a spawn(). During export, R3trans stores the object data extracted from the database in data files in the transport subdirectory data. The format of these data files, R3trans format, is independent of the platform. During import, R3trans reuses these data files.

Direct use of R3trans is not supported but may be required in exceptional cases. In case of transports, R3trans should always be used via tp.

Note

Import steps differ for the different object types. Further activities may be required in addition to R3trans activities. tp ensures that all export and import steps, including R3trans activities, are completed successfully.

R3trans writes data using a standard transport format. Thus you can export data with an old R3trans version and import data with a new version of R3trans. You can also transport between different databases or operating systems.

Note

Although exports and imports are independent of the R3trans version, the database platform, or the operating system, SAP does not support using tp or R3trans for transports between different SAP system releases. See also SAP Note 1090842 – Composite SAP Note: Cross-release transports.

The first step of an import process is the tp call, triggered by starting an import through TMS or by a tp import command at operating system level.

During the whole import process, tp reads the transport buffer file that includes all the necessary steps for the specific request.

If you trigger a tp import all, tp has to ensure that only all transport requests are imported that are stored in the transport buffer at the beginning of the import process. This is done by executing command tp setstopmark each time a tp import all process is started. After the steps of the import process are completed, the command tp delstopmark is performed automatically, and a tp cleanbuffer deletes the transport requests from the transport buffer.

After all involved tools have finished their work, tp exits to operating system level and writes a return code to the appropriate log file for the activity. For example, tp import commands are recorded in the ULOG file.

Note

The command tp import can be restarted. If an error occurs during import, after you eliminate the error condition and restart tp, tp finds the correct point to restart.

By default, tp aborts if one import phase receives a return code larger than 8. The transport profile parameter STOPONERROR defines what return code value should cause tp to abort.

tp reads the transport buffer file that includes all the necessary steps for the specific transport request(s) and calls R3trans at operating system level.

For each import step, tp passes information from the transport buffer file to R3trans. R3trans reads the corresponding data files in the transport subdirectory data and connects directly to the database to perform inserts or updates to the included objects. After R3trans finishes performing inserts or updates, it passes an exit code (return code) to tp.

For each transport action, R3trans writes a log file in transport subdirectory tmp. After R3trans has completed its work, tp moves these log files to the transport subdirectory log.

During the import process, R3trans is executed by the import steps ABAP dictionary import (for the import of ABAP dictionary definitions) and main import (for the import of other repository objects and table contents).

In addition to the steps performed by R3trans, tp triggers the so-called import dispatcher. The import dispatcher is a background job with the name RDDIMPDP in the SAP system, which performs steps in the import process. It is a job and program in the SAP system, that controls post import activities, such as table structure activation and conversion, program generation and versioning

tp and RDDIMPDP communicate via table TRBAT. For every transport request, tp writes an entry in table TRBAT. The import function currently being performed for the request is represented by a character.

In the example below, there are three transport requests waiting for activation of DDIC objects (Function = J) in the table TRBAT.

RequestFunctionReturn CodeTimestamp
DEVK904711J999900000001
DEVK904714J999900000002
DEVK904718J999900000003
HEADERJB20221112181000

tp inserts a header entry to request RDDIMPDP to start processing. Some activities that are independent of transport requests, such as distribution and structure conversion, only have a header entry in table TRBAT. Return code 9999 indicates that the step is waiting to be performed. For the header entry, tp inserts a B (for "begin") as return code.

To trigger the job RDDIMPDP in the SAP System, tp uses the operating system level tool sapevt.

When RDDIMPDP is started, it checks the table TRBAT to find out if there is an action to be performed for the transport requests such as mass activation, distribution, or table conversion. It sets the header entry to R (for run), and starts the appropriate RDD* program as a background task, reschedules itself, and exits.

Note

For example, RDDMASGL is for mass activation, RDDEXECL for execution of reports and "after import methods" after import, and RDDVERSL for versioning. Each RDD* job receives a job number that is recorded in table TRJOB. The jobs report their current status back to TRJOB.

The activated program (in this example, the mass activator for dictionary objects) sets the status of the first entry in TRBAT to active (return code 8888):

RequestFunctionReturn CodeTimestamp
DEVK904711J888800000001
DEVK904714J999900000002
DEVK904718J999900000003
HEADERJR20221112181005

Each of the required background tasks receives a job number generated by background processing. This job number and the step ID are inserted into table TRJOB by the RDD* jobs.

The background tasks write their return codes in table TRBAT and delete the corresponding entry in table TRJOB. Return codes of 12 or less indicate that the step is finished. In TRBAT, the column TIMESTAMP contains the finishing time. When all the necessary actions are performed for all transport requests, the header entry is set to F (for "finished") by the RDD* jobs.

RequestFunctionReturn CodeTimestamp
DEVK904711J420221112181039
DEVK904714J020221112181041
DEVK904718J020221112181045
HEADERJF20221112181045

All the background jobs log the performed steps either in the database or in transport subdirectory tmp.

tp monitors the entries in table TRBAT and table TRJOB. When the header entry in table TRBAT is set to F and table TRJOB is empty, tp copies the logs of the completed steps from directory tmp to directory log and deletes the corresponding entries in table TRBAT.

If problems are detected by tp when monitoring the TRBAT and TRJOB tables, tp re-triggers RDDIMPDP through sapevt. RDDIMPDP then automatically recognizes if a previous step is still active or was aborted by checking the TRJOB and TRBAT tables. If a step was aborted, RDDIMPDP restarts this step.

tp uses the tables TRBAT and TRJOB to communicate with the various ABAP programs started by the background jobs. Note that there must be at least two background work processes configured in the SAP system.

When imports are performed, tp triggers the import dispatcher RDDIMPDP by sending the event SAP_TRIGGER_RDDIMPDP with the help of the tool sapevt. In client 000, user DDIC must schedule the job RDDIMPDP with event-based scheduling.

For AS ABAP based systems of SAP Business Suite, RDDIMPDP can be scheduled by running the ABAP program RDDNEWPP in client 000 with a user that has the CTS administration authorization S_CTS_ADMIN.

Hint

Executing RDDNEWPP in clients different from 000 schedules job RDDIMPDP_CLIENT_<###>. Job RDDIMPDP_CLIENT_<###> (which has been scheduled automatically after a local or remote client copy with transaction SCCL or SCC9) is not needed anymore, however. See SAP Note 2687484 – About job RDDIMPDP_CLIENT_nnn.

Note

SAP Note 3035580 – Job RDDIMPDP running as DDIC ships a new report (RDDNEWPP2) which enhances its predecessor (RDDNEWPP) with the option to explicitly specify the user chosen for the scheduled executions of the background job RDDIMPDP. In addition, see SAP Note 3217799Use a different user for the job RDDIMPDP in S/4HANA - SJOBREPO.

Due to the Job Repository and the profile parameter rdisp/job_repo_activate_time, for SAP S/4HANA Server systems, it is not necessary to run report RDDNEWPP in client 000, but it might take some time until the job is scheduled again.

Note

You can also import non-ABAP objects using the enhanced Change and Transport System (enhanced CTS, formerly known as CTS+). In this case, table TRBATS is used. TRBATS works like TRBAT, but TRBATS includes the SID of the non-ABAP system in its primary key. So it is possible to trigger imports in multiple systems. The AS ABAP based SAP system on which tp is called is used as communication system for the non-ABAP system.

More Information

For more information, see the online documentation for SAP S/4HANA (Product Assistance), area Enterprise TechnologyABAP PlatformAdministrating the ABAP PlatformAdministration Concepts and ToolsSolution Life Cycle ManagementSoftware LogisticsChange and Transport SystemTransport Tools (BC-CTS-TLS)Transport Control Program tpHow tp WorksCommunication Between tp and ABAP.

Monitor the Import Process

Business Example

To enable the post import activities, the import dispatcher, RDDIMPDP has to be scheduled correctly in the SAP system.

Task 1: Monitoring the Import Dispatcher

Monitor the import dispatcher RDDIMPDP.

Steps

  1. Verify the scheduling of the import dispatcher RDDIMPDP in SAP system S4Q.

    1. Log on to SAP system S4Q in client 100 with the credentials provided by your instructor.

    2. To view the scheduling of RDDIMPDP, start the Simple Job Selection (transaction SM37).

      • Choose RDDIMPDP* as Job Name and * as User Name.
      • Deselect Finished as Job status.
      • Select * in the Or after event field.
      • Keep the other settings unchanged and choose Execute.
    3. In the Job Overview, a list of all scheduled RDDIMPDP* jobs is displayed: RDDIMPDP and maybe others.

    4. To get more details about the job, select the line with job RDDIMPDP and choose Job details from the application toolbar.

    5. Job RDDIMPDP is started after raising the event SAP_TRIGGER_RDDIMPDP. The Job Frequency is event periodic.

  2. If the job RDDIMPDP was not scheduled, how would you schedule it?

    1. To schedule the job RDDIMPDP, you would need to log on to client 000 and run the program RDDNEWPP. The step in the job is being scheduled to run with user DDIC, independent of the user you are logged on with.

      Note

      Due to the Job Repository and the profile parameter rdisp/job_repo_activate_time, for SAP S/4HANA Server systems, it is not necessary to run report RDDNEWPP in client 000 but it might take some time until the job is scheduled again.

Task 2: Monitor the Import

Monitor the Import all process that your instructor triggers.

Steps

  1. Your instructor starts a long-running import of some transport requests into the pre-production system S4P, pre-production client 100. Monitor the progress of the import from the SAP system S4P. Start the different tools in parallel.

    Note

    This exercise must be performed with the instructor's assistance.

    1. Log on to the production system S4P, production client 100 with the credentials provided by your instructor.

    2. Open six sessions in parallel as follows:

      • Start transaction STMS, choose OverviewImports from the menu, double-click the line for the S4P system, and choose GotoImport Monitor. The Import Monitor shows the current import process. Use Refresh to follow the progress of the import process.
      • Start transaction AL11, choose DIR_TRANS and then subdirectory tmp.
      • In transaction SM37, choose Job name = RDD*, User name = *, Or after event = * and deselect Finished. Choose Execute.
      • In transaction SE16, enter table TRBAT, choose Table Contents, and choose Execute.
      • In transaction SE16, enter table TRJOB, choose Table Contents and choose Execute.
      • In transaction ST06, in the lower left area choose Snapshot → Top 40 CPU processes. Try to find tp and R3trans.
    3. While the import is running, depending on the transaction choose Refresh or Execute to refresh the screens.

    4. In the Import Monitor, you see the return code. During the import, you should see log files in the tmp directory, entries are made in tables TRBAT and TRJOB. In transaction SM37, there are jobs visible, such as RDDMASGL, RDDMNTAB, and RDDVERSL. In transaction ST06 you should easily catch tp, and maybe R3trans.

Transport Commands

The transport control program tp is used for controlling transports between SAP systems, applying SAP Support Packages, and for performing release upgrades. The tp program tracks transports by controlling exports and imports of objects between SAP systems. The program also ensures that the steps for exporting and importing objects are performed in the correct sequence and that imports into a target system are done in the same sequence as the exports from the source system.

tp is an operating system level program, which uses special programs, such as C programs, operating system commands, and ABAP programs in the SAP system.

Exports and imports are performed separately:

  • In the export phase, the objects to be transported are extracted from the database of the source system and are stored in files in the transport directory. An export always takes place immediately after the transport request has been released so that the objects are freed for further changes. tp uses the program R3trans at operating system level to establish a connection to the database and to perform the necessary steps in the database.

  • In the import phase, the objects are added to the database of the target system.

Note

There is no automatic mechanism that imports a transport request into a target system immediately after export.

Although most transport activities can be performed using TMS, you may find the need to use tp commands for exceptional cases. Because the import queues are the representation of the import buffer file in the SAP system, the use of tp on operating system level and from within TMS produces consistent results.

tp commands are executed in the transport subdirectory bin by user <SID>adm. tp commands are called using syntax tp <command> [argument(s)] [option(s)].

  • To display general information on the syntax of all tp calls, use tp help. To display a description of the syntax and function of a specific command, use tp <command> without any options.
  • To count the number of all transport requests registered for import into a specific SAP system, use tp count <SID>.
  • To test whether a connection to an SAP system's database was successful, use tp connect <SID>.
  • To display how the import dispatcher RDDIMPDP is scheduled for a specific SAP system, use tp checkimpdp <SID>.
  • To display all current settings of the tp parameter file for a specific SAP system, use tp showparams <SID>.

Hint

You always have to specify the full qualified path to the tp parameter file TP_<domain name>.PFL by using the parameter pf=<(path to )TP_<domain name>.PFL.

Imports performed using tp at operating system level should be restricted to exceptional cases, for example if the TMS is not available or special tp commands are needed.

There are two commands to start an import using tp at the operating system level:

  • tp import all <target SID> client=<client number> pf=TP_<domain name>.PFL

    Analogous to the use of the Import All Requests button in TMS, this command imports all waiting transport requests in the correct sequence.

  • tp import <transport request> <target SID> client=<client number> u0 pf=TP_<domain name>.PFL

    Analogous to the use of the Import Request button in TMS, this command imports a single transport request into the target system (and leaves it in the queue for later import).

Importing individual transport requests should only be performed in exceptional cases as the correct sequence of transport requests is not necessarily maintained and thus newer versions of objects may be overwritten by older versions through the regular import of all waiting transport requests. To ensure that the objects imported through an individual transport request are not overwritten by an older version, make sure that you use unconditional mode 0, that is, the option u0, when starting individual imports (see figure above). Using this mode is analogous to the TMS preliminary import and causes the transport request to remain in the list of transport requests to be imported. When the regular (mass) transport takes place, the transport request will automatically be imported again in the sequence of the import queue.

Caution

Processing imports in the wrong order can result in severe inconsistencies in the target system. These are hard to diagnose. If you do not want to import single transport requests as preliminary import (NOT recommended in case of transport strategy Queue-Driven Transports, Mass transports), you would use tp import <transport request> <target SID> client=<client number> pf=TP_<domain name>.PFL, without the option u0.

The contents of transport buffer files in the transport subdirectory buffer are organized as a table. Each line contains information on a specific transport request. One column includes the unconditional mode that is linked to the transport request. Other columns specify import actions.

tp offers several commands for accessing buffers:

  • tp showbuffer <SID>

    This command displays transport buffer entries for system <SID>.

  • tp addtobuffer <transport request> <target SID>

    This command registers the transport request <transport request> at the end of the import queue of system <target SID>.

  • tp delfrombuffer <transport request> <target SID>

    This command deletes the single transport request <transport request> from the transport buffer file of system <target SID>.

  • tp cleanbuffer <SID>

    This command removes successfully imported transport requests from the transport buffer file of system <SID>. This function is included in the command tp import all <target SID>. This action can be started in transaction STMS by choosing the menu paths OverviewImports and then (after selecting a queue) Import QueueDisplay and finally ExtrasDelete Imported Requests.

  • tp setstopmark <SID>

    This command places a stopmark at the end of the transport buffer for system <SID> so that subsequent tp import commands only process the transport requests that are located before the stopmark.

  • tp mvstopmark <transport request> <SID>

    This command moves the stopmark in front of the transport request <transport request> in the transport buffer file for system <SID>.

  • tp delstopmark <SID>

    This command deletes the stopmark from a transport buffer file for system <SID>.

Hint

You always have to specify the full qualified path to the tp parameter file TP_<domain name>.PFL by using the parameter pf=<(path to )TP_<domain name>.PFL.

Unconditional Modes

Unconditional modes are among the options that can be assigned to tp commands. They are used to cause specific rules of the Change and Transport System (CTS) to be ignored.

Some examples of tp unconditional import modes are:

Unconditional Modes

0During ImportLeave transport request in queue for later import: Import from transport buffer without deleting from transport buffer and set unconditional mode I in transport buffer to trigger another import
1During exportIgnore incorrect status of a transport request.
1/IDuring importImport transport request again: ignore that transport request was already imported into SAP system and import again from beginning
2During importOverwrite originals
3During importIgnore predecessor relations
4During importIgnore invalid component version
6During importOverwrite objects in unconfirmed repairs
8During exportIgnore invalid table class: allow selection of tables, some tables are part of complex objects and generally can't be exported alone
8During importIgnore invalid table class: ignore the restriction resulting from table classifications and import all table entries into specified clients
9During importIgnore invalid transport type

Hint

The unconditional modes may vary in dependence of the SAP system and tp release.

Each unconditional mode is represented by a digit or a character. To use an unconditional mode, add a u to the tp command line and add the required digit(s). For example, if you want to import request DEVK900132 into the quality assurance system and overwrite originals, enter the following command: tp import DEVK900132 QAS u2.

Caution

Use unconditional modes carefully. It is preferable to transport according to the rules of the Change and Transport System (CTS).

Some unconditional modes can be used directly in TMS.

Log in to track your progress & complete quizzes