Вы находитесь на странице: 1из 10

7/17/2015 BackgroundJobProcessing

BackgroundJobProcessing

WhatisabackgroundJob?

UnlikeForegroundjobs,Backgroundjobsarenoninteractiveprocessesthatrunbehindthe
normalinteractiveoperations.Theyruninparallelanddonotdisturbinteractive(foreground)
processesandoperations.

ItisscheduledfromSM36.YoucananalyzeitfromSM37byviewingitsjoblog.

AdvantagesofBackgroundJobs

Itreducesmanualeffort&automatesthetask.
Itcanbescheduledasperuser'schoice.
Itreducesuserinteractionandcanrunseamlesslyinthebackgroundwithoutuserinput
Onceyoudefinethevariantforbackgroundjob,theuserdoesn'thavetoworryaboutvalue
inputinthefield.Thus,userconfusionisalsoreduced.
Idealfortimeconsuming/resourceintensiveprogramswhichcanbescheduledtorunin
thenight(whensystemloadislow).

Backgroundjobsareclassifiedinthreecategories

1. ClassA(High/criticalPriority):Sometasksareurgentorcriticalandmustbescheduled
withclassApriorityjob.ClassApriorityreservesoneormorebackgroundwork
processes.Usershavetodecidehowmanybackgroundworkprocessesshouldbeassignedto
ClassApriorityjob.Supposeauserchooses2backgroundworkprocessesforthiscategory
thenavailablebackgroundworkprocessesforclassBandC=(Totalnumberofwork
processessetinoperationmodesRZ03)(BackgroundworkprocessesallowedtoclassA
category).
2. ClassB(MediumPriority):OnceClassAjobsarecompleted,ClassBjobwillstart
executinginthebackgroundbeforeclassCjobs.
3. ClassC(LowPriority):ItrunsafterbothclassAandclassBjobsarecompleted.

Possiblestatusofbackgroundjobs

1. Scheduled:Youhavedefinedtheprogramnameandvariantbutnotdefinedstartcondition
likeStartDate,EndDate,Frequencyetc.Thatmeansyouhavenotdefinedwhenjobshould
data:text/htmlcharset=utf8,%3Ch2%20itemprop%3D%22name%22%20style%3D%22margin%3A%2010px%200px%3B%20fontfamily%3A%20'Droid 1/10
7/17/2015 BackgroundJobProcessing

bescheduledinsystem.
2. Released:Allrequiredcriteriaarefulfilledforjobdefinition.Startconditionismustforthe
jobtobeinreleasestatus.
3. Ready:Alltherequiredconditionsaremettorunthejobinabackgroundworkprocess.But
jobschedulerhasputthejobinthequeuebecauseitiswaitingforbackgroundworkprocess
tobefree.
4. Active:Jobhasstartedrunninginthebackground.Wecannotchangethestatusofthejob
onceitisinActivestatus.
5. Finished:Jobisexecutedsuccessfully.Itmeansdesiredtaskiscompetedwithoutanyerror.
6. Cancelled:Therearetwopossibilitiesforthis.Administratorhasforcefullycancelledthe
jobortheremightbesomeissuewithjob.YoucaninvestigatethisfromJoblogs.

Howtoschedulethebackgroundjob?

YoucanschedulethebackgroundjobusingSM36.Plannedorimmediatejobscanbe
scheduled.

Step1)ExecuteTcodeSM36.

Step2)Fillthejobname,priority(A/B/C)andthetargetserver.Backgroundjobsonce
scheduledonatargetserverrunonthatserver.Mainpurposeofdefiningtargetserveristhe
workloadbalancing.

data:text/htmlcharset=utf8,%3Ch2%20itemprop%3D%22name%22%20style%3D%22margin%3A%2010px%200px%3B%20fontfamily%3A%20'Droid 2/10
7/17/2015 BackgroundJobProcessing

Step3)Clickon"spoollistrecipient".Youwillgetoutputinyourmailbox.Youcancheck
emailfromSBWP.

Step4)InsertyourSAPusernameandclickcopybutton.

