Double CFL Open after Selection on Combo Box
I am hanging with one issue.. that is really so different and i never faced this type of issue in my experience.. this issue is coming with sales documents. i have to select a combo value after selection of Business Partner.if i am selecting a business partner by the simple way then i have no issue. and my code is working fine... but if i am doing like :
Type C00* in Customer edit text then tab .
after that i can seems there are 2 or more Customer.
if i am selecting any one from all then i have to select combo value corresponding Customer.
if i am doing this then one more CFL is Open... and if i select on another CFL then Application goes to crash.
Sample of Code
oCFLEvento = pVal
If Not oCFLEvento.SelectedObjects Is Nothing Then
objCombo = objForm.Items.Item("ProjCode").Specific
If oCFLEvento.ItemUID = "4" Or oCFLEvento.ItemUID = "54" Then
Dim BPCode As String = String.Empty
BPCode = objUtility.SelectBP(oCFLEvento.SelectedObjects.GetValue(0, 0).ToString().Trim())
Dim A As SAPbouiCOM.Form
A = objSBOAPI.SBO_Appln.Forms.ActiveForm
If A.Title = "List of Business Partners" Then
' i am struck here...when combo is selecting value.. if i comment those lines(2 lines like objcombo.select.....) then no issue. and as u know this is System Form so i can't use datasource.
Please help me ASAP... looking for genious's reponse.
Binita Joshi replied
It will always open double CFL since any invoked UI event like combo select or click again fires the original event. but, if what all you want to do is to select a value in combo box when a customer is selected then you can use Lost_Focus event like :
If pVal.FormType = "139" And pVal.ItemUID = "4" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_LOST_FOCUS And pVal.Before_Action = False Then Try oform = SBO_Application.Forms.GetFormByTypeAndCount("139", 1) If oform.Items.Item("4").Specific.value <> "" Then ocm = oform.Items.Item("cmb").Specific Dim i As String i = ocm.Selected.Value If i <> "0" Then '--put here your selection function for combobox ocm.Select(0, SAPbouiCOM.BoSearchKey.psk_Index) End If End If Catch ex As Exception MsgBox(ex.Message) End Try End If
hope it helps.