Professional Documents
Culture Documents
Data Interfaces - Chapter 01 - V1
Data Interfaces - Chapter 01 - V1
Background Processing
Phases of Background Processing Passing Data to Subsequent Job Steps Scheduling Job within ABAP Program
Slide 1
Work Processes
Dispatcher
Dialog
Update
Enqueue
Spool
Background
Slide 2
Background
Job Scheduling
Job Processing
Job Overview
Slide 4
Transaction SM36
Job Scheduling
Start date
General data Job name Job class Status Target host
Steps
<job name>
A
Scheduled <target system for processing>
Slide 5
Steps
Job Scheduling
ABAP
External program
Start date
Immediate
Date/Time
After Job
After Event
Jobs can be scheduled to run after an event has been triggered/raised.
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.
Slide 7 Data Interfaces | 2.01 | August 2003
Copyright IBM Corporation 2003
Start date
Period values
Periodic job
Hourly
Daily
By checking the Periodic Job option, you can specify that the job run at regular intervals.
Weekly
With the Period Values pushbutton, you can schedule the job to run hourly, daily, weekly, monthly, etc.
Monthly
Other period
Copyright IBM Corporation 2003
Slide 8
Start date
After Job
X Start status-depend.
After clicking on the After Job pushbutton, you must specify the name of the job that must be completed before this job will run.
If you check the Start status-depend. option, this job will run only if the specified job ends successfully.
Slide 9 Data Interfaces | 2.01 | August 2003
Copyright IBM Corporation 2003
Start date
After Event
Event Parameter
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.
X Periodic job
Slide 10 Data Interfaces | 2.01 | August 2003
If you check the Periodic Job option, the system starts a new job each time the specified event is raised.
Copyright IBM Corporation 2003
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 The only required EVENTID_DOES_NOT_EXIST = 2 exporting parameter is the EVENTID_MISSING =3 name of the event to raise. RAISE_FAILED =4 OTHERS = 5.
Slide 11
Job Scheduling
Job Processing
Job Overview
Slide 12
Scheduler
Job
Dispatcher
Job
Slide 13
Slide 14
Job Log
Scheduler
Entries from start and end modules. All messages issued by job steps and system.
Start Module Job Step #1 Job Step #2 Job Step #3 End Module
Slide 15 Data Interfaces | 2.01 | August 2003
PRINT SPOOL
Job Processing
List
All WRITE statement output from job step.
Job Scheduling
Job Processing
Job Overview
Slide 16
Job Overview
Transaction SM37
Job Status
Job Overview
Slide 17
Job Overview
You can use this Job Log to analyze each step of a finished or cancelled background job.
Slide 18 Data Interfaces | 2.01 | August 2003
Copyright IBM Corporation 2003
Slide 19
JOB_OPEN
Slide 21
JOB_SUBMIT
JOB_SUBMIT Exporting: authcknam = <user> jobcount = <job #> jobname = <job name> report = <report> variant = <variant> Exporting: authcknam = <user> jobcount = <job #> jobname = <job name> report = <report> variant = <variant>
Slide 22 Data Interfaces | 2.01 | August 2003
Background Job
<job name>
<job #> Step #1
Step #2
JOB_CLOSE
JOB_CLOSE Exporting: jobcount = <job #> jobname = <job name> sdlstrtdt = <start date> sdlstrttm = <start time> strtimmed = <flag1> Importing: job_was_released = <flag2>
Step #2
Slide 23
Close Job
REPORT Y180DM01. 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.
Slide 24
Background Job
DBTABLE
id1
data1
Step #2
...
INDX
MANDT RELID SRTFD
...
...
CLUSTR
SP ST ST TM
254 53 73 97
Step #2
TABLES: INDX. DATA: var1(9) TYPE p DECIMALS 2.
...
Area Client
INDX
SRTF2
Cluster Length
CLUSTR CLUSTD
Cluster Data
...
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
Slide 27 Data Interfaces | 2.01 | August 2003
Copyright IBM Corporation 2003
Job Scheduling
Job Processing
Job Overview
Job Log
Background
Slide 28