How to Schedule a Job using report

Schedule a job using report by using function modules.
Data Declarations Required:

DATA: gv_jobname TYPE tbtcjob-jobname VALUE 'ZAUJOBTEST'
      "holds the name of background job created
      gv_jobcount TYPE tbtcjob-jobcount.

Function Modules Used:
JOB_OPEN,JOB_SUBMIT,JOB_CLOSE

Usage only with essential parameters:


CALL FUNCTION 'JOB_OPEN'
  EXPORTING
    jobname          = gv_jobname
  IMPORTING
    jobcount         = gv_jobcount
  EXCEPTIONS
    cant_create_job  = 1
    invalid_job_data = 2
    jobname_missing  = 3
    OTHERS           = 4.
IF sy-subrc EQ 0.
  CALL FUNCTION 'JOB_SUBMIT'
    EXPORTING
      authcknam               = sy-uname
      jobcount                = gv_jobcount
      jobname                 = gv_jobname
      report                  = 'ZFRN_MATREPORT'
      variant                 = 'ZAU_VAR1'
    EXCEPTIONS
      bad_priparams           = 1
      bad_xpgflags            = 2
      invalid_jobdata         = 3
      jobname_missing         = 4
      job_notex               = 5
      job_submit_failed       = 6
      lock_failed             = 7
      program_missing         = 8
      prog_abap_and_extpg_set = 9
      OTHERS                  = 10.
  IF sy-subrc EQ 0.


    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount             = gv_jobcount
        jobname              = gv_jobname
        strtimmed            = 'X'
      EXCEPTIONS
        cant_start_immediate = 1
        invalid_startdate    = 2
        jobname_missing      = 3
        job_close_failed     = 4
        job_nosteps          = 5
        job_notex            = 6
        lock_failed          = 7
        invalid_target       = 8
        OTHERS               = 9.
    IF sy-subrc EQ 0.
      WRITE'Job was created'.

    ENDIF.
  ENDIF.
ENDIF.