Skip to Content

I have a call to Application.Form.Close(), which does not return in my addon. Has anybody seen this?

Jul 17, 2017 at 10:00 AM


avatar image


I have an addon with several forms involved, and users have been complaining that SAP B1 freezes completely, and that it does not recover. On examining the code, I have observed that our master form is creating a popup (filter box) which in turn self-clicks OK to create another data form. Both forms appear, and function as expected.

The problem arises when the top-of-stack form gets closed - the SAP B1 environment intermittently locks up. By step-debugging, I can determine that a call to Application.Forms.Item(formid).Close() never returns.

I have discovered that if the SAP B1 windows is minimised by clicking the windows toolbar icon, the Close() command then completes. When the window is restored, the system is once again functional. Strangely, killing the Addon (from debugger or task manager) does not allow SAP B1 environment to recover, so this odd state is within SAP itself.

This issue is intermittent (about one in 12 attempts), and only appears to occur when SAP User has a Limited License (not a Pro license). We're running this on SAB B1 for HANA PL06.

I'm suspecting that this is an issue in SAP B1, rather than my addon, but I thought that I'd ask, does anybody have a clue what might be going on?



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Mark Rabjohn Aug 10, 2017 at 08:58 AM


This issue seems to occur in SAP B1 V9.2 PL05 and higher (we certainly have reports of event based wierdness in these versions).

I have worked out that the precise scenario is as follows:

Child form closes - event chain:

i) before FORM_CLOSE

ii) before VALIDATE

iii) after VALIDATE

iv) after LOSTFOCUS

v) after FORM_CLOSE

vi) before FORM_UNLOAD

vii) after FORM_UNLOAD

Our framework has *Always* closed parent forms on "after et_FORM_UNLOAD", which causes the following chain of events in the context of the parent form.

viii) before FORM_CLOSE

ix) before VALIDATE

x) after VALIDATE

xi) after LOST_FOCUS

xii) after FORM_CLOSE

xiii) before UNLOAD

xiv) after UNLOAD

Now the 'after UNLOAD' handler returns, but the original Child form Close instruction never returns and SAP locks up. Oddly there is another event raised in the context of the previously unloaded child form:

xv) after UNLOAD

So basically, if you close a form whilst the API is processing an 'after UNLOAD' event, SAP locks up. Moving the second form close instruction to 'after CLOSE' instead appears to workaround the issue.

Clearly the eventing behaviour in this regard has changed between patch levels somewhere. I can now work out how to workaround this issue, but I don't know how to report this as a fault to SAP - does anybody know the process for reporting B1 API faults to SAP?



Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Mark,

You can create an incident to your partner or SAP and get SAP Support. Kindly refer to SAP Note 722980 for the same.

Kind regards,


SAP SME Support