if you use 2 windows and wait-for operator inside of module there is a global stack of called modules.
So if you close first module in stack it will close all windows in stack called next after it.
There is a method to change it:
Your program have only 1 wait-for for whole application. - in main module.
All other modules called from main module should be
run PERSISTENT modulename (module parameters).
Inside of called module should be part:
ON CLOSE OF THIS-PROCEDURE
Do:
RUN disable_UI.
End.
MAIN-BLOCK:
DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:
RUN enable_UI.
some code.
IF NOT THIS-PROCEDURE
ERSISTENT THEN
WAIT-FOR CLOSE OF THIS-PROCEDURE.
END.