Skip to Content

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

Load dropdown

I have created a form through screen painter.I have added a dropdown in the form and I want to load items in it.I want to set itemcode as its value and itemname as its text.I as able to access this dropdown an vb.net as,

Dim ddlGroup As SAPbouiCOM.ComboBox

ddlGroup = objForm.Items.Item("11").Specific

How can I load values in this dropdown ?Datasource property is missing in for dropdown.

Former Member
Former Member replied

Dilip,

Try this

Rec = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

CQ_Frm = app.Forms.ActiveForm

qry = "Select itemcode,itemname from OITM"

Rec.MoveFirst()

oCmb = CQ_Frm.Items.Item("c_item").Specific

Rec.DoQuery(qry)

If oCmb.ValidValues.Count = 0 Then

For i = 0 To Rec.RecordCount - 1

oCmb.ValidValues.Add(Rec.Fields.Item(0).Value, Rec.Fields.Item(1).Value)

Rec.MoveNext()

Next

oCmb.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)

End If

If this answer is helpful give me reward points.

Thanks & Regards,

Anitha

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question