Skip to Content
0

How can we catch the After Pressed Event of the Reconcile Button in SAP?

Nov 04, 2016 at 06:18 AM

92

avatar image

Hi, everybody

capture.jpg

Please see the attached picture which explains my problem.

My code is shown below.

I also attach a .jpg file of My Code below (it is easier to read)

Any help will be much appreciated.

Thanks

Leon

my-code.jpg

------------

ADDED 1:

I replaced all my code with the foll. (simplified) code

If (pVal.BeforeAction = False And pVal.ActionSuccess = True And pVal.FormType = 0

And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK And pVal.ItemUID = "1") Then MsgBox("XXX")

End If

----

BUT the MsgBox pops up whether Reconciliation is successful or not.

What is missing to pop up the MsgBox only if Reconciliation is Successful?

ADDED 2:

I am getting crazy with this problem.

I think the problem is with the System Message box. All System Messages in SAP have the same form type = 0. All "Yes" on these forms have the same Item UID = 1. The only way to distinguish among these System Messages is the Static Text. This is what makes the problem so difficult.

The event I want to capture is the pVal.ActionSuccess = True when the "Yes" button on the System Message form is clicked on, NOT when the "Reconcile" button is clicked.

NOW, CAN ANYBODY HELP ME?.

Thanks

Leon

''===========================================================
'' //RECONCILIATION SUCCESSFUL - ADD "OK" IN RECON COLUMN
''===========================================================

        If pVal.BeforeAction = False And pVal.FormType = 0 And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK = True Then
            Dim oMessageForm As SAPbouiCOM.Form
            oMessageForm = SBO_Application.Forms.Item(pVal.FormUID)
            Dim oitem As SAPbouiCOM.Item
            For Each oitem In oMessageForm.Items

                If SAPbouiCOM.BoFormItemTypes.it_STATIC And oitem.UniqueID = "7" Then
                    '// 7 = System Message "Reconcile the selected transactions?"
                    Dim oStatic As SAPbouiCOM.StaticText
                    oStatic = oMessageForm.Items.Item("7").Specific
                    If oCumTotal = 0 And (oStatic.Caption = "Reconcile the selected transactions?" And pVal.ItemUID = "1") Then

                        oGrid.CommonSetting.SetCellBackColor(SelectedRow + 1, 23, 12611584) '// blue color
                        oGrid.DataTable.SetValue("Clk2Recon", oGrid.GetDataTableRowIndex(SelectedRow), "OK")


                    ElseIf oCumTotal <> 0 And (oStatic.Caption = "Reconcile the selected transactions?" And pVal.ItemUID = "1") Then
                        StrAmt2Recon = 0
                        oCumTotal = 0

                        Exit For
                    End If
                End If
            Next
        End If


capture.jpg (310.7 kB)
my-code.jpg (103.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers