SAP Function Modules

TFC_START_JOB SAP Function module







TFC_START_JOB 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 TFC_START_JOB into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: TFC_SERVICES
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM TFC_START_JOB - TFC START JOB





CALL FUNCTION 'TFC_START_JOB' "
  EXPORTING
    scma_taskplan =             " pepprofile
    scma_report =               " sy-repid      Name of Report
    scma_variant =              " raldb-variant  Name of variant
    scma_startdate =            " tbtcjob-sdlstrtdt  Start Date
    scma_starttime =            " tbtcjob-sdlstrttm  Start Time
*   scma_tpi_id =               " guid_32       GUID in 'CHAR' Format in Uppercase
*   scma_tpi_text =             " scma_tpi_text  Schedule Manager: Instance Text for a Tasklist
    flag_scheduled =            " char1
    flag_immediate =            " char1
    flag_released =             " char1         Should the job be released?
*   i_no_dialog =               " char1         No Dialog
*   is_pri_params =             " pri_params    Structure for Passing Print Parameters
*   is_arc_params =             " arc_params    ImageLink structure
  IMPORTING
    last_run =                  " scmalast_run  Last Run
    e_not_scheduled =           " char1
  TABLES
    ld_scmatrees =              " scmatrees
  EXCEPTIONS
    REPORT_NOT_FOUND = 1        "
    ERROR_OCCURED = 2           "
    VARIANT_NOT_FOUND = 3       "
    .  "  TFC_START_JOB

ABAP code example for Function Module TFC_START_JOB





The ABAP code below is a full code listing to execute function module TFC_START_JOB 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:
ld_last_run  TYPE SCMALAST_RUN ,
ld_e_not_scheduled  TYPE CHAR1 ,
it_ld_scmatrees  TYPE STANDARD TABLE OF SCMATREES,"TABLES PARAM
wa_ld_scmatrees  LIKE LINE OF it_ld_scmatrees .

DATA(ld_scma_taskplan) = 'Check type of data required'.
DATA(ld_scma_report) = '20210129'.

DATA(ld_scma_variant) = some text here

DATA(ld_scma_startdate) = 20210129

DATA(ld_scma_starttime) = Check type of data required
DATA(ld_scma_tpi_id) = 'some text here'.
DATA(ld_scma_tpi_text) = 'some text here'.
DATA(ld_flag_scheduled) = 'some text here'.
DATA(ld_flag_immediate) = 'some text here'.
DATA(ld_flag_released) = 'some text here'.
DATA(ld_i_no_dialog) = 'some text here'.
DATA(ld_is_pri_params) = 'some text here'.
DATA(ld_is_arc_params) = 'some text here'.

"populate fields of struture and append to itab
append wa_ld_scmatrees to it_ld_scmatrees. . CALL FUNCTION 'TFC_START_JOB' EXPORTING scma_taskplan = ld_scma_taskplan scma_report = ld_scma_report scma_variant = ld_scma_variant scma_startdate = ld_scma_startdate scma_starttime = ld_scma_starttime * scma_tpi_id = ld_scma_tpi_id * scma_tpi_text = ld_scma_tpi_text flag_scheduled = ld_flag_scheduled flag_immediate = ld_flag_immediate flag_released = ld_flag_released * i_no_dialog = ld_i_no_dialog * is_pri_params = ld_is_pri_params * is_arc_params = ld_is_arc_params IMPORTING last_run = ld_last_run e_not_scheduled = ld_e_not_scheduled TABLES ld_scmatrees = it_ld_scmatrees EXCEPTIONS REPORT_NOT_FOUND = 1 ERROR_OCCURED = 2 VARIANT_NOT_FOUND = 3 . " TFC_START_JOB
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 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_last_run  TYPE SCMALAST_RUN ,
ld_scma_taskplan  TYPE PEPPROFILE ,
it_ld_scmatrees  TYPE STANDARD TABLE OF SCMATREES ,
wa_ld_scmatrees  LIKE LINE OF it_ld_scmatrees,
ld_e_not_scheduled  TYPE CHAR1 ,
ld_scma_report  TYPE SY-REPID ,
ld_scma_variant  TYPE RALDB-VARIANT ,
ld_scma_startdate  TYPE TBTCJOB-SDLSTRTDT ,
ld_scma_starttime  TYPE TBTCJOB-SDLSTRTTM ,
ld_scma_tpi_id  TYPE GUID_32 ,
ld_scma_tpi_text  TYPE SCMA_TPI_TEXT ,
ld_flag_scheduled  TYPE CHAR1 ,
ld_flag_immediate  TYPE CHAR1 ,
ld_flag_released  TYPE CHAR1 ,
ld_i_no_dialog  TYPE CHAR1 ,
ld_is_pri_params  TYPE PRI_PARAMS ,
ld_is_arc_params  TYPE ARC_PARAMS .

ld_scma_taskplan = 'some text here'.

"populate fields of struture and append to itab
append wa_ld_scmatrees to it_ld_scmatrees.
ld_scma_report = '20210129'.

ld_scma_variant = some text here

ld_scma_startdate = 20210129

ld_scma_starttime = Check type of data required
ld_scma_tpi_id = 'some text here'.
ld_scma_tpi_text = 'some text here'.
ld_flag_scheduled = 'some text here'.
ld_flag_immediate = 'some text here'.
ld_flag_released = 'some text here'.
ld_i_no_dialog = 'some text here'.
ld_is_pri_params = 'some text here'.
ld_is_arc_params = 'some text here'.

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 TFC_START_JOB or its description.