Getting the Selected Function Code 
You can call functions for processing user actions in the PAI of your tab page in the usual manner, depending on the function codes assigned on the screen.
The function code triggered on your tab page is only known on the SAP main screen. You must request it in the PAI of your tab page from the SAP main screen.
The relevant macro is:
SWL_WIDISP_GET_OKCODE
The macro could be implemented as follows:
Syntax
data: okay like sy-ucomm.
[...]
clear okay.
swl_widisp_get_okcode okay.
case okay.
when ´XXX1´.
perform [...]
when ´XXX2´.
perform [...]
[...]