Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

what the ok_code for closing the gui window at the top right screen?

Former Member
0 Kudos

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?

4 REPLIES 4

adrian_dorn
Active Participant
0 Kudos

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.

0 Kudos

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

0 Kudos

> 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

Sandra_Rossi
Active Contributor
0 Kudos

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.