Archive for the ‘BASIS’ Category:
SAP Event Processing
An SAP event is a “flag” that is created by using transaction SM62 View and Maintain Background Events. The commonest use of Events is to trigger jobs. Events can be triggered from the Operating System or from within SAP – either within ABAP programs and Function modules or from Transaction SM64.
Create an Event in transaction SM62. Select the Maintain radio button next to User Event Names and execute. This will present tyou with the Edit User Events screen. You can add change or delete user events from here.
To use this Event as a trigger, create a job via transaction SM36. You specify the Event that will trigger this job using the Start Condition button. On the Start Condition screen, select option AFTER EVENT. The After Event fields will open for input. Fill these in and Save.

You can see which jobs are waiting for events by looking at table BTCEVTJOB (via transaction SE16). This is the system’s way of keeping track of which jobs are in the queue waiting for an event to occur. The EVENTID column contains those Events that will submit a Job. You should see several System Events here.
Now, once the event is triggered this newly created job will execute. The event can be triggered via transaction SM64 or from the Operating System (see below).
To get the event triggered from the Operating System, log into the <sid>adm user id (at the Operating System level) level and go to directory /usr/sap/<sid>/SYS/exe/run. Note that in the Unix / Linux implementations, there is an alias ‘cdexe’ that will get you there as well. Run the SAPEVT executable as follows :
sapevt <event_name> -t pf=<instance_profile_directory_and_name> nr=<sys_number>
Example:
sapevt roberts_test -t pf=/usr/sap/DEV/SYS/profile/DEV_DVEBMGS00_server001 nr=00
This will raise the event, and cause the job scheduled within SAP to execute. Once the job has executed the SAP event that was in the table BTCEVTJOB will disappear.
Every time a Background Job is run, an entry is created in table TBTCO. This contains entries such as JOBNAME, EVENTID, EVENTPARM, JOBCLASS etc. This means that once you’ve found your job name in this table (using SE16) you can double click on its entry and see that it was executed via an event.
Operating System TP / TMS / CTS unconditional modes
The TMS / CTS functions are a front end to the TP commands at the operating system level. If you use the operating system commands, you face the challenge of replicating the options available via the SAP GUI front end. These options are controlled by using the Unconditional mode. An example of how to use these is shown below.
host:prdadm 2> tp import L6BK162625 PA1 U client=100
This is tp version 340.16.38 (release 640)
This is R3trans version 6.13 (release 640 – 07.01.08 – 14:25:00).
2EETW000 T5QTM table class is ‘C’. Entries are only imported to client ’000′.
2EETW000 T5QTX table class is ‘C’. Entries are only imported to client ’000′.
R3trans finished (0008).
tp finished with return code: 8
meaning:
A tool used by tp produced errors
host:prdadm 3> tp addtobuffer L6BK162625 PA1
This is tp version 340.16.38 (release 640)
Addtobuffer successful for L6BK162625
tp finished with return code: 0
meaning:
Everything OK
host:prdadm 4> tp import L6BK162625 PA1 U128 client=100
This is tp version 340.16.38 (release 640)
This is R3trans version 6.13 (release 640 – 07.01.08 – 14:25:00).
R3trans finished (0000).
tp finished with return code: 0
meaning:
Everything OK
host:prdadm 5>
The U stands for unconditional force, similar to the options that you can select when importing via the SAP GUI.
0: Overtaker – change requests can be imported without deleting it from the buffer. Usually, this is followed sooner or later by an import using unconditional mode 1 to import another transport in the correct sequence.
1: Import the transport again.
2: Allow transport to overwrite SAP or System originals.
3: Allow transport to overwrite system-dependant objects.
5: Allow transport to contain source systems other than the integration system (usually used only when importing into Development or Consolidation system).
6: Allow transport to overwrite objects in unconfirmed repairs.
8: Allow transport to ignore limitations caused by the table classification (see the example above).
9: Allow transport to ignore that the system is locked for this kind of transport.
Remember that the location to run the tp addtobuffer and / or tp import from is operating system dependent:
(Windows): \\$(SAPTRANSHOST)\sapmnt\trans\bin
(UNIX): /usr/sap/trans/bin
Generate SAP Installation Key
For any SAP install except the Trial Editions available from SDN (and Solution Manager itself), you need to obtain a Installation/Upgrade Key (sometimes known as the ‘magic number’) from a Solution Manager system. Usually, you should get this from the Solution Manager system that will be used for managing changes, software diagnostics etc for you installation. However, note that you do not have to use any particular Solution Manager system, to get the the installation up and running.
Procedure
On the SAP Solution Manager System :
1. Call the System Landscape Maintenance (transaction SMSY) in your Solution Manager system.
2. Create your SAP System in the system landschape:
a. Select the landscape component Systems, and choose Create New System, in the context menu.
b. Enter the system ID as the system, in the following dialog box.
c. Choose the product (i.e. SAP ECC), and the product version (i.e. SAP ECC 5.0 or higher), from the possible entries help, and Save.
d. Complete the system data, as far as possible.
e. Save your entries.
3. Generate the key:
a. Choose System Landscape ® Other Object….
b. Set the System flag, and choose the system which is to be installed or upgraded, from the possible entries help. If you have created a system in the SAP Solution Manager, in the previous step, choose it.
c. Choose Generate Installation/Upgrade Key.
d. Enter the required data and choose Generate Key.
The system displays the key.
Installation/upgrade tool
Specify this key in the installation or upgrade tool when requested. This is (usually) the last step of the ‘Check Parameters phase’, immediately prior to the start of the ‘Execute Service’ phase.
UPDATE: Please do not request that I supply Installation keys.
They are available from sap.com/solutions/netweaver/minisap.asp (for the trial and developer editions) and service.sap.com/LICENSEKEY.

