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

Program Run at Server

Former Member
0 Likes
580

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 .

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
529

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

3 REPLIES 3
Read only

former_member194669
Active Contributor
0 Likes
530

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

Read only

former_member156446
Active Contributor
0 Likes
529

if possible you will run the program in background mode... in any selection screen give your values and hit F9 to execute in background.

Read only

Former Member
0 Likes
529

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.