04-09-2014 5:29 PM
As a requirement , i need to execute the report program in the background only, so when F8 is clicked it showed raise an error.
Please help...
04-09-2014 5:58 PM
Hi Sindhu,
I think you can check the value of system variable SY-BATCH in the report. If it is 'X' then it means the program is ebing executed in background.
Regards.
Rahul
04-09-2014 5:49 PM
Hi sindhurareddy,
Why don´t to code an intermediate program that only call the report in background task and generate a transaction for that program and control the access with roles?
Would be possible that solution?
Cheers.
Antonio.
04-09-2014 6:03 PM
Hello Antonio,
I have to implement the code in the same report program. Can it be possible by capturing the function code of F8 in the report program?
04-09-2014 5:58 PM
Hi Sindhu,
I think you can check the value of system variable SY-BATCH in the report. If it is 'X' then it means the program is ebing executed in background.
Regards.
Rahul
04-09-2014 6:09 PM
Hello Rahul,
If i run the program in the background, will the sy-batch value be automatically updated with 'X'?
04-09-2014 6:23 PM
Yes Sindhu. If the program is executed in background, the value of SY-BATCH will be 'X', and if it is executed in foreground then it will be blank.
Regards,
Rahul.
04-09-2014 7:29 PM
Exactly, you´re right Rahul. I dodn´t realize the more simple and more correct solution, check the old friend sy-*
04-09-2014 6:17 PM
Hi Sindhu,
In addition to Rahul comments, check SYST-CALLD. Hope it is space for foreground and 'X' for background.
With Regards,
Giriesh M
04-09-2014 8:42 PM
You could simply exclude the execute button, like this:
at selection-screen output.
perform disable_online_execution.
form disable_online_execution.
DATA lt_excl TYPE TABLE OF sy-ucomm.
APPEND :
'ONLI' TO lt_excl,
'PRIN' to lt_excl.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
TABLES
p_exclude = lt_excl.
endform.
With this code, the button "Execute" is switched off, the menu paths "Execute" / "Execute and print" will be inactive, and the function key shortcuts to these fcodes are surpressed as well.
Better than offering a button and then shooting at the user with an error "HAHA, NOT ALLOWED!" when he presses it, is not to offer the button from the beginning.
04-09-2014 9:19 PM
You can use SscrFields in the TABLES statement and then check if SscrFields-UCOMM = 'ONLI'. If it is then the user pressed F8.
-Amit.