2009 Sep 18 4:15 AM
Dear All experts,
Do anyone know any ideas how to we set the program run at server ? Even though we close our pc ...
Let take a simple example ..... i got program with a screen ,which creat at se80 with two button , "Start " n "Stop". When i press the star button , the time start couting .... after i off my pc , but the program is running with couting at server without stop counting ... Next day , i open back this program .. the couting still running , it will STOP when i press stop button
Normally the program will terminate when we close our pc rite ? Now i want to make my program continue running when I close my pc.
Thanks for help...
Thanks .
2009 Sep 18 4:43 AM
You can do this way.
If sy-ucomm eq 'START'.
call function JOB_OPEN . " So background job will created
..
..
call function SUBMIT_JOB
...
..
call function JOB_CLOSE
..
..
Then store the job name in a custom table
Then you switch on your PC again
if sy-ucomm eq 'STOP'
CALL FUNCTION 'BP_JOB_ABORT' " with job name from custom table
a®
2009 Sep 18 4:43 AM
You can do this way.
If sy-ucomm eq 'START'.
call function JOB_OPEN . " So background job will created
..
..
call function SUBMIT_JOB
...
..
call function JOB_CLOSE
..
..
Then store the job name in a custom table
Then you switch on your PC again
if sy-ucomm eq 'STOP'
CALL FUNCTION 'BP_JOB_ABORT' " with job name from custom table
a®
2009 Sep 18 4:44 AM
if possible you will run the program in background mode... in any selection screen give your values and hit F9 to execute in background.
2009 Sep 18 5:30 AM
first thing about running at server we call it as background program scheduled... so create a back ground job we use tcode SM36. and SM37 to display it.
and from your program, where you have that start and stop button you can trigger a background job which will start counting
and on press of stop you can close the background job and see the result.
though i think its easy to calculate time by storing it in some ztable when you press start and when you press stop just retrieve that value and calculate the time difference...
case sy-ucomm.
when 'START'.
ztable-time = sy-datum.
insert ztable.
when 'STOP'.
select time from ztable up to 1 rows.
timediff = sy-datum - ztable-time.
write : timediff.
endselect.
delete ztable. "->the database table is free again to start a new time,
endcase.