data interfaces - chapter 01_v1
TRANSCRIPT
-
7/30/2019 Data Interfaces - Chapter 01_V1
1/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 1
Background Processing
Phases of Background Processing
Passing Data to Subsequent Job Steps
Scheduling Job within ABAP Program
-
7/30/2019 Data Interfaces - Chapter 01_V1
2/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 2
Dispatcher
Work Processes
EnqueueUpdate SpoolDialogBackground
-
7/30/2019 Data Interfaces - Chapter 01_V1
3/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 3
The Background Work Process
Background
Defining a
background job.
Background Job A
Step #1
Step #2
-
7/30/2019 Data Interfaces - Chapter 01_V1
4/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 4
Phases of Background Processing
Job
Scheduling
Job
Processing
Job
Overview
-
7/30/2019 Data Interfaces - Chapter 01_V1
5/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 5
Scheduling a Background Job
Job
Scheduling
General data
Job name
Job class
Status
Target host
A
Scheduled
Start date Steps
Transaction
SM36
-
7/30/2019 Data Interfaces - Chapter 01_V1
6/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 6
Creating Step for Background Job
Job
SchedulingSteps
ABAP External program
ABAP program
Name
Variant
Language E
-
7/30/2019 Data Interfaces - Chapter 01_V1
7/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 7
Start Criteria for Background Job
Jobs can be scheduled to
run immediately or at a
particular date/time.
Jobs can be
scheduled to run
after another job hasbeen completed.
Jobs can be
scheduled to run after
an event has beentriggered/raised.
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.
Job
SchedulingStart date
Immediate After EventAfter JobDate/Time
-
7/30/2019 Data Interfaces - Chapter 01_V1
8/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 8
Scheduling a Periodic Job
Job
Scheduling
With the Period
Values pushbutton,
you can schedule
the job to run hourly,
daily, weekly,monthly, etc.
By checking thePeriodic Job option,
you can specify
that the job run at
regular intervals.
Periodic jobX
Start date
Monthly
Weekly
Daily
Other period
Hourly
Period values
-
7/30/2019 Data Interfaces - Chapter 01_V1
9/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 9
Scheduling Job After Another Job
If you check the Start status-depend.
option, this job will run only if the
specified job ends successfully.
After Job
Start status-depend.
X
Name
After clicking on theAfter Job pushbutton,
you must specify the
name of the job that must
be completed before this
job will run.
Start date
Job
Scheduling
-
7/30/2019 Data Interfaces - Chapter 01_V1
10/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 10
Periodic jobX
Event
Parameter
Scheduling Job After an Event
Job
SchedulingAfter Event
If you check the Periodic Job option, the
system starts a new job each time the
specified event is raised.
Start date
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.
-
7/30/2019 Data Interfaces - Chapter 01_V1
11/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 11
Triggering/Raising Events
CALL FUNCTION BP_EVENT_RAISEEXPORTING
EVENTID =
EVENTPARM =
TARGET_INSTANCE =
EXCEPTIONS
BAD_EVENTID = 1EVENTID_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.
To trigger/raise an event from within an ABAP program, you must
call the BP_EVENT_RAISE function module.
-
7/30/2019 Data Interfaces - Chapter 01_V1
12/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 12
Phases of Background Processing
Job
Scheduling
Job
Processing
Job
Overview
-
7/30/2019 Data Interfaces - Chapter 01_V1
13/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 13
Processing a Background Job
Background
Dispatcher
Job
Processing
JobScheduler
Job
-
7/30/2019 Data Interfaces - Chapter 01_V1
14/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 14
Processing a Background Job
Transaction
SM50
Job
Processing
Application Server
Work Processes
1 Spool8 Online 3 Background
-
7/30/2019 Data Interfaces - Chapter 01_V1
15/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 15
Processing a Background Job
Scheduler
Start Module
End Module
Job Step #1Job Step #2
Job Step #3
Job Log
Entries from start and end
modules.
All messages issued by
job steps and system.
JobProcessing
ListAll WRITE
statement output
from job step.
PRINT SPOOL
-
7/30/2019 Data Interfaces - Chapter 01_V1
16/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 16
Phases of Background Processing
Job
Scheduling
Job
Processing
Job
Overview
-
7/30/2019 Data Interfaces - Chapter 01_V1
17/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 17
Transaction
SM37
Job
Overview
Job Status
Job Overview
-
7/30/2019 Data Interfaces - Chapter 01_V1
18/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 18
Job Analysis Using Job Log
Job
Overview
System and
Program
Messages
You can use this Job Log to analyze each step of a
finished or cancelled background job.
-
7/30/2019 Data Interfaces - Chapter 01_V1
19/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 19
Other Background
Processing Topics
Passing Data to Subsequent Job Steps
Scheduling Job within ABAP Program
-
7/30/2019 Data Interfaces - Chapter 01_V1
20/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 20
Scheduling Job within
ABAP Program
Open Background Job
JOB_OPEN
Insert Job Step
JOB_SUBMIT
Close Background Job
JOB_CLOSE
JOB_SUBMIT
is called for
each step that
is to be added
to the job.
-
7/30/2019 Data Interfaces - Chapter 01_V1
21/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 21
JOB_OPEN
JOB_OPEN Background Job
Exporting:
jobname =
Importing:
jobcount =
G S
-
7/30/2019 Data Interfaces - Chapter 01_V1
22/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 22
JOB_SUBMIT
JOB_SUBMIT
Background JobExporting:
authcknam =
jobcount =
jobname =
report =
variant =
Step #1
Step #2
Exporting:
authcknam = jobcount =
jobname =
report =
variant =
IBM Gl b l S i
-
7/30/2019 Data Interfaces - Chapter 01_V1
23/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 23
JOB_CLOSE
JOB_CLOSE Background Job
Exporting:
jobcount =
jobname =
sdlstrtdt =
sdlstrttm =
strtimmed =
Importing:
job_was_released =
Step #1
Step #2
IBM Gl b l S i
-
7/30/2019 Data Interfaces - Chapter 01_V1
24/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 24
ABAP Program Example
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
JOBCOUNT = JOBNUM
JOBNAME = JOBNAMEREPORT = PROGRAM
VARIANT = VARIANT.
CALL FUNCTION JOB_CLOSE
EXPORTING JOBCOUNT = JOBNUM
JOBNAME = JOBNAME.
Open Job
Submit Step
Close Job
SY-SUBRC
CHECK
IBM Gl b l S i
-
7/30/2019 Data Interfaces - Chapter 01_V1
25/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 25
Passing Data to Subsequent
Job StepsBackground Job
Step #1. . .
EXPORT TO DATABASE ID
.
. . .
EXPORT TO DATASET ID
.. . .
Step #2. . .
IMPORT FROM DATABASEID .
. . .
IMPORT FROM DATASET
ID .
DBTABLE
id1 data1
.
.
FILENAME
id2 data2
IBM Global Ser ices
-
7/30/2019 Data Interfaces - Chapter 01_V1
26/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 26
Background Job
Step #1TABLES: INDX.
DATA: var1(9) TYPE p
DECIMALS 2.
. . .
EXPORT var1 TO DATABASE
indx(st) ID 12345
Step #2TABLES: INDX.
DATA: var1(9) TYPE p
DECIMALS 2.. . .
IMPORT var1 FROM
DATABASE indx(st) ID
12345.
INDX
MANDT RELID SRTFD CLUSTR
800
800
800800
SP
ST
ST
TM
... CLUSTD
SPH_I
12345
ABCL
KVERM
254
53
7397
FF05010102
FF05016876
FF05075372
FF03578902
Using the Database to Pass Data between Job Steps
IBM Global Services
-
7/30/2019 Data Interfaces - Chapter 01_V1
27/28
IBM Global Services
Copyright IBM Corporation 2003Data Interfaces | 2.01 | August 2003Slide 27
INDX
MANDT RELID SRTFD CLUSTR
800
800
800
800
SP
ST
ST
TM
... CLUSTDSPH_I
12345
ABCL
KVERM
254
53
73
97
FF0501010254787
FF0501687618710
FF0507110005472
FF0357890541472
Client
Area
Key Fieldsto UniquelyIdentify theData Cluster
ClusterData
ClusterLength
Fields to store information pertaining tocluster data, not automatically updated byexport, need to be explicitly set before the
export statement
Structure of the Data Cluster Table
SRTF2
0
0
0
0
IBM Global Services
-
7/30/2019 Data Interfaces - Chapter 01_V1
28/28
IBM Global Services
Step #1
Step #2
Background
Job Log
Spool List
Job
Scheduling
Job
Processing
Job
Overview
Summary of Background Processing