Step5)ClickStepbuttontodefineABAPprogram,variant'sdetails,etc.

data:text/htmlcharset=utf8,%3Ch2%20itemprop%3D%22name%22%20style%3D%22margin%3A%2010px%200px%3B%20fontfamily%3A%20'Droid 3/10
7/17/2015 BackgroundJobProcessing

Step6)Defineprogramname,variantdetails.

1. Enteryourprogramname,Variantnameinthefield.Ifyouhavenotcreated
variantasperyourrequirement,thenleaveitblank.
2. Presssavebutton.

Step7)Onceyouschedulethejobyouwillgetthefollowingscreen.

data:text/htmlcharset=utf8,%3Ch2%20itemprop%3D%22name%22%20style%3D%22margin%3A%2010px%200px%3B%20fontfamily%3A%20'Droid 4/10
7/17/2015 BackgroundJobProcessing

Step8)ClickStartconditionstofillstartdate,enddate,frequency,etcforjob.Ifyoudonot
specifystartconditionthenjobwillalwaysremaininscheduledstatus.Ajobinscheduled
statuswillneverrun.

1. ClickonDate/Time(Forperiodicjobs).Ifyouclick"Immediate"thenjobwill
startrunningrightaway.Butitwillnotbesetasperiodicjob.It'slike"pressand
run".
2. Definejob'sstartdate/time,enddate/time.Thejobwillbereleasedonlyonceit
meetsitsScheduledstartdate/time.
3. Pressperiodicvalues.

Step9)ClickonHourly/Daily/Weeklyperiodtodefinethefrequencyofthejobasperyour
requirement.WewillselectOtherPeriod

data:text/htmlcharset=utf8,%3Ch2%20itemprop%3D%22name%22%20style%3D%22margin%3A%2010px%200px%3B%20fontfamily%3A%20'Droid 5/10
7/17/2015 BackgroundJobProcessing

Step10)Hereyouspecifytherecurringcriteriaofthejob.Forexample,YoucanhavetheJob
runafterevery5daysfromtheStartDate.Hereweselectjobtorunevery10minutes

Step11)Clickonsavebutton.

data:text/htmlcharset=utf8,%3Ch2%20itemprop%3D%22name%22%20style%3D%22margin%3A%2010px%200px%3B%20fontfamily%3A%20'Droid 6/10
7/17/2015 BackgroundJobProcessing

Step12)Clickonsaveagain.

Step13)Clicksaveagain

Step14)OnceJobstepandstartconditionsaredefinedthefollowingwindowwillappear.

data:text/htmlcharset=utf8,%3Ch2%20itemprop%3D%22name%22%20style%3D%22margin%3A%2010px%200px%3B%20fontfamily%3A%20'Droid 7/10
7/17/2015 BackgroundJobProcessing

Step15)Presssave.

Step16)GotoSM37toknowthestatusofthejob.

data:text/htmlcharset=utf8,%3Ch2%20itemprop%3D%22name%22%20style%3D%22margin%3A%2010px%200px%3B%20fontfamily%3A%20'Droid 8/10
7/17/2015 BackgroundJobProcessing

Step17)Selectyourcriteriaforthejobwhichyouwanttomonitor.

1. Putyourjobnameandusernamewhoscheduledthejob.
2. Selectthestatusofthejob.
3. Specifythedaterange.Inourscenariowejustspecifytheenddatewhile
keepingFromDateOpen.

data:text/htmlcharset=utf8,%3Ch2%20itemprop%3D%22name%22%20style%3D%22margin%3A%2010px%200px%3B%20fontfamily%3A%20'Droid 9/10
7/17/2015 BackgroundJobProcessing

Step18)Youwillgetthefollowingscreen.Lookatthestatus,it'sareleasedmeansstart
conditionsaremet,andthejobisinthequeueiswaitingforbackgroundworkprocesstobe
free.

data:text/htmlcharset=utf8,%3Ch2%20itemprop%3D%22name%22%20style%3D%22margin%3A%2010px%200px%3B%20fontfamily%3A%20'Droid 10/10

Вам также может понравиться