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: 

Background Job

0 Kudos

Dear Experts,

I have developed a report that does not have a selection screen and is meant to fill a z table and the program has to be executed in the background

through SM36. I have been asked by the Functional guy to create a T-Code for the development. I just need to ask that whether we can create a background job from SM36 through a T-code? I have always created a background job from program name but is it possible to create a background job from T-Code??

Please Guide.

Regards,

Mahesh

1 ACCEPTED SOLUTION

sandeep_katoch
Contributor
0 Kudos

Hi Mahesh,

As far as I know you can not create a job using T Code.

BR,

Sandeep Katoch

6 REPLIES 6

sandeep_katoch
Contributor
0 Kudos

Hi Mahesh,

As far as I know you can not create a job using T Code.

BR,

Sandeep Katoch

Former Member
0 Kudos

hi Mahesh,

The functional would have asked for a TCODE for online run of the program. This is generally to have a better authorization control in production scenario. You will have to schedule background job via Program Name only as per my knowledge. Anyways it doesnt matter in background job if you call using a program name or its transaction. I think you can once discuss with your FC guy and your issue would be sorted.

Please revert if still in doubt.

Regrads,

DN.

Former Member
0 Kudos

Hi Mahesh,

There is no options to Create Background Job  using Transaction Code. We can Schedule Background jobs only on the basis of ABAP Program names.

Thanks & Regards,

Kumaran Duraiswamy.

thanga_prakash
Active Contributor
0 Kudos

Hi Mahesh,

You can create a job using the below code.

1) FM 'JOB OPEN' opens a job

2) Submit a job with name, where you can pass values into the parameter of submitting program.

     specify the parameter of submitting program and the values to be passed to it using WITH  statement

3) Close the job.

************************************SOURCE CODE***********************************************************

DATA:  JOBNUM LIKE TBTCJOB-JOBCOUNT,

           JOBNAME LIKE TBTCJOB-JOBNAME.

        call function 'JOB_OPEN' .

           exporting  jobname    = lv_jobname

           importing  jobcount   = lv_jobcount

           exceptions others     = 1.

      if sy-subrc = 0.

        submit <report name> user sy-uname

                                         via job  lv_jobname

                                         number   lv_jobcount

                                         with     p_handle = XXXXXXXX

                                         with     val_15 = YYYYYYY

                                         with     p_corr1 = ZZZZZZZZ

                             and      return.

        if sy-subrc = 0.

          call function 'JOB_CLOSE' "

             exporting  jobcount     = lv_jobcount

                            jobname      = lv_jobname

                            strtimmed    = 'X'

             exceptions others       =  1.

*************************************************************************************************************

Regards,

Thanga Prakash T

matt
Active Contributor
0 Kudos

True. But irrelevant to the question, I feel.

ThomasZloch
Active Contributor
0 Kudos

What would you expect from a "functional guy"?