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 message error

Former Member
0 Kudos

Hi everyone,

I have an alv report.when the user clicks a toolbar button on alv report some transaction runs in the background.When the user again clicks again the same button while still the background job is running i need to pop up a error message saying that already background job is running for this routine.How can i do that?any sample code please?

Thank you.

5 REPLIES 5

Former Member
0 Kudos

HI,

If the user Press the Button, then check whether the background is running , if the nackground is running then raise a pop-up and give a mesage saying that 'A background program is still running'.

to check whether the Background is running or not ---> Goto Table TBTCO, then give the Job name and get the status, if the status is still running then give the message, if the status is completed then run the job

Regards

Sudheer

0 Kudos

Hi sudheer,

Can u give me any sample code so that that will be clear to me?

0 Kudos

Hi,

write following code after the button click action:

select * from tbtcp into table i_tbtcp where progname = 'ZXXXXX'.

if sy-subrc = 0.

loop at i_tbtcp.

if i_tbtcp-status = 'R'.

  • message for program already running

endif.

endloop.

endif.

Former Member
0 Kudos

Just keep track of whether or not the transaction has been submitted. If it has, give an error.

Rob

Former Member
0 Kudos

Hi

In the Interactive Event for that Button call the transaction SM36 by scheduling that Job by calling the fun module JOB_OPEN,...JOB_CLOSE..

and when next time pressed write a select for the tables

TBTCP,TBTCO,TBTCS and fetch the data for that program and job, it will give the SJOB status

based on the status you can call a Progress Indicator fun module or popup to display the status of the job

Regards

Anji