Trigger mail for cancelled background jobs scheduled using SM37
Dear Experts,
My requirement is to trigger email whenever a job gets cancelled in background.
For this I have already tried creating a workflow using BO BPJOB for event ABORTED.
But for some reason the event is never getting triggered.
I tested executing the workflow from tcode SWDD, it was running successfully, which means that there is no issue with my workflow.
Now I want to resolve the above issue OR
I want to raise the event manually from the program through some BADI or Exit.
But I didn't find any BADI or Exit for tcode SM37. Can anybody let me know if any.
Hi,
Please refer the below links.
Workflow- Background job fail
Re: Send mail when job fails
Regards
GK.
Moderator message: please do not post just links without any further explanations.
Edited by: Thomas Zloch on Sep 20, 2010 11:53 AM
Similar Messages
-
Mail not being sent for a background job scheduled.
Hello all,
We have a report which is scheduled in background. The job runs for every 10 mins in development server and sends the status to various mail IDs. The job runs successfully and the status shows as 'FINISHED'. But users are not able to recieve the mail.
Mails are sent using the FM "SO_DOCUMENT_SEND_API1".
When the debug the report everything works fine and the user recieved the mail. Any pointers to this would be of great help.
I tried searching in SDN for existing posts but could not find any relevant thread.
Thanks in advance.
Regards,
Chandra.Hello,
PFB piece of code showing how the FM is called.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = wa_doc
sender_address = wf_sender
sender_address_type = 'SMTP'
TABLES
packing_list = it_paklist
object_header = it_obj_head
contents_bin = it_obj_bin
contents_txt = it_obj_txt
receivers = it_obj_rcv.
Also , please note that this report has been scheduled some time in last year i.e. 2008 and it was running successfully by sending mails. But from past 2 months the report is not sending mails.
Regards,
Chandra
Edited by: Chandra A on Sep 7, 2009 2:17 PM
Edited by: Chandra A on Sep 7, 2009 2:17 PM -
Mail configuration and background job scheduling for ST22 Data
Experts,
I want to know how can i schedule a background job in SAP to extract data from ST22 and send a automated mail for the same?
Any help will be appreciated, Thanks!!!
Regards,
Vinit PagariaYou don't need to do that, simply configure CCMS (RZ20) to send you an alert via mail when a dump occurs.
Read,
http://help.sap.com/saphelp_nw04/helpdata/EN/90/4e313f8815d036e10000000a114084/frameset.htm
Regards
Juan -
How to Cancel a ACTIVE background Job scheduled in SM37.
Hi Friends,
I have scheduled a Background job. The job is ACTIVE now. How can I cancel this job?
Regards,
VijiThere is a last ditch method for jobs that don't get canceled for some reason or the other
Go to SM50 - first try canceling the job from there
If that doesn't work, note down the Process ID (PID) of the job
Take direct OS access to your system (You would need your Basis person for this) and terminate the job
If the server is Windows based, you can end it using the task manager and end that process id -
Trigger mail to MRP controller if Scheduled job for MRP fails
How to configure Triggerring of mail to MRP controller if Scheduled job for MRP fails ?
Dear Feby,
Check this links to create a distribution list and to assign the same during background job scheduling in SM36 for the program
RMMRP000.
Re: Settings to be done for sending mail to external system
Re: problem in background run
Regards
Mangalraj.S -
Regarding Background Job scheduling for file to file scenario
Hi Guru's
Good morining all of u
I have one doubt on ...
can we do background job scheduling for file to file scenario?
Please give me response as early as possible.
thanks and regards
saibackground jobscheduling for file adapter...
you can schedule the file adapter according to your requirement as follows:
In the Communication Channel Monitoring Locate the link Availability Time Planning, In Availability Time Planning, choose the Availability time as daily and say create, give the time details, select the communication channel in your case file adapter , goto the Communication Channels tab and filter and add the respective channel, save it
/people/shabarish.vijayakumar/blog/2006/11/26/adapter-scheduling--hail-sp-19- -
Background job scheduling for report
Hi can any one explain me how to do background job scheduling for report periodically for every 15 min.
Hi Rajesh thanks for your brief explanation.
but I am new to abap so I can't understand exactly will you please make it clear for the below program
REPORT zklj.
data: begin of itab occurs 0,
partner type but000-partner,
type type but000-type,
BU_SORT1 type but000-BU_SORT1,
end of itab.
select partner type from but000 into table itab.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = 'd:\al1\ahaj.xls'
FILETYPE = 'DAT'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = '400'
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = itab. -
Trigger substitution rule for a background job
Hi all,
I ve written a subroutine in Substitution rules for FI in GGB1 tcode for F110 transaction to replace the section code (bseg-secco) while posting a fi document.
but the substitution rule is not getting triggered as F110 runs a background job to post the document...
The substitution is active and the activation level is active all the time.
Could u please suggest how to get it triggered for a background job...Measuring External Processes
Use
The runtime analysis allows you to switch into work processes that are already running and to measure the runtime of dialogs running in them as though they were running in the current session. You can have up to ten external sessions, which may be of any type for example, dialog, update, or spool. This runtime analysis variant is ideal for monitoring long-running background jobs.
Filename and Directory
If you do not want to use the default filename and directory to store files, you can change them using the profile parameter abap/atrapath. If the profile parameter does not contain an entry at all, an error occurs when you start the runtime analysis. -
Trigger a substitution rule for a background job
Hi all,
I ve written a subroutine in Substitution rules for FI in GGB1 tcode for F110 transaction to replace the section code (bseg-secco) while posting a fi document.
but the substitution rule is not getting triggered as F110 runs a background job to post the document...
Could u please suggest how to get it triggered for a background job...Hi,
Please mainatain another substitution rule.
PREREQUISTE : 40(POSTING KEY )=SPARE PARTS(gl) and 50(posting key )=Inventory write off
Sustitute : Dtype = VA
Regards
jabeen -
Hi,
I am scheduling a report to run in background.
In this report it is creating background jobs automatically for different company codes.
It submits the 1st background job and waits until it finishes.
Then 2nd job starts in background and continues with other jobs.
At end it finishes all the jobs and closes.
Now my problem is.
1. Whether is it possible for us to submit all the jobs at 1 time. And execute at same time. Ie., 1st, 2nd job will start at same time.
2. If possible how can we do that.
What I have written is
loop at companycode.
Create job name.
call fun 'Job_Open'.
submit xxxx user sy-uname via job job_name numer job_count
to sap-spool
spool parameters l_spool_parameter
without spool dynpro
with companycode
with ......
and return.
endloop.
Please help ASAP, urgent.hi praveen,
Job Scheduling Explained
Definition
Before any background processing can actually begin, background jobs must be defined and scheduled. The scheduled time for when a job runs is one part of the jobs definition. There are several ways to schedule jobs:
From Transaction SM36 (Define Background Job)
With the "start program in the background" option of either Transaction SA38 (ABAP: Execute Program) or Transaction SE38 (the ABAP editor)
Through the background processing systems own programming interface. (Many SAP applications use the internal programming interface to schedule long-running reports for background processing.)
Through an external interface.
Scheduling Background Jobs
Use
You can define and schedule background jobs in two ways from the Job Overview:
· Directly from Transaction SM36. This is best for users already familiar with background job scheduling.
· The Job Scheduling Wizard. This is best for users unfamiliar with SAP background job scheduling. To use the Job Wizard, start from Transaction SM36, and either select Goto ® Wizard version or simply use the Job Wizard button.
Procedure
1. Call Transaction SM36 or choose CCMS ® Jobs ® Definition.
2. Assign a job name. Decide on a name for the job you are defining and enter it in the Job Name field.
3. Set the jobs priority, or Job Class:
· High priority: Class A
· Medium priority: Class B
· Low priority: Class C
4. In the Target server field, indicate whether to use system load balancing.
· For the system to use system load balancing to automatically select the most efficient application server to use at the moment, leave this field empty.
· To use a particular application server to run the job, enter a specific target server.
5. If spool requests generated by this job are to be sent to someone as email, specify the email address. Choose the Spool list recipient button.
6. Define when the job is to start by choosing Start Condition and completing the appropriate selections. If the job is to repeat, or be periodic, check the box at the bottom of this screen.
7. Define the jobs steps by choosing Step, then specify the ABAP program, external command, or external program to be used for each step.
8. Save the fully defined job to submit it to the background processing system.
9. When you need to modify, reschedule, or otherwise manipulate a job after you've scheduled it the first time, you'll manage jobs from the Job Overview.
Note: Release the job so that it can run. No job, even those scheduled for immediate processing, can run without first being released.
Specifying Job Start Conditions
Use
When scheduling a background job (either from Transaction SM36, Define Background Job or CCMS ® Jobs ® Definition), you must specify conditions that will trigger the job to start.
Procedure
Choose the Start condition button at the top of the Define Background Job screen.
Choose the button at the top of the Start Time screen for the type of start condition you want to use (Immediate, Date/Time, After job, After event, or At operation mode) and complete the start time definition in the screen that appears.
For the job to repeat, check the Periodic job box at the bottom of the Start Time screen and choose the Period values button below it to define the frequency of repetition (hourly, daily, weekly, monthly, or another specific time-related period). Then choose the Save button in the Period values screen to accept the periodicity and return to the Start Time screen.
Once youve completed specifying the job start conditions, choose the Save button at the bottom of the Start Time screen to return to the Define Background Job screen.
No job can be started until it is released, including jobs scheduled to start immediately. Since releasing jobs can be done only by a system administrator from the job management screen (Transaction SM37) or by other users who have been granted the appropriate Authorizations for Background Processing, no unauthorized user can start a job without explicit permission
Managing Jobs from the Job Overview
Use
The Job Overview, or Job Maintenance, screen is the single, central area for completing a wide range of tasks related to monitoring and managing jobs, including defining jobs; scheduling, rescheduling, and copying existing jobs; rescheduling and editing jobs and job steps; repeating a job; debugging an active job; reviewing information about a job; canceling a job's release status; canceling and deleting jobs; comparing the specifications of several jobs; checking the status of jobs; reviewing job logs; and releasing a job so it can run.
Procedures
To display the Job Overview screen, choose CCMS ® Jobs ® Maintenance or call Transaction SM37. Before entering the Job Overview screen, the system first displays the Select Background Jobs screen. You'll need to complete this Job Selection screen to define the criteria for the jobs you want to manage. Once you've selected jobs to manage, you can choose from a wide range of management tasks:
To copy a single existing job, choose Job ® Copy.
To reschedule or edit job steps or attributes of a single job, choose Job ® Change. A job step is an independent unit of work within a background job. Each job step can execute an ABAP or external program. Other variants or authorizations may be used for each job step. The system allows you to display ABAP programs and variants. You can scan a program for syntax errors. You can also display the authorizations for an authorized user of an ABAP job step.
To repeat a single job, choose Job ® Repeat scheduling.
To debug an active job, choose Job ® Capture: active job. Only a single selection is allowed. If an active job seems to be running incorrectly (e.g., running for an excessively long time), you can interrupt and analyze it in debugging mode in a background process, and then either release it again or stop it altogether.
You will be able to capture a background job only if you are logged on to the SAP server on which the job is running. To find server information in the Job Overview, select and mark the job, then choose Job ® Job details.
To review information about a job, choose Job ® Job details. Details displayed can include:
current job status
periodicity, or the repetition interval
other jobs linked to the current job, either as previous or subsequent jobs
defined job steps
spool requests generated by the current job
To cancel a job's "Released" status, select the job or jobs from the Job Overview list and choose Job ® Release -> Scheduled.
To cancel a job from running but keep the job definition available, select the job or jobs from the Job Overview list and choose Job ® Cancel active job.
To delete a job entirely, select the job or jobs from the Job Overview list and choose Job ® Delete. Jobs with the status of Ready or Running cannot be deleted.
To compare the specifications of more than one job, select the jobs from the Job Overview list and choose Job ® Compare jobs.
To check the status of jobs, select the job or jobs from the Overview Job list and choose Job ® Check status. This allows you to either change the job status back to Planned or cancel the job altogether. This is especially useful when a job has malfunctioned.
To review job logs, select a job or jobs with the status Completed or Canceled from the Job Overview list and
regards
karthik
reward me points if helpfull -
About Background job scheduling
One file will be coming from oracle system. it would be stored at a particular path.
I want to schedule for background job processing. how to do.Hi,
You need to write a Program to place the file in the Application server, then only you can schedule a background job, you need to use the OPEN dataset, CLOSE DATASETS to do this one, then you can schedule the job .
To schedule a job in the background job, look at the below links
Re: background job schedule
http://aspalliance.com/1129_Background_Processing_SAP_R3_System
Regards
Sudheer -
Hi any one please explain background job scheduling
Hi any one please explain background job scheduling . Good answer can be rewarded.
ThanksBackground jobs are pgms that are scheduled to be run in the Background without user interaction. So this can be done only for Type 1(executable) Program and not for Module-Pool Programs. Typically, a variant is defined and the pgm is run using the same.
The transaction code is sm36 -Define Background job. Using the Start Condition tab you can define when you want the job to run (specific time or if it has to follow after a particular job is done etc.,) Using the Step tab you can assign the pgm name and variant.
After the job is scheduled, you can check the status in sm37, along with the Job log and Spool.
For more info:
http://help.sap.com/saphelp_bw30b/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm -
What is the spool, what is its role in background job scheduling
Hi,
I want to know what is meant by Spool request and spool number generated.
Tell about transaction SP01.
How it is linked to Background job scheduling.
thanks.
sam.Hi,
Refer this link.
https://www.sdn.sap.com/irj/sdn/inf?rid=/library/uuid/7a5f4061-0a01-0010-c9bc-a4e4cb100438
About SP01.
Printing does not work in SAP. There is a printer definition for your local printer, but it does not work. Presuming that you use the program SAPLPD on your computer.
Boot your computer and start only the SAPLogon and the SAPLpd program.
Delete all of your old print jobs in the SAP system (Transaction SP01).Generate only one new print job.
Check that there is enough resource in your computer. Check the free memory (Win 3.1x) and the free disk space (The lists are temporarily saved on your disk).
Open the SAPLPD and read the print log in the window. The printer definition must correspond with the parameters shown here.
Check that the standard printer is on the same lpt (Win 3.1: Control panel, Printer) as defined for the printer (usually lpt1).
In Transaction SP01 read the protocol of your print job. Do not generate new print jobs! Wait till the SAP system changes the status of the print job.
If you can not find the print job in SP01 anymore, then the print job was successfully printed out. If it didn't come out on your printer and the SAPLpd didn't indicate an incoming print job, then the connection was realised with another PC. Then SAP printer definition you used, does not correspond with your computer.
Scheduling Background Jobs:
1. Background jobs are scheduled by Basis administrators using transaction SM36.
2. To run a report in a background, a job needs to be created with a step using the report name
and a variant for selection parameters. It is recommended to create a separate variant for each
scheduled job to produce results for specific dates (e.g. previous month) or organizational units (e.g.
company codes).
3. While defining the step, the spool parameters needs to be specified
(Step-> Print Specifications->Properties) to secure the output of the report and help authorized users
to find the spool request. The following parameters needs to be maintained:
a. Time of printing: set to u201CSend to SAP spooler Only for nowu201D
b. Name u2013 abbreviated name to identify the job output
c. Title u2013 free form description for the report output
d. Authorization u2013 a value defined by Security in user profiles to allow those users to access
this spool request (authorization object S_SPO_ACT, value SPOAUTH). Only users with matching
authorization value in their profiles will be able to see the output.
e. Department u2013 set to appropriate department/functional area name. This field can be used in
a search later.
f. Retention period u2013 set to u201CDo not deleteu201D if the report output needs to be retained for more
than 8 days. Once the archiving/document repository solution is in place the spool requests could
be automatically moved to the archive/repository. Storage Mode parameter on the same screen
could be used to immediately send the output to archive instead of creating a spool request.
Configuring user access:
1. To access a report output created by a background job, a user must have at
least access to SP01 (Spool requests) transaction without restriction on the user
name (however by itself it will not let the user to see all spool requests). To have
that access the user must have S_ADMI_FCD authorization object in the profile with
SPOR (or SP01) value of S_ADMI_FCD parameter (maintained by Security).
2. To access a particular jobu2019s output in the spool, the user must have
S_SPO_ACT object in the profile with SPOAUTH parameter matching the value used
in the Print Specifications of the job (see p. 3.d above).
3. Levels of access to the spool (display, print once, reprint, download, etc) are
controlled by SPOACTION parameter of S_SPO_ACT. The user must have at least
BASE access (display).
On-line reports:
1. Exactly the same configuration can be maintained for any output produced
from R/3. If a user clicks u201CParametersu201D button on a SAP Printer selection dialog, it
allows to specify all the parameters as described in p. 3 of
u201CScheduling background jobsu201D section. Thus any output created by an online report
can be saved and accessed by any user authorized to access that spool request
(access restriction provided by the Authorization field of the spool request
attributes, see p. 3.d of u201CScheduling background jobsu201D section).
Access to reportu2019s output:
1. A user that had proper access (see Configuring user access above) can
retrieve a job/report output through transaction SP01.
2. The selection screen can be configured by clicking u201CFurther selection
criteriau2026u201D button (e.g. to bring u201CSpool request name (suffix 2)u201D field or hide other
fields).
3. The following fields can be used to search for a specific output (Note that
Created By must be blank when searching for scheduled jobu2019s outputs)
a. Spool request name (suffix 2) u2013 corresponds to a spool name in p. 3.b in
u201CScheduling background jobsu201D section above).
b. Date created u2013 to find an output of a job that ran within a certain date range.
c. Title u2013 corresponds to spool Title in p. 3.c in u201CScheduling background jobsu201D
section above).
d. Department - corresponds to spool Department in p. 3.e in u201CScheduling
background jobsu201D section above).
4. Upon entering selection criteria, the user clicks the Execute button to
retrieve the list of matching spool requests.
5. From the spool list the user can use several function such as view the
content of a spool request, print the spool request, view attributed of the spool
request, etc. (some functions may need special authorization, see p.3 in
Configuring user access)
a. Click the Print button to print the spool request with the default attributes
(usually defined with the job definition). It will print it on a printer that was
specified when a job was created.
b. Click the u201CPrint with changed attributedu201D button to print the spool request
with the different attributes (e.g. changing the printer name).
c. Click the u201CDisplay contentsu201D button to preview the spool request contents. A
Print and Download functions are available from the preview mode.
Exporting the Contents of a Spool Request
Use
You want to export the contents of a spool request as a text file to the SAP GUI working directory or to a directory of your choice. The content of the spool request is downloaded as plain text without, for example, graphics, images, or specific fonts.
The following procedures are irrelevant for the PDF-based form printing integrated as of SAP Web Application Server 6.40, since the print data can be opened and stored as a PDF. See also Displaying and Printing PDF-Based Forms.
Procedure
Exporting to the SAP GUI Working Directory:
Choose Spool Request ® Forward® Export as Text.
The entire text is stored in your SAP GUI working directory in ASCII format.
A file of this type is named using the following pattern:
.txt
Example: ABC0000004327.txt
You require appropriate authorization for this function.
Exporting to a Directory of Your Choice:
With this method of exporting a spool request, the content of the spool request is first displayed and you then download the screen list as a text file to the directory of your choice.
1. Select the spool request to be exported and choose Display Contents.
2. In the case of SAPScript/Smart Forms documents, activate list display by choosing Goto.
3. Choose System ® List ® Save ® Local File.
4. Choose one of the available formats and confirm your choice.
5. Choose a directory and save the spool request.
By default, only the first 10 pages of a spool request are saved in a file. You can increase the number of pages to be saved by choosing Goto ® Display Requests ® Settings and making the desired entries in the Display Area group box. -
Data capturing in background job scheduling
HI,
I hava a specific requirement in background job scheduling.
in my layout i have to show <b>pagenumber / total number of page numbers.</b>
for that iam useing a variable with value '$$$' and iam replacing this variable with total number of pages..
when we run in foreground it is working fine. but in background the variable is not being replaced..
how can i modify the data in spool..REPORT ztest no STANDARD PAGE HEADING
MESSAGE-ID zfi
LINE-COUNT 65(1)
LINE-SIZE 165.
DATA: v_sum(3) TYPE c VALUE'$$$'.
CONSTANTS: c_slash TYPE c VALUE '/'. "Stores /
parameters : p_1 type c.
START-OF-SELECTION.
WRITE : 'Hi'.
SKIP 80.
WRITE : 'Helloo'.
END-OF-SELECTION.
*To print the total no. of pages in report heading.
PERFORM f_replace_totpage.
TOP-OF-PAGE
TOP-OF-PAGE.
Display Standard Report Header
PERFORM f_report_header.
*& Form f_replace_totpage
To print the total no. of pages in report heading.
FORM f_replace_totpage .
DATA: l_tot_page(3) TYPE c,
l_pgcnt TYPE i,
l_licnt TYPE i VALUE '3'.
Assign value of total number of pages into l_tot_page.
l_tot_page = sy-pagno.
To replace the value of v_sum ($$$) by total number of pages after
reading the content of fourth line of each page.
WHILE l_pgcnt LE l_tot_page.
l_pgcnt = l_pgcnt + 1.
READ LINE l_licnt OF PAGE l_pgcnt.
REPLACE v_sum WITH l_tot_page INTO sy-lisel.
MODIFY LINE l_licnt OF PAGE l_pgcnt.
ENDWHILE.
CLEAR: l_tot_page,
l_pgcnt,
l_licnt.
ENDFORM. " f_replace_totpage
*& Form f_report_header
Report Header display
FORM f_report_header.
FORMAT COLOR 1 INTENSIFIED ON.
Text-246 - Page:
WRITE:/1 text-247, 45 text-241, 110 text-242, 150 space.
WRITE:/1 text-243, sy-repid, 110 text-244, sy-datum, c_slash, sy-uzeit,
150 space.
WRITE:/1 text-245, sy-uname, 110 text-246, sy-pagno,c_slash,v_sum,
150 space.
FORMAT COLOR OFF.
ULINE.
ENDFORM. " f_report_header -
Background Jobs scheduled through ABAP Editor
Dear SRMer's
System Info : SRM 5.0
Can you please let me know what is the tcode to check Background jobs scheduled through the ABAP Editor(SE 38) or through SA38 tocdes in SRM.
Points will be rewarded for answers.
Thanks in advance,
BobbyHi Bobby,
Try this steps...
1. Log on to the appropriate SAP instance and client as either the user ID owning the job or an administrator ID.
2. Go to transaction SM37.
3. On the Simple Job Selection screen, fill in the Job name field or use any of the screens filtering options to produce a list from which you can see the job you want to view. In order for all occurances of a job to be viewed, all statuses of the job should be checked on. Click on the Execute button.
Regards
Rajesh.
Maybe you are looking for
-
Safari and all other browsers hang?
Safari and firefox and chrome have started to hang all the time. I have to force quit each when the dreaded rainbow ball replaces mu curser. I'm on an iMac running Mavericks. I have the latest flash player. 4GB of ram. I've installed Norton Internet
-
I have the following problem:; I have a JFileChooser and I attached a FileFilter to it, which only allows files with the extension *.in and *.inx. Everything works well - only files with these extensions are shown in the Dialog. But as a user I expec
-
HELP! I Can't load Pagemaker 7.0 to Windows 8
I have just received my $500 software and it loads Acrobat Distiller but it won't load Pagemaker from the auto start or from the application on the CD! HELP!!!!
-
I have a Nexus phone. I've taken some pictures, however I have not been able to view the on my computer. Can some one help me?
-
Ipad2 has started crashing on me
I bought this iPad 2 last year and untill now it's been great. For the past couple of days its been wierd, any app I open will freeze while loading then send me back to the locked screen. It doesn't happen all the time, but it does happen with any gi