Application Development and Automation 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: 
Read only

Submitting a Zprogram in Background

Former Member
0 Likes
1,102

Hi Masters,

Please help me solving this urgent issue.

Issue Description:

____________________

I want to schedule my program in background…means..

My main selection screen is having a single parameter…it appears as..

Last Changed On ________SY-DATUM_________

Now every night at 12.00 clock night the program should take current date.

And would do the required processing which I have done in my Zprogram....

Here m not getting how to schedule this Zprogram as

in background...

M waiting for positive responses....!!

-=Virendra=-

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,046

You can follow one of the following 2 ways:

1)GO to SM36 to schedule your program in background but to make date as current date, do as follows:

Add the following 3 lines of code to your Program:

Let's name the field "Last Changed on" as w_date.

if SY-BATCH = 'X'.

W_date = sy-datum.

endif.

2.

Create a new driver program for your program

and in the driver program , call the following FMs:

CALL FUNCTION 'JOB_OPEN'

CALL FUNCTION 'JOB_SUBMIT'

CALL FUNCTION 'JOB_CLOSE'

To create/ set a dynamic variant for JOB_SUBMIT,

use FM 'RS_CHANGE_CREATED_VARIANT'/'RS_CREATE_VARIANT'

Hope it solves your problem.

Regards

Message was edited by: Akriti

Message was edited by: Akriti

10 REPLIES 10
Read only

former_member404244
Active Contributor
0 Likes
1,046

Hi Virendra,

u have to create a job in SM36 and schedule it.In SM36 give ur zprogram name .

Regards,

nagaraj

Read only

gopi_narendra
Active Contributor
0 Likes
1,046

u can create a abckground job in sm36 by giving ur prog name tehre

Read only

Former Member
0 Likes
1,046

Go to SM36, Create a new job name

give the program name

Click on date/time and give the time values

Click on period values and give daily.

Read only

Former Member
0 Likes
1,046

USE TCODE SM36

GIVE DATE AND TIME TO SCHEDULE IT ON 12:00 AT NIGHT.

AND CHECK THE BOX PERIODIC JOB.

CHEERS

-


SACHIN

Read only

Former Member
0 Likes
1,046

Hi

Adding to the suggestions given above, you use the System Date(SY-DATUM) in your program. As a background job cannot take any input through selection-screen...

So, as you schedule it periodically, it takes the value from <b>SY-DATUM</b> system variable.

Remove Selection-screen and populate the sy-datum value in <b>Initialization</b> section.

Regards,

Raj

Message was edited by: Rajasekhar Dinavahi

Read only

Former Member
0 Likes
1,047

You can follow one of the following 2 ways:

1)GO to SM36 to schedule your program in background but to make date as current date, do as follows:

Add the following 3 lines of code to your Program:

Let's name the field "Last Changed on" as w_date.

if SY-BATCH = 'X'.

W_date = sy-datum.

endif.

2.

Create a new driver program for your program

and in the driver program , call the following FMs:

CALL FUNCTION 'JOB_OPEN'

CALL FUNCTION 'JOB_SUBMIT'

CALL FUNCTION 'JOB_CLOSE'

To create/ set a dynamic variant for JOB_SUBMIT,

use FM 'RS_CHANGE_CREATED_VARIANT'/'RS_CREATE_VARIANT'

Hope it solves your problem.

Regards

Message was edited by: Akriti

Message was edited by: Akriti

Read only

Former Member
0 Likes
1,046

Thank you all you people for such a quick replies..!!!

Dear Akriti,

could you please clear me this point..

How this sy-batch would work ?

I mean, i saw in syst structure showing "system field filled if program is running in Background".

When this sy-batch would filled-up in respect of my program because i am not using built in "excute in background" option which is given in Menu ?

if i dont put this "Last Changed On" parameter on my selection screen and wish to run this program in background automatically at 12 o clock..then..

Please show some light ....

Read only

0 Likes
1,046

if the values of the parameter "last changed on" is going to be sy-datum always, why do u want to have it a parameter. use the variable sy-datum inside the program directly. Then for scheduling joibs u go to the transaction SM36, in the appl tool bar, one wizard option is there. u go by that, the steps and very simple and self explanatory

Thanks,

Dinu

Read only

0 Likes
1,046

Hi virendra,

1. while declaring the parameter,

give DEFAULT SY-DATUM.

2. For running in background,

use sm36 to schedule in background,

everyday,

at the desired time 12:00 clock.

regards,

amit m.

Read only

Former Member
0 Likes
1,046

Thanks to you all.

Such a nice group to inquire about..!!

-=Virendra Soni=-