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 execution

Former Member
0 Kudos

Thank you guys,

I have one more problem.

When i click clock button(Execute button), iwant to

execute the program in background.

Howto do this..

i know to check with background..ie..sscrfields-ucomm =' SJOB'.

For Online do we have to check for any value at screenfields?

could you pls help me out.

ambichan.

7 REPLIES 7

Former Member
0 Kudos

Hi,

Take a look at SUBMIT (report) USER user VIA JOB job NUMBER n. Do an F1 on SUBMIT statement.

To check whether you are in background or foreground mode, check the value of sy-batch.

If you are using CALL TRANSACTION, use addition MODE 'N' for background, and UPDATE 'A' for asynchronous update.

Regards

Message was edited by: Shehryar Khan

0 Kudos

thanks for your reply.

i checked sy-batch, i guess its initial.

can we submit the same program once again to execute in background..as below

if sy-batch is initial.

submit zglto_shintani003 and return

user sy-uname via job jobname number jobcount.

endif.

i think its wrong way of coding..how to do this..

my program is "zglto_shintani003" when i click execute button it should work in background.

anything have to do now... i have not wrote anycode for background process inside program.

ambichan.

0 Kudos

Actually, when i click execute button, i want to call the

Background execution Function code.

if i say simple words, I want my Online Execute button to act as "Background Execution Button".

Is it possible?

ambichan.

0 Kudos

Hello Ambichan,

Did the code I gave you below fail to give you the desired functionality?

Regards,

Anand Mandalika.

0 Kudos

Hi,

I think Anand just answered that...right?

Regards

0 Kudos

Hello Ambichan,

The code you have written is not wrong at all !! That is exactly how it is supposed to be written. I would suggest that you also take a look at this post which I think is relevant :

Regards,

Anand Mandalika.

Former Member
0 Kudos

Hello Ambichan,

The normal Execute Button has the Function Code <b>ONLI</b>. you will just have to set this to <b>SJOB</b> in the PAI to make the same button trigger the Background job.

Look at this code...

tables sscrfields.

parameters p_test.

at selection-screen.
  if sscrfields-ucomm = 'ONLI'.
    sscrfields-ucomm = 'SJOB'.
  endif.

start-of-selection.
  write p_test.

Get back if you have any doubts.

Regards,

Anand Mandalika.