‎2010 Aug 25 2:31 AM
Hi Experts,
In my nodule Pool Screen , i want to handle the Window Close button ( The One on the top Right corner, with the maximize and minimize button). Please share your thoughts on this.
Thanks in Advance.
Regards,
Murali
‎2010 Aug 25 5:25 AM
Hi,
Place a BREAK-POINT in PAI and after Clicking that button check the Value of SY-UCOMM in debugger i think it will be CANCEL.
Thanks and Regards,
Faisal.
‎2010 Aug 25 10:07 AM
This will only work in a Pop-Up dynpro. In this case the ok_code corresponds to the function code assigned to F12 key.
In a normal dynpro you can't catch the Windows Close Event. This is basically the same as when you switch off the PC without logging off from SAPGUI. It's not possible to handle this kind of events because the PAI is not processed in such scenarios.
‎2010 Aug 25 11:58 AM
Thanks Adrian for your response.
Even on my analysis, it seems to be impossible. But only one thing which stops me from exploring more is , When you Try to Close the Last Window for that session. The GUI prompts " Do u Want to Log Off ?" kind of message . I tried Debugging on that point , but it is not working ( It Just Stops at the function Module Call for the POP Up). No evidence on when or through which program it is called.
Does anyone tried any workaround ? My client Wants the confirmation ( Like " Do u want to exit without saving data ? ")on pressing the Close button of the Window. Please suggest me your ideas.
Thanks in Advance,
Murali
‎2010 Aug 25 12:33 PM
My client Wants the confirmation ( Like " Do u want to exit without saving data ? ")on pressing the Close button of the Window.
You can explain your client that this is standard SAP funcionality and seems there is no standard mechanism which will allow to "plug in" somewhere and suppress this pop up.
If he really wants to close all SAP GUI windows without confirmation he can type /nex in command line . This will close all sessions from the client immediatelly.
Alternatively he can create a simple text file and store it on desktop, then just drag and drop it to any SAP window
[FUNCTION]
Command=/nex
Type=SystemCommand
Regards
Marcin
‎2010 Aug 25 4:56 PM
@ Marcin:
I think Murali doesn't want to suppress the confirmation, but the opposite: He wants to achieve an confirmation.
>
> Thanks Adrian for your response.
>
> Even on my analysis, it seems to be impossible.
It is impossible indeed.
>
But only one thing which stops me from exploring more is , When you Try to Close the Last Window for that session. The GUI prompts " Do u Want to Log Off ?" kind of message .
True. The R/3-tashandler actually gets control when you press the "close window" button. But the taskhandler doesn't invoke the PAI module in this scenario. So basically your goal would be technically feasible, however not in the ABAP world, but only in the C world (the taskhandler is part of the R/3 kernel written in C and of course nobody except SAP is allowed to change this coding).
>
Does anyone tried any workaround ? My client Wants the confirmation ( Like " Do u want to exit without saving data ? ")on pressing the Close button of the Window. Please suggest me your ideas.
The only workaround is "educating" the end users. I believe that in many SAP application trainings the end users are told to use only the "back" and the "cancel" buttons inside the application instead of using the "close window" button. You will need to make this clear to your end users.
‎2010 Nov 17 3:08 PM
Is it possible to Disable the 'close' button on ALV screen window OR change its functionality to be same as 'Back' button functionality?