it directly exits the application
It is not clear what you mean by 'application'. Typically, there is a program that issues the DISPLAY service. When you press PF3, that translates to return code=8 from the DISPLAY service. Your program has to tolerate that return code.
And you mention more than one panel... it is your program logic that needs to handle what happens when PF3 is pressed on a panel.
Show us your panel definitions and your application program.