Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Clarification in the FM job_OPEN

Former Member
0 Kudos

Hello all,

In the FM JOB_OPEN the parameter name is being passed . Is that the name of the current report or the report which needs to be submitted in Back ground.

Regards,

K.Sibi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In job_open FM, the JOBNAME parameter can be freely defined. The FM will generate a job number. Pass the JOBNAME and the JOBNUMBER to JOB_SUBMIT FM.

Refer the following link :

http://help.sap.com/saphelp_40b/helpdata/en/fa/096d4d543b11d1898e0000e8322d00/content.htm

Thanx & Rgds,

Krishna

5 REPLIES 5

Former Member
0 Kudos

In JOB_OPEN jobname is a unique name that is used to submit a process,

after job_open u use JOB_SUBMIT in this fm u have parameter report in which u give the name of report to be submitted

check this code


**Create unique Job Name
  concatenate   p_date p_time
                into l_job_name
                .
  l_v_startdate = l_v_date.
  l_v_starttime = l_v_time.
* Call function to Open Background Job.
  call function 'JOB_OPEN'
    exporting
      jobname          = l_job_name
    importing
      jobcount         = lv_number
    exceptions
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      others           = 4.
  if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.

* Call function to Submit the Job
  call function 'JOB_SUBMIT'
    exporting
      authcknam               = sy-uname
      jobcount                = lv_number
      jobname                 = l_job_name
      report                  = 'zreport'          "Report to be submitted in background
      variant                 = p_lv_varinat
    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.

кu03B1ятu03B9к

0 Kudos

the flow will be open, submit and close. means that after job_submit, call FM job_close. then only job will get close

0 Kudos

Hi karthick.

Thank you .Is it must for a job_close to be there?

Regards,

K.Sibi

0 Kudos

I cannot understand the significance of these


  concatenate   p_date p_time
                into l_job_name
                .
  l_v_startdate = l_v_date.
  l_v_starttime = l_v_time.

I am presenting my code .Can u please help out.I am not getting errors .But once i execute it , I am not able to see the ztesting_interactive report being queued in spool using sp01.



DATA: number TYPE tbtcjob-jobcount ,
name TYPE tbtcjob-jobname VALUE 'ZTESTSPOOL' ,
print_parameters TYPE pri_params.
CALL FUNCTION 'JOB_OPEN'
  EXPORTING
    jobname  = name
  IMPORTING
    jobcount = number.
IF sy-subrc <> 0.

ENDIF.
CALL FUNCTION 'JOB_SUBMIT'
  EXPORTING
    authcknam = sy-uname
    jobcount  = number
    jobname   = name
    report    = 'ZTRAINING_INTERACTIVE'.
IF sy-subrc <> 0.

ENDIF.
CALL FUNCTION 'JOB_CLOSE'
  EXPORTING
    jobcount = number
    jobname  = name.
IF sy-subrc <> 0.
ENDIF.

Former Member
0 Kudos

Hi,

In job_open FM, the JOBNAME parameter can be freely defined. The FM will generate a job number. Pass the JOBNAME and the JOBNUMBER to JOB_SUBMIT FM.

Refer the following link :

http://help.sap.com/saphelp_40b/helpdata/en/fa/096d4d543b11d1898e0000e8322d00/content.htm

Thanx & Rgds,

Krishna