Below is the code snippet
Function : 'RS_SET_SELSCREEN_STATUS' .
FORM remove_dynamic_sel .
DATA: t_exclude TYPE STANDARD TABLE OF sypfkey.
APPEND 'DYNS' TO t_exclude.
"DYNS is the dynamic selection screen function code.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
TABLES
p_exclude = t_exclude.
ENDFORM.