SAP Function Modules

BP_CALCULATE_NEXT_JOB_STARTS SAP Function module - Calculation of Start Date for a Periodic Job







BP_CALCULATE_NEXT_JOB_STARTS is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name BP_CALCULATE_NEXT_JOB_STARTS into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: BTCH
Released Date: 08.05.1996
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM BP_CALCULATE_NEXT_JOB_STARTS - BP CALCULATE NEXT JOB STARTS





CALL FUNCTION 'BP_CALCULATE_NEXT_JOB_STARTS' "Calculation of Start Date for a Periodic Job
  EXPORTING
    calc_jobname =              " tbtcjob-jobname
    calc_jobcount =             " tbtcjob-jobcount
    date_horizon =              " sy-datum
    time_horizon =              " sy-uzeit
  TABLES
    job_startdates =            " tbtcjob
  EXCEPTIONS
    JOB_DOESNT_EXIST = 1        "
    JOB_IS_NOT_TIME_PERIODIC = 2  "
    HORIZON_IN_THE_PAST = 3     "
    NO_STARTDATE_TILL_HORIZON = 4  "
    HORIZON_OLDER_THAN_JOB_START = 5  "
    .  "  BP_CALCULATE_NEXT_JOB_STARTS

ABAP code example for Function Module BP_CALCULATE_NEXT_JOB_STARTS





The ABAP code below is a full code listing to execute function module BP_CALCULATE_NEXT_JOB_STARTS including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_job_startdates  TYPE STANDARD TABLE OF TBTCJOB,"TABLES PARAM
wa_job_startdates  LIKE LINE OF it_job_startdates .


DATA(ld_calc_jobname) = some text here

DATA(ld_calc_jobcount) = some text here
DATA(ld_date_horizon) = '20210129'.
DATA(ld_time_horizon) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_job_startdates to it_job_startdates. . CALL FUNCTION 'BP_CALCULATE_NEXT_JOB_STARTS' EXPORTING calc_jobname = ld_calc_jobname calc_jobcount = ld_calc_jobcount date_horizon = ld_date_horizon time_horizon = ld_time_horizon TABLES job_startdates = it_job_startdates EXCEPTIONS JOB_DOESNT_EXIST = 1 JOB_IS_NOT_TIME_PERIODIC = 2 HORIZON_IN_THE_PAST = 3 NO_STARTDATE_TILL_HORIZON = 4 HORIZON_OLDER_THAN_JOB_START = 5 . " BP_CALCULATE_NEXT_JOB_STARTS
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_calc_jobname  TYPE TBTCJOB-JOBNAME ,
it_job_startdates  TYPE STANDARD TABLE OF TBTCJOB ,
wa_job_startdates  LIKE LINE OF it_job_startdates,
ld_calc_jobcount  TYPE TBTCJOB-JOBCOUNT ,
ld_date_horizon  TYPE SY-DATUM ,
ld_time_horizon  TYPE SY-UZEIT .


ld_calc_jobname = some text here

"populate fields of struture and append to itab
append wa_job_startdates to it_job_startdates.

ld_calc_jobcount = some text here
ld_date_horizon = '20210129'.
ld_time_horizon = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BP_CALCULATE_NEXT_JOB_STARTS or its description.