Hi
you can try these steps and then check the output .
Go to elements list and you will find an empty field with type OK
give ok_code under name
go to top include and write this
data ok_code type sy-ucomm .
come to PAI and write
ok_code = sy-ucomm
now write if conditions or case condition based on your requirement
Note :please clear the ok_code for all the validtions for example
case ok_code .
when save .
clear ok_code .
logic
when 'back' .
clear ok_code .
your logic
endcase .
try these steps , hope it wil work for you
regards
kishore