Skip to Content

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

combo in matrix releated to the table?

i design form through coding

i use matrix

coloum name is

ddno dddate amount

dd no , dddate , amount exist another table

dd no is combox ...... value is showing combo box....

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

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

'// 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

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

' AddLogCodeCombo(oForm, colItemCode)

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

Dim vv As SAPbouiCOM.ValidValues = oColumn.ValidValues

Dim ors As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

ors.DoQuery("select U_DDno,U_DDdt from [@DDMAST]")

'ors.DoQuery("SELECT CardCode,CardName FROM OCRD")

Do While Not (ors.EoF)

' vv.Add(ors.Fields.Item(0).Value, ors.Fields.Item(1).Value)

vv.Add(ors.Fields.Item("U_DDno").Value, ors.Fields.Item("U_DDdt").Value)

ors.MoveNext()

Loop

oDBDataSource.Query()

oMatrix.LoadFromDataSource()

'AddItemsToCombo(colItemCode)

'// Add a column for DD Date

'Try

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")

'Catch ex As Exception

' SBO_Application.MessageBox(ex.Message)

'End Try

'// 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")

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Dim vv As SAPbouiCOM.ValidValues = oColumn.ValidValues

Dim ors As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

ors.DoQuery("select U_DDno,U_DDdt from [@DDMAST]")

Do While Not (ors.EoF)

vv.Add(ors.Fields.Item("U_DDno").Value, ors.Fields.Item("U_DDdt").Value)

ors.MoveNext()

Loop

oDBDataSource.Query()

oMatrix.LoadFromDataSource()

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

i want to select ddno in combo value releated to dd no dddate and amount should be showing in coloum in matrix...

may

If (pVal.ItemUID = "Matrix2") And (pVal.ColUID = "DDno") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) And (pVal.BeforeAction = False) Then

Dim oEdit As SAPbouiCOM.EditText

Dim oCombo As SAPbouiCOM.ComboBox

Dim qstr As String

oItem = oForm.Items.Item("Matrix2")

oMatrix = oItem.Specific

oColumns = oMatrix.Columns

' Item Code

' SBO_Application.MessageBox("20")

colItemCode = oColumns.Item("DDno")

colItemName = oColumns.Item("DDdt")

' colItemAmt = oColumns.Item("Drafamt")

'SBO_Application.MessageBox("21")

oCombo = colItemCode.Cells.Item(pVal.Row).Specific

oEdit = colItemName.Cells.Item(pVal.Row).Specific

' SBO_Application.MessageBox("22")

oEdit.Value = oCombo.Selected.Description

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

'oEdit.Value =

'' SBO_Application.MessageBox("23")

qstr = "select U_DDno,U_DDdt,U_amount from [@DDMAST] where U_DDno = '" & oCombo.Selected.Value.ToString & "'"

rs.DoQuery(qstr)

While rs.EoF = False

colItemAmt = rs.Fields.Item("U_amount")

End While

in case of date is not working .......

i want to show colitem amount in coloum when i chose dd no in combo box coloum matrix........

End If

above code not working what is the problem......

please help me...

Edited by: Animesh Sinha on Sep 16, 2008 1:31 PM

Edited by: Animesh Sinha on Sep 16, 2008 1:34 PM

Edited by: Animesh Sinha on Sep 16, 2008 1:35 PM

Edited by: Animesh Sinha on Sep 17, 2008 11:52 AM

replied

so far as date columns are concerned, use edittext instead of specific.value.

 Dim edit As SAPbouiCOM.EditText
 edit = omat.Columns.Item("ddt").Cells.Item(pVal.Row).Specific
 edit.String = "yourdate"

and you will have to format your date that you are fetching through recordset accordingly.

regards,

Binita

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