By Rahul Tyagi
Objective: Scheduling a background job in SAP R/3. These document intents to provide steps which can be done even by an end user to prepare a Job.
Main Steps:
1. Change screen layout of stock report as per the requirement.
2. Create variant to run the stock report (MB52) via Job.
3. Access transaction code SM36 (Job creattion) to create the Job.
4. Monitor the Job and check the spool by SM37 (Job overview)
5. Access SAP Business Work place to check the Spool.
Step1: Create Screen layout
Assumption: Go to transaction MB52 and enter the value of the Plant (let’s say 1000).
Step 2: Create Variant along with the layout which we have created in previous step.
Press F4 on the layout field in initial screen and then press save.
After selecting the layout here please click on save.
Step 3: Please mention the variant name as per your choice and also mention the description.
You may also mark the check-box protect variant for the field plant and layout though it’s not mandatory.
Save
Step 4: Finding the program name for transaction code MB52
Now please notice the Program name RM07MLBS.
Step 5: Log in transaction code SM36.
Mention the Job name as ZDaliystk_MB52_1000.
Press enter to get the below screen
Click on the ABAP program and mention the program and also select the variant name which was created in initial steps.
Click on check and save
Step 6: Now click on the start condition button.
In this step we are giving the frequency of running the job. As already mentioned the Job needs to run daily basis.
click on the period values button and also mark the period check box as the job has to run every day.
Click on the spool recipient button
Just press enter and save to get the message that job is in release status
Monitor and check the output of job. Access transaction code SM37.
Also mention the Job name
execute and check the spool.
click on the type
Step 7: Here we are with the results which is list of stock in our case
- You can find the information relating to scheduling at these below tables.
E.g. In order to get the schedule period of a program, we can do as following:
TCPCP-PROGNAME to get the Jobname and Jobcount.
Then use the jobname, jobcount to get the schedule period in the table TBTCS.
Background Job Scheduling Tables:
TBTCS (Background Processing: Time Schedule Table):Field | Data Element | Data Type | length (Decimals) | Checktable | Description |
JOBNAME | BTCJOB | CHAR | 32 | Background job name | |
JOBCOUNT | BTCJOBCNT | CHAR | 8 | Job ID | |
BTCSYSTEM | BTCTGTSYS | CHAR | 32 | Target System to Run Background Job | |
JOBGROUP | BTCJOBGRP | CHAR | 12 | Summary of jobs for a group | |
INTREPORT | BTCREP | CHAR | 40 | Name of internal report for batch job | |
SDLSTRTDT | BTCSDATE | DATS | 8 | Planned Start Date for Background Job | |
SDLSTRTTM | BTCSTIME | TIMS | 6 | Planned start time for background Job | |
PRDMINS | BTCPMIN | NUMC | 2 | Duration period (in minutes) for a batch job | |
PRDHOURS | BTCPHOUR | NUMC | 2 | Duration period (in hours) for a batch job | |
PRDDAYS | BTCPDAY | NUMC | 3 | Duration (in days) of DBA action | |
PRDWEEKS | BTCPWEEK | NUMC | 2 | Duration period (in weeks) for a batch job | |
PRDMONTHS | BTCPMNTH | NUMC | 2 | Duration period (in months) for a batch job | |
PERIODIC | BTCPFLAG | CHAR | 1 | Periodic Jobs Indicator | |
DELANFREP | BTCDELFLAG | CHAR | 1 | Job deletion indicator after processing | |
EMERGMODE | BTCEFLAG | CHAR | 1 | Emergency Job operation indicator (content 'X') | |
SDLUNAME | BTCSDLNM | CHAR | 12 | Initiator of job/step scheduling | |
AUTHCKNAM | BTCAUTHNAM | CHAR | 12 | Background User Name for Authorization Check | |
AUTHCKMAN | BTCAUTHMAN | CLNT | 3 |
*
| Background client for authorization check |
SUCCNUM | BTCSNUM | INT4 | 10 | Number of successor job(s) | |
EOMCORRECT | BTCEOMCORR | INT4 | 10 | Correction field for calc. job execution (end-of-mth, cal.) | |
JOBCLASS | BTCJOBCLAS | CHAR | 1 | Job classification | |
PRIORITY | BTCJOBPRIO | INT4 | 10 | Job priority | |
EXECSERVER | BTCSRVNAME | CHAR | 20 | Server name | |
CALCORRECT | BTCEOMCORR | INT4 | 10 | Correction field for calc. job execution (end-of-mth, cal.) | |
TGTSRVGRP | BPSRVGRPN | CHAR | 40 | Server Group Name Background Processing |
TBTCP (Background Job Step Overview Table)
Field | Data Element | Data Type | length (Decimals) | Checktable | Description |
JOBNAME | BTCJOB | CHAR | 32 | Background job name | |
JOBCOUNT | BTCJOBCNT | CHAR | 8 | Job ID | |
STEPCOUNT | BTCSTEPCNT | INT4 | 10 | Job step ID number. | |
PROGNAME | BTCPROG | CHAR | 40 | Program name within a step (e.g. report) | |
PROGFROMLN | BTCSRCLINE | INT4 | 10 | Line number in an internal report. | |
PROGTOLN | BTCSRCLINE | INT4 | 10 | Line number in an internal report. | |
SDLDATE | BTCSDLDATE | DATS | 8 | Date of job/step scheduling | |
SDLTIME | BTCSDLTIME | TIMS | 6 | Time of a scheduled job/step | |
SDLUNAME | BTCSDLNM | CHAR | 12 | Initiator of job/step scheduling | |
VARIANT | BTCVARIANT | CHAR | 14 | Name of variant within a step | |
AUTHCKNAM | BTCAUTHNAM | CHAR | 12 | Background User Name for Authorization Check | |
LISTIDENT | BTCLISTID | NUMC | 10 | ID of batch job output list in the spool | |
XPGPID | BTCXPGPID | CHAR | 10 | ID of external program | |
XPGTGTSYS | BTCTGTSYS | CHAR | 32 | Target System to Run Background Job | |
XPGRFCDEST | RFCDEST | CHAR | 32 |
*
| Logical Destination (Specified in Function Call) |
XPGPROG | BTCXPGPGM | CHAR | 128 | Name of external program (possibly with access path) | |
XPGPARAMS | BTCXPGPAR | CHAR | 255 | Parameters of external program (string) | |
XPGFLAG | BTCSTEPTYP | CHAR | 1 | Identification of step as ABAP, ext. command or program | |
CONNCNTL | BTCXPGCNTL | CHAR | 1 | Control flag for external program (e.g. trace level) | |
STDINCNTL | BTCXPGCNTL | CHAR | 1 | Control flag for external program (e.g. trace level) | |
STDOUTCNTL | BTCXPGCNTL | CHAR | 1 | Control flag for external program (e.g. trace level) | |
STDERRCNTL | BTCXPGCNTL | CHAR | 1 | Control flag for external program (e.g. trace level) | |
TRACECNTL | BTCXPGCNTL | CHAR | 1 | Control flag for external program (e.g. trace level) | |
TERMCNTL | BTCXPGCNTL | CHAR | 1 | Control flag for external program (e.g. trace level) | |
STATUS | BTCPSTATUS | CHAR | 1 | Status of step in background processing | |
EXITCODE | BTCXPGEXIT | INT4 | 10 | Exit code of an external program | |
LANGUAGE | SPRAS | LANG | 1 |
*
| Language Key |
EXTCMD | SXPGLOGCMD | CHAR | 18 | Logical command name | |
OPSYSTEM | SYOPSYS | CHAR | 10 | Operating System of Application Server | |
.INCLUDE | PRI_PAROLD | Structure for passing print parameters | |||
PDEST | SYPDEST | CHAR | 4 |
*
| Spool Output Device |
PRCOP | SYPRCOP | NUMC | 3 | Number of Spool Copies | |
PLIST | SYPLIST | CHAR | 12 | Spool Request | |
PRTXT | SYPRTXT | CHAR | 68 | Spool Description | |
PRIMM | SYPRIMM | CHAR | 1 | Immediate Spool Print | |
PRREL | SYPRREL | CHAR | 1 | Immediate Spool Deletion | |
PRNEW | SYPRNEW | CHAR | 1 | New Spool Request | |
PEXPI | SYPEXPI | NUMC | 1 | Spool Retention Period | |
LINCT | SYLINCT | INT4 | 10 | Page Length of List | |
LINSZ | SYLINSZ | INT4 | 10 | Line width of list | |
PAART | SYPAART | CHAR | 16 |
*
| Spool Format |
PRBIG | SYPRBIG | CHAR | 1 | Spool Cover Sheet | |
PRSAP | SYPRSAP | CHAR | 1 | Print: SAP cover page | |
PRREC | SYPRREC | CHAR | 12 | Spool Recipient Name | |
PRABT | SYPRABT | CHAR | 12 | Spool Department Name | |
PRBER | SYPRBER | CHAR | 12 | Print: Authorization | |
PRDSN | SYPRDSN | CHAR | 6 | Spool File | |
PTYPE | SYPTYPE | CHAR | 12 | Print: Type of spool request | |
ARMOD | SYARMOD | CHAR | 1 | Print: Archiving mode | |
FOOTL | SYFOOTL | CHAR | 1 | Print: Output footer | |
PRCHK | SYCHECK | INT4 | 10 | Print: Check sum for print and archiving parameters | |
.INCLUDE | ARC_PARAMS | Structure of Transfer from Archiving Parameters | |||
SAP_OBJECT | SYARC_SAP_OBJECT | CHAR | 10 |
*
| Archiving Parameter: Object Type of SAP Object |
AR_OBJECT | SYARC_AR_OBJECT | CHAR | 10 |
*
| Archiving Parameter: Document Type |
ARCHIV_ID | SYARC_ARCHIV_ID | CHAR | 2 | Archiving Parameter: Target Storage System | |
DOC_TYPE | SYARC_DOC_TYPE | CHAR | 20 |
*
| Archiving Parameter: Document Type |
RPC_HOST | SYARC_RPC_HOST | CHAR | 32 | Archiving Parameter: RPC Host | |
RPC_SERVIC | SYARC_RPC_SERVIC | CHAR | 32 | Archiving Parameter: RPC Service/RFC Destination | |
INTERFACE | SYARC_INTERFACE | CHAR | 14 | Archiving Parameter: Communication Connection Component | |
MANDANT | SYARC_MANDANT | CLNT | 3 |
*
| Archiving Parameter: Client |
REPORT | SYARC_REPORT | CHAR | 40 |
*
| Archiving Parameter: Program Name |
INFO | SYARC_INFO | CHAR | 3 | Archiving Parameter: Info Field | |
ARCTEXT | SYARC_ARCTEXT | CHAR | 40 | Archiving Parameter: Text Information Field | |
DATUM | SYARC_DATUM | CHAR | 8 | Archiving Parameter: Archiving Date | |
ARCUSER | SYARC_ARCUSER | CHAR | 12 | Archiving Parameter: User | |
PRINTER | SYARC_PRINTER | CHAR | 4 |
*
| Archiving Parameter: Target Output Device |
FORMULAR | SYARC_FORMULAR | CHAR | 16 | Archiving Parameter: Output Format | |
ARCHIVPATH | SYARC_ARCHIVPATH | CHAR | 70 | Archiving Parameter: Standard Path | |
PROTOKOLL | SYARC_PROTOKOLL | CHAR | 8 | Archiving Parameter: Log | |
VERSION | SYARC_VERSION | CHAR | 4 | Archiving Parameter: Version Number | |
ACHECK | SYARC_CHECK | INT4 | 10 | Archiving Parameter: Check Total | |
PRIPARKEY | SYPRKEY | CHAR | 16 | Key for print parameters | |
CONVID | GWY_CONVID | CHAR | 8 | Conversation ID |
TBTCO (Job Status Overview Table)
Field | Data Element | Data Type | length (Decimals) | Checktable | Description |
JOBNAME | BTCJOB | CHAR | 32 | Background job name | |
JOBCOUNT | BTCJOBCNT | CHAR | 8 | Job ID | |
JOBGROUP | BTCJOBGRP | CHAR | 12 | Summary of jobs for a group | |
INTREPORT | BTCREP | CHAR | 40 | Name of internal report for batch job | |
STEPCOUNT | BTCSTEPCNT | INT4 | 10 | Job step ID number. | |
SDLSTRTDT | BTCSDATE | DATS | 8 | Planned Start Date for Background Job | |
SDLSTRTTM | BTCSTIME | TIMS | 6 | Planned start time for background Job | |
BTCSYSTEM | BTCTGTSYS | CHAR | 32 | Target System to Run Background Job | |
SDLDATE | BTCSDLDATE | DATS | 8 | Date of job/step scheduling | |
SDLTIME | BTCSDLTIME | TIMS | 6 | Time of a scheduled job/step | |
SDLUNAME | BTCSDLNM | CHAR | 12 | Initiator of job/step scheduling | |
LASTCHDATE | BTCJCHDATE | DATS | 8 | Date of last job change | |
LASTCHTIME | BTCJCHTIME | TIMS | 6 | Time of last job change | |
LASTCHNAME | BTCJCHNM | CHAR | 12 | Last job change made by | |
RELDATE | BTCRELDT | DATS | 8 | Release Date for Background Scheduling | |
RELTIME | BTCRELTM | TIMS | 6 | Release time of scheduled background job | |
RELUNAME | BTCRELNM | CHAR | 12 | User that released scheduled batch job | |
STRTDATE | BTCXDATE | DATS | 8 | Job start date | |
STRTTIME | BTCXTIME | TIMS | 6 | Batch job start time | |
ENDDATE | BTCXDATE | DATS | 8 | Job start date | |
ENDTIME | BTCXTIME | TIMS | 6 | Batch job start time | |
PRDMINS | BTCPMIN | NUMC | 2 | Duration period (in minutes) for a batch job | |
PRDHOURS | BTCPHOUR | NUMC | 2 | Duration period (in hours) for a batch job | |
PRDDAYS | BTCPDAY | NUMC | 3 | Duration (in days) of DBA action | |
PRDWEEKS | BTCPWEEK | NUMC | 2 | Duration period (in weeks) for a batch job | |
PRDMONTHS | BTCPMNTH | NUMC | 2 | Duration period (in months) for a batch job | |
PERIODIC | BTCPFLAG | CHAR | 1 | Periodic Jobs Indicator | |
DELANFREP | BTCDELFLAG | CHAR | 1 | Job deletion indicator after processing | |
EMERGMODE | BTCEFLAG | CHAR | 1 | Emergency Job operation indicator (content 'X') | |
STATUS | BTCSTATUS | CHAR | 1 | State of Background Job S: Scheduled R: Released A: Active F: Finished C: Canceled | |
NEWFLAG | BTCNEWFLAG | CHAR | 1 | New job ID creation flag | |
AUTHCKNAM | BTCAUTHNAM | CHAR | 12 | Background User Name for Authorization Check | |
AUTHCKMAN | BTCAUTHMAN | CLNT | 3 |
*
| Background client for authorization check |
SUCCNUM | BTCSNUM | INT4 | 10 | Number of successor job(s) | |
PREDNUM | BTCPNUM | INT4 | 10 | Number of previous jobs | |
JOBLOG | RSTSONAME | CHAR | 20 | TemSe object name | |
LASTSTRTDT | BTCLSDATE | DATS | 8 | Latest Execution Date for a Background Job | |
LASTSTRTTM | BTCLSTIME | TIMS | 6 | Latest Execution Time for Background Job | |
WPNUMBER | BTCWPNO | INT4 | 10 | Work process number | |
WPPROCID | BTCWPPID | INT4 | 10 | Work process ID | |
EVENTID | BTCEVENTID | CHAR | 32 | Background Processing Event | |
EVENTPARM | BTCEVTPARM | CHAR | 64 | Background Event Parameters (Such as, Jobname/Jobcount) | |
BTCSYSREAX | BTCTGTSYS | CHAR | 32 | Target System to Run Background Job | |
JOBCLASS | BTCJOBCLAS | CHAR | 1 | Job classification | |
PRIORITY | BTCJOBPRIO | INT4 | 10 | Job priority | |
EVENTCOUNT | BTCEVTCNT | CHAR | 8 | Event number | |
CHECKSTAT | BTCCKSTAT | CHAR | 1 | Job status check indicator for subsequent job start | |
CALENDARID | BTCCALID | CHAR | 2 | Factory Calendar ID for Background Processing | |
PRDBEHAV | BTCPRDBHV | CHAR | 1 | Period behavior of jobs on non-workdays | |
EXECSERVER | BTCSRVNAME | CHAR | 20 | Server name | |
EOMCORRECT | BTCEOMCORR | INT4 | 10 | Correction field for calc. job execution (end-of-mth, cal.) | |
CALCORRECT | BTCEOMCORR | INT4 | 10 | Correction field for calc. job execution (end-of-mth, cal.) | |
REAXSERVER | BTCSRVNAME | CHAR | 20 | Server name | |
RECLOGSYS | LOGSYS | CHAR | 10 |
*
| Logical system |
RECOBJTYPE | SWO_OBJTYP | CHAR | 10 |
*
| Object Type |
RECOBJKEY | SWO_TYPEID | CHAR | 70 | Object key | |
RECDESCRIB | SWO_DESCRB | CHAR | 10 | Describe flag | |
TGTSRVGRP | BPSRVGRPN | CHAR | 40 | Server Group Name Background Processing |
No comments:
Post a Comment