In reports,if we want to validate the selection screen entries, we handle it in 'AT SELECTION-SCREEN' event. If we do any action in selection screen (like press enter or go for further selection) this event will be triggered. It will take more time to enter data. To avoid it, we can check the SY-UCOMM, and process the validation. We can skip the data validation, if we run the program in background. It may be helpful in some scenarios.
TABLES: SSCRFIELDS, BUKRS. SELECT OPTIONS: S_BUKRS FOR T001-BUKRS. AT SELECTION-SCREEN. IF SSCRFIELDS-UCOMM EQ 'ONLI'. SELECT SINGLE * FROM T001 WHERE BUKRS IN S_BUKRS. IF SY-SUBRC NE 0. SET CURSOR FIELD 'S_BUKRS-LOW'. MESSAGE E001(XX) WITH S_BUKRS-LOW. ENDIF. ENDIF.