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.