on 01-20-2012 9:21 AM
Experts,
Try
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
If pVal.BeforeAction = False Then
objForm = oform
Dim OCFEvent As SAPbouiCOM.IChooseFromListEvent
OCFEvent = pVal
Dim SFcl As String
SFcl = OCFEvent.ChooseFromListUID
Dim OCFl As SAPbouiCOM.ChooseFromList
OCFl = objForm.ChooseFromLists.Item(SFcl)
If OCFEvent.Before_Action = False Then
Dim ODataTable As SAPbouiCOM.DataTable
ODataTable = OCFEvent.SelectedObjects
Select Case pVal.ItemUID
Case "4"
Dim Str As String
Dim ORec As SAPbobsCOM.Recordset
Dim OPROD As SAPbobsCOM.Recordset
OPROD = objSBOAPI.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Str = "Select * from [@Table] where DocEntry='" & ODataTable.GetValue("DocEntry", 0) & "' and Series='" & ODataTable.GetValue("Series", 0) & "'"
ORec = objSBOAPI.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
ORec.DoQuery(Str)
If ORec.EoF = False Then
Try
objForm.Items.Item("4").Specific.value = ORec.Fields.Item("DocNum").Value
Catch ex As Exception
End Try
End If
End Select
End If
End If
End Select
Catch ex As Exception
End Try
This code is written but i am unable to select the choose from list items, i am unable to see anything wrong in code above. Pelase help. It is taking click event.
Any suggestions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi trying this one
If pVal.BeforeAction = False Then
If (pVal.FormType = 142) Then
Select Case (pVal.ItemUID)
Case "Vendor"
Select Case (pVal.EventType)
Case SAPbouiCOM.BoEventTypes.et_GOT_FOCUS
Dim sQuery As String = "SELECT T0.[U_Col_SupId], T0.[U_Col_SName] FROM [dbo].[@COMQUOT_DETAIL] T0 inner join [dbo].[@COMQUOT_HEADER] T1 on t0.docentry=t1.docentry WHERE T0.[U_COl_RO]='Yes' and T1.[U_ReqNo] = '" & oOrderForm.Items.Item("EditDS").Specific.Value & "'"
oGeneral.SetConditionToCFL1(oOrderForm, "CFL2", "cardcode", sQuery)
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
Dim bonCflEvents As SAPbouiCOM.ChooseFromListEvent
Dim bonCflList As SAPbouiCOM.ChooseFromList
Dim bnnstrUID As String
Dim bonDTTable As SAPbouiCOM.DataTable = Nothing
bonCflEvents = pVal
bnnstrUID = bonCflEvents.ChooseFromListUID
bonDTTable = bonCflEvents.SelectedObjects
bonCflList = oOrderForm.ChooseFromLists.Item(bnnstrUID)
If bonCflEvents.BeforeAction = False Then
If oOrderForm.Mode <> SAPbouiCOM.BoFormMode.fm_FIND_MODE Then
If Not (bonDTTable Is Nothing) Then
If bonCflList.UniqueID = "CFL2" Then
If pVal.ItemUID = "Vendor" Then
Try
oOrderForm.Items.Item("Vendor").Specific.value = bonDTTable.GetValue(0, 0)
Catch ex As Exception
End Try
End If
End If
Else
End If
End If
End If
End Select
End Select
End If
End If
Sub SetConditionToCFL1(ByVal ponFrmForm As SAPbouiCOM.Form, ByVal strCFL_ID As String, ByVal pnnStrAlias As String, ByVal strQuery As String)
Dim oCFL As SAPbouiCOM.ChooseFromList = ponFrmForm.ChooseFromLists.Item(strCFL_ID)
Dim oConds As SAPbouiCOM.Conditions
Dim oCond As SAPbouiCOM.Condition
Dim oEmptyConds As New SAPbouiCOM.Conditions
Dim rsetCFL As SAPbobsCOM.Recordset = gonComCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
oCFL.SetConditions(oEmptyConds)
oConds = oCFL.GetConditions()
Try
rsetCFL.DoQuery(strQuery)
rsetCFL.MoveFirst()
For i As Integer = 1 To rsetCFL.RecordCount
If i = (rsetCFL.RecordCount) Then
oCond = oConds.Add()
oCond.Alias = pnnStrAlias
oCond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCond.CondVal = Trim(rsetCFL.Fields.Item(0).Value)
Else
oCond = oConds.Add()
oCond.Alias = pnnStrAlias
oCond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCond.CondVal = Trim(rsetCFL.Fields.Item(0).Value)
oCond.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR
End If
rsetCFL.MoveNext()
Next
If rsetCFL.RecordCount = 0 Then
oCond = oConds.Add()
oCond.Alias = pnnStrAlias
oCond.Relationship = SAPbouiCOM.BoConditionRelationship.cr_NONE
oCond.CondVal = "-1"
End If
oCFL.SetConditions(oConds)
Catch Ex As Exception
gonAppApplication.MessageBox(Ex.Message)
Finally
End Try
End Sub
Thanks & Regards
B.Lakshmi narayanan
User | Count |
---|---|
98 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.