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

How to Execute the program in foreground

Former Member
0 Likes
1,298

Hi All,

  • ‘Execution in Foreground’ has to be deactivated for the program. Program should be allowed to be executed only in the back ground.

*Spool should provide the list of documents to which changes have applied.

Thanks in Advance,

venkat

4 REPLIES 4
Read only

Former Member
0 Likes
801

Hi venkat,

1. sy-batch.

check this variable in program

if its in backgrounmd, it will be 'X'.

*----


REPORT abc.

START-OF-SELECTION.

IF sy-batch = 'X'.

WRITE 😕 'AAA'.

  • ------- all the code

else.

write 😕 'Foreground not allowed'.

ENDIF.

regards,

amit m.

Message was edited by: Amit Mittal

Read only

Former Member
0 Likes
801

Hi Venkat,

Put the foll. piece of code in your program.

at selection-screen.

if sy-ucomm = 'ONLI'.

message e000(zz)

with

'Execute the report in Background only'.

endif.

or

if sy-ucomm <> 'SJOB'.

message e000(zz)

with

'Execute the report in Background only'.

endif.

Pls. reward the points if it works from ur end.

Thanks

Eswar

Read only

0 Likes
801

Here is another way to go. Instead of checking after the fact, take away the option right away.



report zrich_0003.



* Used to limit user commands on selection-screen
include rsdbc1xx.

* Selection Screen
parameters: p_check type c.

* Events
at selection-screen output.
  append 'ONLI' to current_scr-excl.  " Execute
  append 'PRIN' to current_scr-excl.  " Execute and Print
*  append 'SJOB' to current_scr-excl. " Execute in Background


start-of-selection.

  write:/ 'Start-of-Selection was fired'.


Welcome to SDN!!!!!

Please remember to award points for helpful answers and mark your post as solved when solved completely. Thanks.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
801

Hi,

Use system variable

sy-batch .

if sy-batch eq 'X'.

endif.

Regards

Amole