Skip to Content

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

matrix in combox ?

i want to retrive data from table matrix in coloum combo (dd no) . but value not coming

my code

Private Sub DrawRAKELDForm(ByVal oForm As SAPbouiCOM.Form)

'//***************************

'// Adding a Matrix item

'//***************************

oItem = oForm.Items.Add("Matrix2", SAPbouiCOM.BoFormItemTypes.it_MATRIX)

oItem.Left = 5

oItem.Width = 500 ' 350

oItem.Top = 154

oItem.Height = 100

oItem.FromPane = 2

oItem.ToPane = 2

oMatrix = oItem.Specific

oColumns = oMatrix.Columns

'//***********************************

'// Adding Column items to the matrix2

'//***********************************

oColumn = oColumns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)

oColumn.TitleObject.Caption = "#"

oColumn.Width = 50

oColumn.Editable = False

'// Add a column for DD no.

oColumn = oColumns.Add("DDno", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)

oColumn.TitleObject.Caption = "DD No."

oColumn.Width = 80

oColumn.Editable = True

want to select card code in DD no

''''''''''''''''''''''''''''''' may be here some error ''''''''''''''''''''''''''''

'colItemCode = oColumns.Items.item("Matrix1").Cells.Item("ddno").Specific

' AddLogCodeCombo(oForm, colItemCode) '''''' errror

''''''''''''''''''''''''''''''''''''''''''''''''' errror ''''''''''''''''''''''''''''''''''''''

oColumn.DataBind.SetBound(True, "@RAKELD1", "U_draftno")

'// Add a column for DD Date

oColumn = oColumns.Add("DDdt", SAPbouiCOM.BoFormItemTypes.it_EDIT)

oColumn.TitleObject.Caption = "Draft Date"

oColumn.Width = 80

oColumn.Editable = True

oColumn.DataBind.SetBound(True, "@RAKELD1", "U_draftdt")

'// Add a column for Invoice No.

oColumn = oColumns.Add("Drafamt", SAPbouiCOM.BoFormItemTypes.it_EDIT)

oColumn.TitleObject.Caption = "Amount"

oColumn.Width = 80

oColumn.Editable = True

oColumn.DataBind.SetBound(True, "@RAKELD1", "U_draftamt")

'///

oColumn = oColumns.Add("bankname", SAPbouiCOM.BoFormItemTypes.it_EDIT)

oColumn.TitleObject.Caption = "Bank Name"

oColumn.Width = 80

oColumn.Editable = True

oColumn.DataBind.SetBound(True, "@RAKELD1", "U_banknm")

'//************************

'// Adding "Total Amount" Button

'//***********************

oItem = oForm.Items.Add("btnamnt", SAPbouiCOM.BoFormItemTypes.it_BUTTON)

oItem.Left = 216

oItem.Width = 75

oItem.Top = 240

'oItem.Height = 20

oItem.FromPane = 2

oItem.ToPane = 2

oButton = oItem.Specific

'oButton.Caption = "0.00"

'oEdittext.DataBind.SetBound(True, "", "FolderDS")

'//************************

'// Adding "Add Row" button

'//***********************

oItem = oForm.Items.Add("btnrow", SAPbouiCOM.BoFormItemTypes.it_BUTTON)

oItem.Left = 470

oItem.Width = 65

oItem.Top = 220

oItem.Height = 20

oItem.FromPane = 2

oItem.ToPane = 2

oButton = oItem.Specific

oButton.Caption = "Add Row"

''No. of Escorts Edit Box

''SuperVisor Edit Box

oItem = oForm.Items.Add("SupVal", SAPbouiCOM.BoFormItemTypes.it_EDIT)

oItem.Left = 110

oItem.Width = 160

oItem.Top = 265 '300

oItem.AffectsFormMode = True

oItem.LinkTo = "SupTxt"

oEdittext = oItem.Specific

oEdittext.DataBind.SetBound(True, "@ORAKELD", "U_suprvsr")

''Remarks Edit Box

oItem = oForm.Items.Add("RmkVal", SAPbouiCOM.BoFormItemTypes.it_EXTEDIT)

oItem.Left = 110

oItem.Width = 160

oItem.Top = 285 '320

oItem.AffectsFormMode = True

oItem.LinkTo = "RmksTxt"

oEdittext = oItem.Specific

oEdittext.DataBind.SetBound(True, "@ORAKELD", "U_remark")

''Name of Security Firm Edit Box

oItem = oForm.Items.Add("EnoVal", SAPbouiCOM.BoFormItemTypes.it_EDIT)

oItem.Left = 376 '430

oItem.Width = 160 '105

oItem.Top = 265

oItem.AffectsFormMode = True

oItem.LinkTo = "EscnoTxt"

oEdittext = oItem.Specific

oEdittext.DataBind.SetBound(True, "@ORAKELD", "U_escort")

oItem = oForm.Items.Add("FmnmVal", SAPbouiCOM.BoFormItemTypes.it_EDIT)

oItem.Left = 376 '430

oItem.Width = 160 '105

oItem.Top = 285

oItem.AffectsFormMode = True

oItem.LinkTo = "FirmnmTxt"

oEdittext = oItem.Specific

oEdittext.DataBind.SetBound(True, "@ORAKELD", "U_firmnm")

'//************************

'// Adding a OK button

'//************************

oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)

oItem.Left = 5

oItem.Width = 65

oItem.Top = 355

oItem.Height = 20

oButton = oItem.Specific

'//************************

'// Adding a Cancel button

'//***********************

oItem = oForm.Items.Add("2", SAPbouiCOM.BoFormItemTypes.it_BUTTON)

oItem.Left = 75

oItem.Width = 65

oItem.Top = 355

oItem.Height = 20

oButton = oItem.Specific

oForm.DataBrowser.BrowseBy = "ChlnVal"

End Sub

Private Sub AddLogCodeCombo(ByVal oform As SAPbouiCOM.Form, ByVal oCombo As SAPbouiCOM.ComboBox)

Dim RS As SAPbobsCOM.Recordset

Dim sSQL As String

' Dim oCombo As SAPbouiCOM.ComboBox

'oCombo = oForm.Items.Item("ddno").Specific

'oCombo = oColumns.Items.item("Matrix1").Cells.Item("ddno").Specific

While oCombo.ValidValues.Count > 0

oCombo.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)

End While

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

sSQL = "SELECT CardCode,CardName FROM OCRD"

RS.DoQuery(sSQL)

RS.MoveFirst()

While RS.EoF = False

oCombo.ValidValues.Add(RS.Fields.Item("CardCode").Value, RS.Fields.Item("CardName").Value)

RS.MoveNext()

End While

End Sub

please help me...?

Edited by: Animesh Sinha on Sep 15, 2008 1:20 PM

Edited by: Animesh Sinha on Sep 15, 2008 1:24 PM

Edited by: Animesh Sinha on Sep 15, 2008 1:26 PM

Former Member
Former Member replied

Ok,

You must put the bind before you load the data in the combobox.

So, what is the error you have ?

Regards.

Michael

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