cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

React to /n command in sapgui

ioan_radulescu2
Participant
0 Likes
1,837

Hi guys,

I'd like to do some clean-up if the user ends the program by entering a new transaction code in the command field of sapgui with /n. I though module XXX at exit-command would help but alas no the code didn't seem to execute when leaving the program by /n.

Is it possible to react to that at all?

View Entire Topic
pokrakam
Active Contributor

/n is specifically there to immediately abort whatever session/transaction you're in. Do not communicate to the running app, do not pass go, do not collect $200, just quit.

In other words, you should handle it in the same way as the possibility your user might drop the network connection, go to lunch, close SAPGUI, or just bluescreen.

ioan_radulescu2
Participant
0 Likes

Nice reference to Monopoly there! I wanted to clean up some controls and since I can't use a destructor in ABAP...

pokrakam
Active Contributor
0 Likes

Yes that was the intent 🙂

The session releases all references and the garbage collector will do the clearing. In some ways the garbage collector is one reason why ABAP doesn't have (need?) destructors.

ioan_radulescu2
Participant
0 Likes

yes, there was some reuse in some obscure part of my own code which was corrupting memory references (it's a moderately complex thing with 2 different types of controls - the HTML container was the problem - in GUI application). It was complicated but basically SAP is doing everything right and just have to know a bit better what the GUI controls do. But apparently decades of experience will still not suffice.