Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

RE: CFL Conditions

Hi all,

In my form i have 2 Edittext one for choosing GRNNo from CFL and the other for choosing item details based on the GRNNo from the CFL.

My problem is After choosing the GRNNo i have to set the conditions for the itemCFL which is the item = GRNItem.Then i have load all the items based on the GRNNo in the CFL.

How should i aChieve this....:-)

Regards

Mohana

replied

hi Mohana,

here is the solution for CFL Conditions.

create a Global Integer

eg:Public CFL_UDOInt as integer=1000

add the below code under the validate or lost focus event of GRNNo field.

Private Sub AddChooseFromList()

Try

Dim GRNNo as String =oForm.Items.Item("GRNNoTextUID").Value

Dim RS As SAPbobsCOM.Recordset = Nothing

RS = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

RS.DoQuery("select T1.ItemCode from OPDN T0,PDN1 T1 where T1.DocEntry=T0.DocEntry and T0.DocNum='" & GRNNo & "'")

CFL_UDOInt += 1

public CFL_UDOStr as String =String.Concat("CFL",CFL_UDOInt)

Dim oCFLs As SAPbouiCOM.ChooseFromListCollection

Dim oCons As SAPbouiCOM.Conditions

Dim oCon As SAPbouiCOM.Condition

oCFLs = oForm.ChooseFromLists

Dim oCFL As SAPbouiCOM.ChooseFromList

Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams

oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)

' Adding 2 CFL, one for the button and one for the edit text.

oCFLCreationParams.MultiSelection = False

oCFLCreationParams.ObjectType = "4"

oCFLCreationParams.UniqueID = CFL_UDOStr

oCFL = oCFLs.Add(oCFLCreationParams)

' Adding Conditions to CFL_UDOStr

oCons = oCFL.GetConditions()

oCon = oCons.Add()

oCon.Alias = "ItemCode"

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

For i As Integer = 1 To RS.RecordCount

If RS.EoF = False Then

oCon.CondVal = RS.Fields.Item("ItemCode").Value

If Not i = RS.RecordCount Then

oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR

oCon = oCons.Add()

oCon.Alias = "ItemCode"

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

End If

End If

RS.MoveNext()

Next

oCFL.SetConditions(oCons)

Catch

MsgBox(Err.Description)

End Try

End Sub

the above code displays only items of PDN1 table.

hope this is your result.

regards,

varma

Edited by: Varma on Oct 21, 2008 2:04 PM

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question