‎2005 Jul 12 11:04 AM
Hi all,
i have to perform certain selection option checks if the program is <b>executed in foreground only</b>..
For this i am checking SY-BATCH within start-of-selection and then perform the selection option checks .. If selection option checks are not satisfied i display error message...now this error message is not displayed at the selection screen since i have written the code within START-OF-SELECTION...
I need to display this error message at the selection screen..
If i write the code within AT-SELECTION-SCREEN i am unable to check whether the program is executed in background or foreground since SY-BATCH is not filled.
Thanks,
Swathi.
‎2005 Jul 12 1:04 PM
Hi,
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'ONLI'.
foreground processing
WHEN 'SJOB'.
background processing
ENDCASE.
I hope that it will work.
Svetlin
Message was edited by: Svetlin Rusev
‎2005 Jul 12 11:10 AM
Hi Swathi,
Just have your checks in the ST SELECTION-SCREEN event. If the program is executed in foreground these checks will be performed. If it is executed in the background, the code within the AT SELECTION-SCREEN is not going to be executed anyways.
And you do not have to check for the SY-BATCH value at any point.
Does that clear the problem ?
Regards,
Anand Mandalika.
‎2005 Jul 12 11:18 AM
Hi Anand,
The checks in the SELECTION-SCREEN ST are performed irrespective of the program been executed in foreground or background.
Thanks,
Swathi.
‎2005 Jul 12 11:33 AM
Hi,
If the issue is to displaying the error message in selection screen, you can use leave list-processing the moment you give the error message after the validation in Start-of-selection event.
Hope this helps,
Rgds,
‎2005 Jul 12 11:55 AM
Hi,
The execution of program stops after the display of error message...So the command LEAVE LIST-PROCESSING is not executed.
if i use the command LEAVE LIST-PROCESSING before the message then how do i display the error message????
Thanks,
Swathi
‎2005 Jul 12 12:07 PM
Hi,
Please change the message type to 'S', this should help.
Rgds,
‎2005 Jul 12 1:05 PM
Hi,
user wants the message to be an error message...
thanks,
Swathi
‎2005 Jul 12 1:13 PM
As far as I understood this a normal report executed in foreground via 'Execute' button (F8). If I am right you can check the foreground processing through the triggered function code, instead of sy-batch, which for 'F8' is 'ONLI' ( sy-ucomm field ).
‎2005 Jul 12 1:17 PM
Hi,
As far as I know, then there is no other option than validating in at selection-screen on field event.
Rgds,
‎2005 Jul 12 1:04 PM
Hi,
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'ONLI'.
foreground processing
WHEN 'SJOB'.
background processing
ENDCASE.
I hope that it will work.
Svetlin
Message was edited by: Svetlin Rusev
‎2005 Jul 12 2:17 PM
try this
In start-of-selection.
If <your condition>.
message s398(00) with text-001.
stop.
endif.