06-02-2010 2:41 AM
Hi all ,I had created a table for working just like sap standard table locked,what the problem was when the user clicked the screen
top right "X" buuton and the window closed.then I can't react with this event and unlock the record I had locked ,because I do not know the ok_code for this user action. what the ok_code for closing the window at the top right screen? the minsize ?the maxsze?
06-03-2010 3:35 PM
It is not possible to catch events such as "Closing the SAPGUI window" or "switching the power of the PC off". So there is no solution to your problem except that you tell the end users that they should not do things like that.
06-04-2010 2:35 AM
i get it, what i should do is to tell the end uers should not do like that and coding a programe just like SM12
06-04-2010 9:54 AM
> i get it, what i should do is to tell the end uers should not do like that and coding a programe just like SM12
well, you can tell them that currently the program is bugged and they should not close the window until it is corrected (SAP standard programs are well programmed, and user can close window at any time without any bug)
To correct your program, you should understand how to keep [Data Consistency|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/41/7af4b6a79e11d1950f0000e82de14a/frameset.htm] (especially these concepts: SAP LUW, database LUW, lock concept, lock objects, implicit database commits, DB_COMMIT, COMMIT WORK, ROLLBACK WORK)
> coding a programe just like SM12
I guess you mean "coding a programe with lock objects", as SM12 is an administration transaction that does very special things
Edited by: Sandra Rossi on Jun 4, 2010 10:57 AM
06-03-2010 9:41 PM
is that a popup window? (as the one with POPUP_TO_CONFIRM function module for example)
If yes, then the ok_code corresponds to the function code assigned to F12 key.
If no, then see Adrian's answer, with this complement: the window corresponds to an "external mode/session", so when it's closed, all locks (concept of lock objects) are immediately released.