cancel
Showing results for 
Search instead for 
Did you mean: 

combo in matrix releated to the table?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Animesh,

it is no easy help you when you didnt write what you need and which part of code doesnt work with your expectations. Describe the problem in details, write where is the problem in code, then people should help you.

Former Member
0 Kudos

thanks for help.

i am explaning clearly. what i want to do , in my form i have one matrix and there have three coloums like (ddno, dddate,draftamount), here ddno is combo box used in coloum .

what i want to do when i want to select ddno corrosponding dddate, and draftamount will be show in coloum matrix from database table...

my problem is that value is not showing in coloum( dddate, draft amount)

''''''''''''''''''''''''' my code

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

Dim oEdit As SAPbouiCOM.EditText

Dim oCombo As SAPbouiCOM.ComboBox

Dim qstr As String

Dim rownum As Integer

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

oMatrix = oItem.Specific

oColumns = oMatrix.Columns

colItemCode = oColumns.Item("DDno")

colItemName = oColumns.Item("DDdt")

colItemAmt = oColumns.Item("Drafamt")

colitemloc = oColumns.Item("bankname")

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

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

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

SBO_Application.MessageBox("23")

rs.DoQuery(qstr)

If Not (rs.EoF) Then

colItemName = rs.Fields.Item("U_DDdt").Value

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

colitemloc = rs.Fields.Item("U_location").Value

rs.MoveFirst()

SBO_Application.MessageBox("24")

End If

End If

is my code wrong? please help us

Former Member
0 Kudos

Animesh,

change the following code:


colItemName = rs.Fields.Item("U_DDdt").Value

to


oColumns.Item("DDdt").Cells.Item(pval.Row).Specific.value = rs.Fields.Item("U_DDdt").Value

that should work. and add a try - catch loop to your code. it will give error.

regards,

Binita

Former Member
0 Kudos

thanks for help

No valuue is showing coloum matrix colum

i used try catch loop

my error is showing

error:- invalid date value[131-183]

If Not (rs.EoF) Then

Try

oColumns.Item("DDdt").Cells.Item(pVal.Row).Specific.value = rs.Fields.Item("U_DDdt").Value

oColumns.Item("Drafamt").Cells.Item(pVal.Row).Specific.value = rs.Fields.Item("U_amount").Value

Catch ex As Exception

SBO_Application.MessageBox(ex.Message)

End Try

rs.MoveFirst()

End If

please help me..

thanks

Former Member
0 Kudos

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

Former Member
0 Kudos

thanks a lot

problem solved

Answers (0)