If you have read send email with attachment from an ABAP program post you will see how to send a mail with an attachment. Using SAP mail server and Business Communication Service namely CL_BCS we can send mails from SAP. These sent mails drop into a pool and wait to be executed by a background program. You can monitor all mails and communication related requests in SOST . The background job that executes waiting request according to period configuration by basis team. Duration period can be 15 minutes or 1 hour or any custom number according to your companys need.
I want to post about a very common STMS error which holds STMS queue in running status. As you know after you click transport button in STMS screen, your request is displayed in truck(pending) status. Here, requests with pending statuses are imported to the system thanks to execution of a background job.
My intention for this post is to suggest a more generic way to customize selection screen which i had iearlier mentioned in selection screen custom button post. For selection screen you can create a custom pf-status and give it to the RS_SET_SELSCREEN_STATUS as P_STATUS import parameter.
Passing ABAP internal memory data to lets say an internal table defined by DATA statement is used very often in ABAP programming. There are different techniques which differs according to architecture of your ABAP program, data size that you want to pass, visibility of your variables(same session or new session) etc.
SAP does not provide a functionality to prevent dublicate background job scheduling. Therefore if you schedule a background job more frequent than the run time of background job, there will be surely dublicate jobs running parallely. In order to prevent this i have written a check routine inside of my ABAP program that stops the program when there is an already running job with the same name.
As you know SM37 shows status, logs and many information about background jobs. What about run time information of already executed background job or an active job? For example which select-options or parameters are selected in background selection screen with which values. Of course the easiest way is to debug the related program somehow. Here we can separate the case to two conditions. First one is active jobs and the second one is finished jobs.
As mentioned in earlier submit report versions post you can make use of SUBMIT statement from your ABAP program in order to schedule any other ABAP program in background. However recently i have met a situation where user wants to decide the date and frequency of this background program. Therefore you may want to populate some fields in JOB_CLOSE of scheduling background job using an interface. BP_START_DATE_EDITOR provides this interface by collecting required information from the user.
Recently i had a requirement to trigger a background job from my custom program. Background job had a standard SAP report as step and report was processing a business logic. After this business process has been completed after execution of background job, system creates an application log in SM37. I needed to read this log , because some times background job was failing because of a business problem like lock situations. I have used BP_JOBLOG_READ to achieve this requirement. You can adapt below code according to your requirement.