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

Execute in background

Former Member
0 Likes
2,329

Hello,

Is there a way to disable the execution button of a selection-screen leaving only the option of "Execute in background" or changing the behaviour of the execution button so it executes the report in background?

Thank you,

Nuno Silva

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,440

Hi ,

chk this code



REPORT  ztest_cha5.


DATA itab TYPE TABLE OF sy-ucomm.
PARAMETERS test(10) TYPE c.

AT SELECTION-SCREEN OUTPUT.
  APPEND 'ONLI' TO itab.
  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
    EXPORTING
      p_status  = sy-pfkey
    TABLES
      p_exclude = itab.

7 REPLIES 7
Read only

Former Member
0 Likes
1,440

Quick way is you can code into the program with appropriate message if program is run in foreground mode, use system variable to determine for if program run in background.

Read only

Former Member
0 Likes
1,440

hi..

check for variable sy-batch if its 'X' program is running in background else show error message

regards

vivek

Read only

0 Likes
1,440

But is it not possible to make the program execute itself in background when it is running in foreground?

Thank you

Nuno Silva

Read only

0 Likes
1,440

I dont think its possible

When the selection screen appears, just press F9 to execute the program in background and not F8.

Regards,

Shailaja

Read only

Former Member
0 Likes
1,441

Hi ,

chk this code



REPORT  ztest_cha5.


DATA itab TYPE TABLE OF sy-ucomm.
PARAMETERS test(10) TYPE c.

AT SELECTION-SCREEN OUTPUT.
  APPEND 'ONLI' TO itab.
  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
    EXPORTING
      p_status  = sy-pfkey
    TABLES
      p_exclude = itab.

Read only

former_member70391
Contributor
0 Likes
1,440

Hi Nanu,

Do the following,

The standard gui status for the selection screen 1000 is %_00 and its program is RSSYSTDB.

Now go to SE41 and Enter your program Name and enter the status say ZTEST.

Now click on Copy Status button in the application Toolbar next to user interface.

A pop window will appear enter the details as follows,

FROM :

Program Name : RSSYSTDB

Status : %_00

To :

Program name : your Program Name

Status : ZTEST

Click on copy, a pop up window appears again click COPY. Now you will get a message Status RSSYSTDB %_00 copied to ZTEST01 ZTEST.

Now go to Change Mode, Go to Node: Menu bar and double click on PROGRAM and remove ONLI.

Application Toolbar and remove the Item ONLI and

go to Function Keys Node and remove ONLI from Freely Assigned Function Keys. Activate your Status.

Now in your program use the status example: make sure that all ONLI is removed in your status.

REPORT ZTEST01.

set pf-status 'ZTEST'.

parameters: c(10) type c.

-


-


Thanks & Regards,

Nagaraj Kalbavi

Read only

Former Member
0 Likes
1,440

Hi Nuno Silva,

With the above two reponses ie., copying the status of the mentioned program and using it in the program with the Quoted FM is very helpful and solves the problem by using the following code.

A small change you could do is ..in the status remove 'ONLI' and put 'SJOB'. This solves your problem.

DATA itab TYPE TABLE OF sy-ucomm.
PARAMETERS test(10) TYPE c.
set pf-status 'ZTEST'.

AT SELECTION-SCREEN OUTPUT.
  APPEND 'ONLI' TO itab.
  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
    EXPORTING
      p_status  = 'ZTEST'
    TABLES
      p_exclude = itab.

Thanks Chandrashekhar and Nagraj. I didn't know we can do like that. Those were very useful posts.

Regards,

Shailaja