cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in add values to matrix

Former Member
0 Kudos

Dear All,

I have designed a screen using screen painter,Add the values to the form am using the following code

Private Sub AddValuesToMatrixFromCRL(ByRef code As String, ByRef name As String)

Try

oMatrix = oForm.Items.Item("41").Specific

oMatrix.Clear()

oForm.DataSources.DataTables.Item("DATA").ExecuteQuery("SELECT T1.[LineNum], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price], T1.[LineTotal] FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry AND DocNum = 'DocNum'")

oMatrix.Columns.Item("V_0").DataBind.Bind("DATA", "LineNum")

oMatrix.Columns.Item("V_1").DataBind.Bind("DATA", "ItemCode")

oMatrix.Columns.Item("V_2").DataBind.Bind("DATA", "Dscription")

oMatrix.Columns.Item("V_4").DataBind.Bind("DATA", "Price")

oMatrix.Columns.Item("V_11").DataBind.Bind("DATA", "LineTotal")

oMatrix.Clear()

oMatrix.LoadFromDataSource()

oMatrix.AutoResizeColumns()

oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single

If oMatrix.RowCount >= 1 Then

oMatrix.SelectRow(1, True, False)

End If

Catch ex As Exception

SBO_Application.MessageBox("AddValuesToMatrixFromCRL :" & ex.Message)

End Try

End Sub

But when am executing the program values not added to the matrix

Regards,

Guru

Accepted Solutions (1)

Accepted Solutions (1)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Guru,

I think the problem locates in the SQL ('DocNum'), marked as bold below:

SELECT T1.LineNum, T1.ItemCode, T1.Dscription, T1.Quantity, T1.Price, T1.LineTotal FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry AND DocNum = 'DocNum'"

Kind Regards, Yatsea

Answers (0)