TAG SM37

rerun ABAP report with auto generated SM37 variant
After i have analyzed a background job’s attributes in SM37, i discovered that there is ABAP report and variant of the report in step data.

ABAP / BACKGROUND JOB / SAP BASIS
stop background job if there is an already running job with the same name
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.

submit background job with date selection
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.

ABAP / BACKGROUND JOB / SAP BASIS
read SM37 logs of background jobs
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.

ALV / BACKGROUND JOB / SAP BASIS
export spool list with many pages in SM37
When you call a list screen your report generates a downloadable report after execution. This report seems as a spool list if you run your program in background. There are two ways to generate a list screen. First one is using WRITE command and the second one is using REUSE_ALV_GRID_DISPLAY which serves to output internal table as an ALV list.

‘Extended job selection’ in SM37
Sometimes we need extra search criteria for job selection. For this purpose we use ‘Extended Job Selection’ button in SM37. If you want to directly go into this functionality you can use SM37C. This transaction helps us to search jobs according to many criteria like start date/time, ABAP program name, periods , time interval which the jobs was active and so on.
RECENT UPDATE

dynamically change stylename in smartform
Lately we had a requirement to use different smart styles for different plants in our outputs. However smartform has a one-to-one relation with smartstyle. It means you can only provide one style […]

read Inbound/Outbound/Final delivery using selection criteria in SAP EWM
In EWM Documents are one of the main objects which we always need to access through our custom developments. There are different types of Documents which most of them you can already […]

SAP / SAP BASIS / SAP PERFORMANCE
explanation of ST03 times
reference : SAP Press – SAP Performance Optimization Guide

ABAP / PROGRAM LIBRARY / SMARTFORMS
generate HTML output from SMARTFORM and send it as email body
There was a standard process in our system which sends a text as the body of a mail, after a certain operation is completed. For this program a change had been done so that the program could send a custom SMARTFORM as a PDF attachment beside to the text body. This change had been done as a repair in a program. So far so good, everything was working fine.
MOST COMMENTED
ABAP / SAP ARCHITECTURE / SAP BASIS / TRANSPORT MANAGEMENT
simulate request in target system before transportation – source code – part 2
PROGRAM LIBRARY / SAP ARCHITECTURE / WEBSERVICE
consume REST oauth service from ABAP – get access token in order to call main webservice – part 1
ABAP / DICTIONARY OBJECTS / SAP BASIS
read table logs and extract table columns from DBTABLOG
ABAP / SAP PERFORMANCE
‘Exception condition “RESOURCE_FAILURE” raised’ error in parallel processing
ABAP / ALV / PROGRAM LIBRARY
converting CL_SALV_TABLE into CL_GUI_ALV_GRID
BACKGROUND JOB / SAP BASIS
‘Extended job selection’ in SM37
ABAP
selection screen custom button