SAP SWE_BATCHJOB_MAINTAIN Function Module for









SWE_BATCHJOB_MAINTAIN is a standard swe batchjob maintain SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for swe batchjob maintain FM, simply by entering the name SWE_BATCHJOB_MAINTAIN into the relevant SAP transaction such as SE37 or SE38.

Function Group: SWEP
Program Name: SAPLSWEP
Main Program: SAPLSWEP
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function SWE_BATCHJOB_MAINTAIN pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'SWE_BATCHJOB_MAINTAIN'"
EXPORTING
* START_ONCE_AT_ONCE = "
* FIRST_EX_DATE = SY-DATUM "Date and Time, Current (Application Server) Date
* FIRST_EX_TIME = SY-UZEIT "Date and Time, Current Application Server Time
* VARIANT = "
* JOBCLASS = "
* START_ONCE_IN_INTVAL_MINUTES = "
* START_AT_ONCE_PERIODICALLY = "
JOBNAME = "
* INTERVAL = "
* INTERVAL_HOURS = "Duration period (in hours) for a batch job
* INTERVAL_DAYS = "Duration (in days) of DBA action
REPORTNAME = "ABAP Program: Current Main Program
* DELANFREP = ' ' "Delete Job After Successful Execution

EXCEPTIONS
WRONG_PARAMETERS = 1 NOT_SCHEDULED = 2
.



IMPORTING Parameters details for SWE_BATCHJOB_MAINTAIN

START_ONCE_AT_ONCE -

Data type: XFLAG
Optional: Yes
Call by Reference: No ( called with pass by value option)

FIRST_EX_DATE - Date and Time, Current (Application Server) Date

Data type: SYDATUM
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

FIRST_EX_TIME - Date and Time, Current Application Server Time

Data type: SYUZEIT
Default: SY-UZEIT
Optional: Yes
Call by Reference: No ( called with pass by value option)

VARIANT -

Data type: RALDB_VARI
Optional: Yes
Call by Reference: No ( called with pass by value option)

JOBCLASS -

Data type: BTCJOBCLAS
Optional: Yes
Call by Reference: No ( called with pass by value option)

START_ONCE_IN_INTVAL_MINUTES -

Data type: XFLAG
Optional: Yes
Call by Reference: No ( called with pass by value option)

START_AT_ONCE_PERIODICALLY -

Data type: XFLAG
Optional: Yes
Call by Reference: No ( called with pass by value option)

JOBNAME -

Data type: TBTCJOB-JOBNAME
Optional: No
Call by Reference: No ( called with pass by value option)

INTERVAL -

Data type: TBTCJOB-PRDMINS
Optional: Yes
Call by Reference: No ( called with pass by value option)

INTERVAL_HOURS - Duration period (in hours) for a batch job

Data type: TBTCJOB-PRDHOURS
Optional: Yes
Call by Reference: No ( called with pass by value option)

INTERVAL_DAYS - Duration (in days) of DBA action

Data type: TBTCJOB-PRDDAYS
Optional: Yes
Call by Reference: No ( called with pass by value option)

REPORTNAME - ABAP Program: Current Main Program

Data type: SY-REPI2
Optional: No
Call by Reference: No ( called with pass by value option)

DELANFREP - Delete Job After Successful Execution

Data type: TBTCJOB-DELANFREP
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

WRONG_PARAMETERS -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NOT_SCHEDULED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for SWE_BATCHJOB_MAINTAIN Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_wrong_parameters  TYPE STRING, "   
lv_start_once_at_once  TYPE XFLAG, "   
lv_first_ex_date  TYPE SYDATUM, "   SY-DATUM
lv_first_ex_time  TYPE SYUZEIT, "   SY-UZEIT
lv_variant  TYPE RALDB_VARI, "   
lv_jobclass  TYPE BTCJOBCLAS, "   
lv_not_scheduled  TYPE BTCJOBCLAS, "   
lv_start_once_in_intval_minutes  TYPE XFLAG, "   
lv_start_at_once_periodically  TYPE XFLAG, "   
lv_jobname  TYPE TBTCJOB-JOBNAME, "   
lv_interval  TYPE TBTCJOB-PRDMINS, "   
lv_interval_hours  TYPE TBTCJOB-PRDHOURS, "   
lv_interval_days  TYPE TBTCJOB-PRDDAYS, "   
lv_reportname  TYPE SY-REPI2, "   
lv_delanfrep  TYPE TBTCJOB-DELANFREP. "   SPACE

  CALL FUNCTION 'SWE_BATCHJOB_MAINTAIN'  "
    EXPORTING
         START_ONCE_AT_ONCE = lv_start_once_at_once
         FIRST_EX_DATE = lv_first_ex_date
         FIRST_EX_TIME = lv_first_ex_time
         VARIANT = lv_variant
         JOBCLASS = lv_jobclass
         START_ONCE_IN_INTVAL_MINUTES = lv_start_once_in_intval_minutes
         START_AT_ONCE_PERIODICALLY = lv_start_at_once_periodically
         JOBNAME = lv_jobname
         INTERVAL = lv_interval
         INTERVAL_HOURS = lv_interval_hours
         INTERVAL_DAYS = lv_interval_days
         REPORTNAME = lv_reportname
         DELANFREP = lv_delanfrep
    EXCEPTIONS
        WRONG_PARAMETERS = 1
        NOT_SCHEDULED = 2
. " SWE_BATCHJOB_MAINTAIN




ABAP code using 7.40 inline data declarations to call FM SWE_BATCHJOB_MAINTAIN

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
 
DATA(ld_first_ex_date) = SY-DATUM.
 
DATA(ld_first_ex_time) = SY-UZEIT.
 
 
 
 
 
 
"SELECT single JOBNAME FROM TBTCJOB INTO @DATA(ld_jobname).
 
"SELECT single PRDMINS FROM TBTCJOB INTO @DATA(ld_interval).
 
"SELECT single PRDHOURS FROM TBTCJOB INTO @DATA(ld_interval_hours).
 
"SELECT single PRDDAYS FROM TBTCJOB INTO @DATA(ld_interval_days).
 
"SELECT single REPI2 FROM SY INTO @DATA(ld_reportname).
 
"SELECT single DELANFREP FROM TBTCJOB INTO @DATA(ld_delanfrep).
DATA(ld_delanfrep) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!