Skip to Content
0
Former Member
Nov 08, 2005 at 01:45 PM

Add-On Performance

111 Views

I developed and add-on to substitute the Choose From List with a Formatted Search for everytime I pressed the Tab Key calling the Send Key method.

The code is the following :

Private Sub applic_ItemEvent(ByVal FormUID As String, pVal As SAPbouiCOM.IItemEvent, BubbleEvent As Boolean)

Dim frm, frmAnterior As SAPbouiCOM.Form

Dim itm As SAPbouiCOM.Item

Dim sCustomerName, lResult As String

Dim dsa_Matrix As New SAPbouiCOM.Matrix

Dim dsa_Field As New SAPbouiCOM.EditText

Dim dsa_Field1 As New SAPbouiCOM.EditText

Dim dst_Value, dst_ValueDesc As String

If pVal.FormType = 149 And pVal.ItemUID = "38" And pVal.EventType = et_KEY_DOWN And pVal.CharPressed = "9" And pVal.BeforeAction = True Then

Set dsa_Matrix = applic.Forms.Item(pVal.FormUID).Items("38").Specific

.

.

.

If dst_Value = "" And dst_ValueDesc = "" Then

BubbleEvent = False

Call applic.SendKeys("+")

End If

End If

This example is just for the Sales Order Form, I used the <b>If Statement</b> for all the sales and purchase forms, but it completly slow the performance of SB1.

Wich is the best way to implement this code with out using If Statement for every form the calls the Inventory ??

Any Help?