This requirement can be completed in couple of steps. First of all write down the selection screen code for button to display in the screen.
"This code will button to application toolbar
SELECTION-SCREEN FUNCTION KEY 1.
Now we need to put some meaningful text for that button.
INITIALIZATION .
Data: FUNCTEXT type smp_dyntxt.
Clear Functext.
Functext-text = 'Display'.
sscrfields-functxt_01 = functext.
You can multiple buttons this way.....
Next we need to assign some action to this button to work properly. For that we have to assign the PF status first.
AT SELECTION SCREEN OUTPUT.
Set PF-STATUS 'ZTEST'.
Double click on that ZTEST and do the configuration. Provide a function code there, e.g. "DISP" . Then you can use the function code to catch the button press and based on that write code. If you like to do anything on screen itself, like to hide something, write the code below
AT SELECTION-SCREEN OUTPUT.
if sy-ucomm = 'DISP'.
your code here
endif.
If you want to revoke some other functionality in the main code, then write in start-of-selection the below code
if sy-ucomm = 'DISP'.
your code here
endif.