Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9091

Re: How can I know if a particular button in SAP B1 has been pressed?

$
0
0

Hi Ankit,

 

I appended your code (for checking whether the user has clicked YES on the ReconciliationScreen) to my code (for opening the SAP B1 Reconciliation Screen).

 

I am very pleased to inform you that the arrangement works perfectly, much to my amazement!

 

I only made a few minor adjustments to your code, which now reads as follows:

 

 

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

 

        If pVal.BeforeAction = False And pVal.FormType = 0 Then

            If 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

 

 

                        Dim oStatic As SAPbouiCOM.StaticText

                        oStatic = oMessageForm.Items.Item("7").Specific

                        If (oStatic.Caption = "Reconcile the selected transactions?" And pVal.ItemUID = "1") Then

 

                           SBO_Application.MessageBox("OK")

 

                         Exit For

                        End If

                    End If

                Next

            End If

        End If

 

========

The only problem is that I chose a simple code to test if my code is executed:

SBO_Application.MessageBox("OK")


It fires many times, and the reason is that it's a message box.

Once I will have replaced it by my real code, the problem will disappear



So, many many thanks for helping me to do something which I thought was impossible.

 

Best Regards


Leon



Viewing all articles
Browse latest Browse all 9091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>