This is the entire FORM routine that is needed to implement a custom selection screen for SM30 with the event AA.
* Define a custom selection screen. SELECTION-SCREEN BEGIN OF SCREEN 10. PARAMETERS p_bukrs TYPE bukrs. SELECTION-SCREEN END OF SCREEN 10. * This form is called to restrict the selection FORM custom_selscreen. * Read all data into TOTAL first PERFORM table_get_data. * Call the custom selscreen as a popup CALL SCREEN 10 STARTING AT 20 10. * If the user didn't enter anything, don't filter CHECK p_bukrs IS NOT INITIAL. * Define a structured variable to read data DATA BEGIN OF ls_total. INCLUDE TYPE zmytable. INCLUDE TYPE vimtbflags. DATA END OF ls_total. * Now apply the filter LOOP AT total. * Move data so it is accessible via structure ls_total = total. * Check if the given BUKRS is contained IF NOT ls_total-bukrs = p_bukrs. * Filter rows DELETE total. ENDIF. ENDLOOP. ENDFORM.