Professional Documents
Culture Documents
Background Processing
March-2005
Objectives
The participants will be able to:
Describe how the SAP system handles background processing.
Create variants for ABAP programs. Create, schedule, and analyze a job using transactions SM36 and SM37. Explain the purpose of background processing.
March-2005
Background Processing
Phases of Background Processing.
March-2005
Work Processes
Transaction SM50
Dispatcher
Background
Dialog
Update
Enqueue
Spool
March-2005
Background
March-2005
Job Scheduling
Job Processing
Job Overview
March-2005
Transaction SM36
Job Scheduling
March-2005
ABAP
External program
March-2005
Start Condition
Immediate
Date/Time
After Job
After Event
Jobs can be scheduled to run after another job has been completed.
If you start a job based on a date/time or an event, you can schedule the job to run at regular intervals, not just at a particular time.
9 Data Interfaces | 7.01 March-2005
Start date
Period values
Periodic job
By checking the Periodic Job option, you can specify that the job run at regular intervals.
With the Period Values pushbutton, you can schedule the job to run hourly, daily, weekly, monthly, etc.
10
March-2005
Start date
After Job
After clicking on the After Job pushbutton, you must specify the name of the job that must be completed before this job will run.
X Start status-depend.
If you check the Start status-depend. option, this job will run only if the specified job ends successfully.
11
March-2005
Start date
After Event
After clicking on the After Event pushbutton, you must specify the name of the event that must be raised before this job will run. You can distinguish between different occurrences of a particular event by specifying a parameter. If you check the Periodic Job option, the system starts a new job each time the specified event is raised.
12
March-2005
Triggering/Raising Events
To trigger/raise an event from within an ABAP program, you must call the BP_EVENT_RAISE function module.
CALL FUNCTION BP_EVENT_RAISE EXPORTING EVENTID = <event name> EVENTPARM = TARGET_INSTANCE = EXCEPTIONS BAD_EVENTID =1 EVENTID_DOES_NOT_EXIST =2 EVENTID_MISSING =3 RAISE_FAILED =4 OTHERS = 5.
The only required exporting parameter is the name of the event to raise.
13
March-2005
Job Scheduling
Job Processing
Job Overview
14
March-2005
Scheduler
Job
Dispatcher
Job Background
Job Processing
15
March-2005
Job Processing
Transaction SM50
1 Spool
3 Background
16
March-2005
Scheduler
Entries from start and end modules. All messages issued by job steps and system.
Start Module
PRINT SPOOL
Job Processing
End Module
17
March-2005
Job Scheduling
Job Processing
Job Overview
18
March-2005
Job Overview
Transaction SM37
Job Status
Job Overview
Spool List
19
March-2005
You can use this Job Log to analyze each step of a finished or cancelled background job.
20
March-2005
Display Report
21
March-2005
22
March-2005
JOB_OPEN
<job #>
24
March-2005
JOB_SUBMIT
JOB_SUBMIT
Exporting: authcknam = <user> jobcount = <job #> jobname = <job name> report = <report> variant = <variant>
<job #>
Exporting: authcknam = <user> jobcount = <job #> jobname = <job name> report = <report> variant = <variant>
Step #1
Step #2
25
March-2005
JOB_CLOSE
JOB_CLOSE
Background Job
<job name>
Exporting: jobcount = <job #> jobname = <job name> sdlstrtdt = <start date> sdlstrttm = <start time> strtimmed = <flag1>
<job #>
Step #2
26
March-2005
Close Job
REPORT YDI00001. DATA: JOBNUM LIKE TBTCJOB-JOBCOUNT. PARAMETERS: JOBNAME LIKE TBTCJOB-JOBNAME, PROGRAM LIKE SY-REPID, VARIANT LIKE RALDB-VARIANT, USER LIKE SY-UNAME. CALL FUNCTION JOB_OPEN EXPORTING JOBNAME = JOBNAME IMPORTING JOBCOUNT = JOBNUM. CALL FUNCTION JOB_SUBMIT EXPORTING AUTHCKNAM = USER CHECK JOBCOUNT = JOBNUM SY-SUBRC JOBNAME = JOBNAME REPORT = PROGRAM VARIANT = VARIANT. CALL FUNCTION JOB_CLOSE EXPORTING JOBCOUNT = JOBNUM JOBNAME = JOBNAME.
March-2005
27
DBTABLE
id1
data1
Step #2 ... IMPORT < obj1 objn> FROM DATABASE <dbtable>ID <id1>.
IMPORT < obj1 objn> FROM DATASET <filename> ID <id2>.
28
March-2005
DBTABLE
id1
data1
Step #2 ... IMPORT < obj1 objn> FROM DATABASE <dbtable>ID <id1>.
IMPORT < obj1 objn> FROM DATASET <filename> ID <id2>.
29
March-2005
INDX
MANDT RELID SRTFD
Job Step Background #1 TABLES: INDX. DATA: var1(9) TYPE p DECIMALS 2. ... EXPORT var1 TO DATABASE indx(st) ID 12345
CLUSTR CLUSTD
..
SP ST ST TM
254 53 73 97
Step #2 TABLES: INDX. DATA: var1(9) TYPE p DECIMALS 2. ... IMPORT var1 FROM DATABASE indx(st) ID 12345.
March-2005
30
INDX
MANDT RELID SRTFD
Job Step Background #1 TABLES: INDX. DATA: var1(9) TYPE p DECIMALS 2. ... EXPORT var1 TO DATABASE indx(st) ID 12345
CLUSTR CLUSTD
..
SP ST ST TM
254 53 73 97
Step #2 TABLES: INDX. DATA: var1(9) TYPE p DECIMALS 2. ... IMPORT var1 FROM DATABASE indx(st) ID 12345.
March-2005
31
Cluster Length
INDX
SRTF2
Cluster Data
CLUSTR CLUSTD FF0501010254787 FF0501687618710 FF0507110005472 FF0357890541472
...
SP ST ST TM
0 0 0 0
254 53 73 97
Fields to store information pertaining to cluster data, not automatically updated by export, need to be explicitly set before the export statement
32 Data Interfaces | 7.01 March-2005
Cluster Length
INDX
SRTF2
Cluster Data
CLUSTR CLUSTD FF0501010254787 FF0501687618710 FF0507110005472 FF0357890541472
...
SP ST ST TM
0 0 0 0
254 53 73 97
Fields to store information pertaining to cluster data, not automatically updated by export, need to be explicitly set before the export statement
33 Data Interfaces | 7.01 March-2005
Demonstration
Creation, scheduling and analyzing a background job using transactions SM36 and SM37.
34
March-2005
Practice
Creation, scheduling and analyzing a background job using transactions SM36 and SM37.
35
March-2005
Summary
Job Scheduling Job Processing Job Overview
Step #2
Background
36
March-2005
Questions
What are the various types of work processes present in the R/3 system ?
37
March-2005