You are on page 1of 22

0

SAP AG 1999
Scheduling jobs
Using the job overview
Using parallel BI processing through RSBDCSUB
Background Processing
Contents:
SAP AG BC420 14-1

0!
SAP AG 1999
Course "verview Diagra#
Daten$bernah#e
D% &orkbench
'S( &orkbench
Principles o) Standard
Data *ans)er
D
i
r
e
c
t

I
n
p
u
t
B+PI
*
+

R
e
c
o
r
d
e
r
Course "verview
B
a
t
c
h

I
n
p
u
t
C
a
l
l

*
r
a
n
s
a
c
t
i
o
n
,
-DI
Basics
.
/
0
1 20
6
20
3
22
2,
2!
22
2!
2
!
2020
22
SAP AG BC420 14-2

0,
SAP AG 1999
Background Processing 4 Contents 526
Basics o) Background Processing
Basics o) Background Processing
Per)or#ance and Scheduling BI Sessions
Per)or#ance and Scheduling BI Sessions
SAP AG BC420 14-3

00
SAP AG 1999
7ob
Scheduled
5*i#e 8 Date6
-9ecuted on
background server
Dispatcher
B B
Step 2
Step n
Step 1
. . .
Program 1
Program 2
Program 3
Concept o) Background Processing
R/3 background processing is used to automate routine tasks and optimize the use of the R/3
resources within a company. You or your users schedule programs to be run by the R/3 System and
specify which programs to execute and when.
The R/3 System proides comprehensie support for background processing including a number of
methods for scheduling and maintaining !obs. You can execute both internal R/3 and external
programs. To simplify scheduling" you can execute related internal and external !obs as #!ob steps$
within one background processing !ob. %sing !ob steps" you can define a complex background !ob
that includes seeral processing steps. &ob scheduling includes all process actiities re'uired to
execute the task.
(n addition" there are arious !ob administration and diagnostic tools" including a graphical monitor.
There is a powerful" easy)to)use programming interface you can use to program your own
applications for background processing" if needed* you can use the !ob wizard to schedule your !obs.
The wizard automates the basic definition of the background processing !ob and guides new users
through the entire process.
SAP AG BC420 14-4

0.
SAP AG 1999
Create progra# variant
De)ine job na#e and priorit:
Create step list 5enter progra#s6
De)ine job start ti#e
Displa: job logs
7ob runs
Step 2
Step !
Step 2
Step !
Step 2
Step !
Background Processing Steps
To create a background processing !ob" proceed as follows+
,- (f the program to be scheduled contains a selection screen" create a ariant.
.- (n the !ob definition" you must specify the !ob name and priority.
/ptional+ Target serer
3- The step list contains all programs to be se'uentially processed within a !ob.
0- You must set the start time for the !ob.
1- 2hen the start time is reached" the !ob is processed in a free background work process.
3- You can then display the !ob logs.
SAP AG BC420 14-5

0;
SAP AG 1999
BC0!0<7"B 7ob na#e
C 7ob class
scheduled Status
*arget server
Start conditions Steps
Define job name and class
1
Choose Steps to create the subtasks )or the job
2
o!" BC420#$B
Step list is empty.
...
Job Definition *ransaction 5S(,;6
Creating a 7ob 526
(n the !ob definition" you specify a !ob name and !ob class 4 5 6 highest" to 7 6 lowest priority -.
To ensure automatic workload balancing" leae the Target server field empty. The system then
executes the !ob on a serer with free background work processes.
%nder Steps you define the indiidual !ob steps 4indiidual programs within the !ob-.
%nder Start conditions" you specify the start date and time.
SAP AG BC420 14-%

0/
SAP AG 1999
BI<PR"=>+(- >a#e
?ariant
D& 'anguage
+B+P Progra#
Each step should consist of one ABAP program

&'ternal Co((and &'ternal Pro)ra(


+B+P Progra#
Step 2
o!" BC420#$B
Sa!e
A step has been added to
the step list. "o#e!er$ the
job has not been sa!ed. Do
not e%it the transaction.
&f the ABAP program
contains a selection
screen$ you must first
create a !ariant.
Creating a 7ob 5!6
5 step can be an internal 5859 program. (f the program contains a selection screen" you must create
a ariant" which is a saed set of selection screen alues for this program.
SAP AG BC420 14-*

01
SAP AG 1999
After you create and sa!e the steps$ the step list appears.
'
+o,
*o add additional steps@ choose (reateA to leave the step list@ choose Bac)
* +, &nitial screen-.
Pro)ra( na(e ,,, &'t, pr) -ist Para(eters
BC0!0<7"B 2
Start condition Steps
*o schedule the job start date and ti#e@ go to Start condition.
.
...
Step 2
o!" BC420#$B
Creating a 7ob 5,6
5fter you sae the steps" the step list appears. To add additional steps" choose Create.
5fter you define and Save the step list and go Back to the initial screen" you can specify the start date
and time for the !ob.
SAP AG BC420 14-.

03
SAP AG 1999
Scheduled start
Do not start a/ter
0((ed,
/ou ha!e se!eral options for job start date and time.
0
Date 1 2i(e A/ter 3o!
Date 8 *i#e
Sa!e
7ob is now scheduled I#portant: Choose Sa!e
on the initial screen o) transaction S(,;
A/ter e4ent , , ,
Date
Date
2i(e
2i(e 2*,0.,1999 23"0%
Step 2
7ob: BC0!0<7"B
Creating a 7ob 506
/ne scheduling method is to specify a date and time.
:ot only can you specify a start date and time" you can also specify an #expiration date$.
(f the !ob has not been processed by this date and time 4because there is no free background work
process-" it will neer be processed. The !ob status is then set to Canceled.
You can also specify a Periodic start time.
SAP AG BC420 14-9

020
SAP AG 1999
BC0!0B 7ob na#e
Job o!er!ie# transaction 5S(,/6
B User na#e
Sched, 5eleased
5ead6 Acti4e 7inished
Canceled
2*,0.,1999 to 7ro(
23"24
23"5%
2*,0.,1999
or start a/ter e4ent
B
7ob start conditions
7ob status
Step 2
7ob: BC0!0<7"B
7ob "verview 526
You can use the !ob oeriew to select and display !obs according to specific criteria.
;or example" you could choose to display all !obs that hae status Ready" but that hae not yet
started..
(f you want to display scheduled !obs that depend on an eent" you must enter at least #<$ in the
Start after event field.
SAP AG BC420 14-10

022
SAP AG 1999
+)ter speci):ing the selection para#eters@ the selected jobs appear
7ob na#e Created b: Status Start date
BC0!0<7"B (I''-R Cinished !/012333 .:,0:!, 2!
Start ti#e DurationDsecE
BC0!0<7"B2 &">= Cinished !/012333 ;:!,:00 2
BC0!0<7"B, F-''-R Cinished !/012333 ;:!,:,0 ,
BC0!0<012. (-G-RS Scheduled

Scheduled1 Job is
defined but no
start time has been
specified.
Job finished
o! -o) 5eleased Spool Step

o! o4er4ie8 /or" 2*,0.,1999 ,,,


7ob "verview 5!6
;rom the !ob oeriew" you can go to the Spool transaction to display the list output of the indiidual
!ob steps.
To iew the !ob logs" choose Job log.
&ob status+
Scheduled+ &ob is defined but no start time has been specified.
Released+ Start time has been specified
Ready+ =xecution time has been reached" !ob ready for execution
5ctie+ &ob running" see transaction S>1?
;inished+ &ob completed without errors
7anceled+ &ob ended* =rrors occurred.
SAP AG BC420 14-11

02!
SAP AG 1999
Background Processing 4 Contents 5!6
Basics o) Background Processing
Basics o) Background Processing
Per)or#ance and Scheduling BI Sessions
Per)or#ance and Scheduling BI Sessions
SAP AG BC420 14-12

02,
SAP AG 1999
SeHuential
Cile
2enerate se!eral sessions
Dispatcher
B B
Dispatcher
B B
Dispatcher
B
Schedule RSBDCSUB
Process B& sessions in se!eral bac)ground 3Ps in parallel.
BI Progra#
Parallel Processing with RSBDCSUB
You can process 8( sessions in parallel in the background using the program RS8@7S%8. (f seeral
8( sessions were generated from the external data" RS8@7S%8 schedules a separate !ob for each 8(
session.
/n the selection screen of RS8@7S%8" you specify the names of the 8( sessions you want to
process 4generic entry possible+ Abc0.?<A-.
SAP AG BC420 14-13

SAP AG 1999
+B+P Develop#ent
+B+P Develop#ent
Save
Save
Progra# RSBDCSUB
Create background job
with S*-P: RSBDCSUB
Create background job
with S*-P: RSBDCSUB
Session na#e
Created on
)ro#<<<< to
Session status
*o be processed
&ith errors
-9ecute
?ariant
-dit 9
26 *est RSBDCSUB to
understand
its )unctions
!6 Create variant o)
RSBDCSUB
,6 Create job with two
steps to schedule
the BI progra# and
RSBDCSUB
Batch Input Scheduling with RSBDCSUB
%sing program RS8@7S%8" you can schedule session processing in the background.
9roceed as follows+
,- Test RS8@7S%8 to learn about the input parameters on the selection screen and the programBs
functions.
.- 7reate a ariant of RS8@7S%8 using the following selection criteria+
) Session name 4generic entries also possible" such as Abc0.?<A-
) 7reated on
) Session status
) (tBs a good idea to leae the Target server field empty 4for automatic load balancing-.
) =xtended log
3- 7reate a background !ob for program RS8@7S%8 using the ariant you created.
SAP AG BC420 14-14

020
SAP AG 1999
Job #ith t#o steps
Step !: RSBDCSUB
Step 2: BI Progra#
&n the first step$ the se4uential data is
read and then B& sessions are
generated from this data.
&n the second step$ the B& sessions are
scheduled by the 5SBD(S6B to run
in parallel and then processed by
the bac)ground #or) processes.
7obs
The external data conersion and import of the data into the R/3 System can be automatically
scheduled through background processing.
This re'uires two program steps+
,- (n Step ," the 8( program is called that reads the external data and conerts the data. 8( sessions
are then created.
.- (n steps ." RS8@7S%8 is called and transfers the generated 8( sessions to background
processing.
SAP AG BC420 14-15

02.
SAP AG 1999
5SBD(S6B creates a job for each B& session #ith the job name identical to
the B& session name.
o! -o)

7he job log contains the results of the


B& runs.
7ob na#e Created b: Status Start date
BC0!0<(+P2 (-G-RS Cinished !/012333 ;:!!:23 02
Start ti#e DurationDsecE
BC0!0<(+P! (-G-RS Cinished !/012333 ;:!,:00 ,0
BC0!0<(+P, (-G-RS Cinished !/012333 ;:!,:,0 !!
BC0!0<(+P0 (-G-RS Cinished !/012333 ;:!,:.; !,
RSBDCSUB 7obs
The !ob oeriew contains the results of the indiidual !ob runs 4one !ob per session-.
The results of the session processing can also be iewed in the 8( monitor.
SAP AG BC420 14-1%

02;
SAP AG 1999
+pplication
Presentation
Database
READ DATASET
TRANSFER
'ocal seHuential
)iles
SeHuential
)iles
Crontend +ccess in Background
Dispatcher

B
The A@/2:C/5@A and A%9C/5@A function modules are designed for online operation and
cannot be executed in the background.
SAP AG BC420 14-1*

02/
SAP AG 1999
Schedule and ad#inister jobs
Use RSBDCSUB to schedule batch input sessions
in the background
Gou are now able to:
Background Processing: Unit Su##ar:
SAP AG BC420 14-1.

Exercises
Unit: Background Processing
Topic: Scheduling of Batch Input in the Background
Scheduling of batch input sessions in the background.
9arallel processing of the processing
The transfer of the legacy data should be automated. This is done by
scheduling a specific 5859 program 4RS8@7S%8- ia the R/3
background processing. There are different possibilities for performing
the scheduling.
Job: BC!"#$$#Job
, Optional: Start a !ob consisting of one step using @ate/Time.
,), @efine a ariant for the program S59870.?DS9T@DC(STD7E=7F8/G=S.
,). 7reate the !ob 870.?&/8HH),. Start this !ob using @ate/Time. You can enter
AStart nowA or the system time I 3 minutes. The only step the !ob should contain
is the 5859 report.
,)3 ;ollow the flow of the !ob in the S>3J and analyze the !ob log.
SAP AG BC420 14-19

. @efine and schedule a !ob to generate and run batch input sessions. @efine one !ob
#870.?DHHD&ob$ that performs the follwing tasks in two steps+
a- Run a program to generate one or more batch input sessions. 8efore you start"
generate a ariant for the scheduled batch input program.
b- 7all the RS8@7S%8 to schedule the batch input session that has been created in the
preious step. You must also first create a ariant for RS8@7S%8.
Steps+
.), 7reate the ariant K5RDHH for the program R;8(8C??. >aintain the
) ;ile name 6 ...... 4;ile name see outbound file respectiely conerted data in
the CS>2 ob!ect 7T)HH-.
) Type of data transfer is batch input
.). 7reate a ariant for the RS8@7S%8. This ariant should process the batch input
sessions 7T)HH. 4This session name is from the CS>2 outbound file and
corresponds to the ob!ect name-.
.)3 Schedule a !ob consisting of two steps+ The first step contains your batch input
program R;8(8C??" the second step contains RS8@7S%8. The ariants you
defined before are necessary for both steps.
.)0 (n order to run 8( sessions" follow the flow of the !ob and check the !ob log for
each !ob that has been created by the RS8@7S%8.
3 Optional+ Lenerating seeral 8( sessions by changing an CS>2 setting and scheduling
the CS>2 main program.
3), @isplay all ob!ects for your pro!ect. Select the ob!ect 7T)HH and copy it to the
new ob!ect 8()HH.
3). >ake the following changes in the =:@D/;DR=7/R@ of structure 8LR??. The
field g_cnt_transactions_group determines the number of records
according to which the next 8( session is generated. 7hange this alue to ..
at_first_transfer_record.
if g_cnt_transactions_group = 2.
g_cnt_transactions_group = 0.
transfer_record.
endif.
3)3 (n the ob!ect attributes set the data transfer to periodic.
Then you get the main program /SAP!C/SAP"#S!$"%&T'R(AC') which will
perform the steps of the CS>2 automatically.
SAP AG BC420 14-20

3)0 7reate the ariant Kar)HH for this main program.
Settings+
9ro!ect+ 870.?)HH
Sub)pro!ect+ @/7%)HH
/b!ect+ 8()HH
Set the parameters of some batch input/direct input programs
#8(" @(" 7all Transaction$ to #8$.
3)1 Schedule a !ob that consists of one step and that contains the main program with
the ariant K5R)HH. Start the !ob.
3)3 ;ollow the the !ob flow and check the !ob log.
SAP AG BC420 14-21

Solutions
Unit: Background Processing
Solution to %&!
3 /ptional+ 7reate seeral 8( sessions by changing an CS>2 setting and scheduling the
CS>2 main program.
3). Lo to =xtras )M @isplay ariant and set the ATechnical fieldA and A9rocessing
eentsA checkboxes to change a technical CS>2 field mapping setting. A7odingA
and ALlobal data definitionsA should also be selected.
The processing eent A=:@ /; R=7/R@A is below the structure 8LR?? and
determines how many transactions a new 8( session processes with a counter.
7hange the test Aif g_cnt_transactions_group = 5000" to Aif
g_cnt_transactions_group = 3" to create a new 8( session after
reading three records.
SAP AG BC420 14-22

You might also like