Skip to Content

catch close event in order's form

Hello all,

I would like to know what is the event when I close an order in sap form.

Tks for your help.

Laetitia

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2005 at 03:11 PM

    One way of doing it would be to watch for the followng ItemPress events:

    SAP close button ( ItemUID = 2 )

    SAP Ok button ( ItemUID = 1 ), ( when FormMode = OK )

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2005 at 03:52 AM

    Hi Laetitia,

    I think catching form close Item event works. Because as I found, when choosing Close menu, a message box will send out saying that do you want to cancel/close form. When you click the button, a form close event will be sent.

    In this case, you could do this with the code below.

    Private Sub m_oApplication_ItemEvent(ByVal FormUid As String, pVal As SAPbouiCOM.ItemEvent, BubbleEvent As Boolean)

    Select Case pVal.EventType

    Case et_FORM_CLOSE

    MsgBox "Catch!" ' please add your code here.

    End Select

    End Sub

    If this solution does not fit your situation, you can catch the menu event directly. Please refer to the code below.

    Private Sub m_oApplication_MenuEvent(pVal As SAPbouiCOM.IMenuEvent, BubbleEvent As Boolean)

    If pVal.BeforeAction = True Then

    Select Case pVal.MenuUID

    Case "1286"

    ' Do whatever you want here.

    End Select

    End If

    End Sub

    Hope these two solutions work.

    Best Regards,

    Nicky He

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.