Skip to Content
0
Former Member
Jul 02, 2009 at 01:50 PM

Matrix Data Bound

49 Views

HI Experts,

The following code i used for bind the query result to matrix. It bind sucessfully and when i click Add button i am getting the sucsessful message .But when i close the programme and open the screen using screen painter and check the records then the records was not inserted successfully And also check rerords using query also not came.

What is the problem . PLease guide me. I did any mistake in the following code?

Case "TBL_MREADING_"

oForm = SBO_Application.Forms.Item("TBL_MREADING_")

Dim MReading As SAPbouiCOM.DataTable

oForm.DataSources.DataTables.Add("MReading")

oForm.DataSources.DataTables.Item("MReading").Clear()

Dim sSQL As String = "SELECT CardCode as code,CardName as name,U_VOLTAGE as voltage FROM OCRD where GroupCode!= 100 order by GroupCode"

oForm.DataSources.DataTables.Item("MReading").ExecuteQuery(sSQL)

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

oMatrix = oItem.Specific

oColumns = oMatrix.Columns

'' oMatrix.Columns.Item("V_0").DataBind.Bind("drSlction", "DocEntry")

oMatrix.Columns.Item("P_2").DataBind.Bind("MReading", "name")

'' oMatrix.Columns.Item("V_2").DataBind.Bind("drSlction", "LineNum")

oMatrix.Columns.Item("P_4").DataBind.Bind("MReading", "Code")

oMatrix.Columns.Item("P_5").DataBind.Bind("MReading", "voltage")

' oMatrix.Columns.Item("P_5").DataBind.SetBound(True,"MReading", "voltage")

oMatrix.LoadFromDataSource()

""" For LineId Updation

Dim x As Integer = 1

While x <= oMatrix.RowCount

oMatrix.Columns.Item("V_0").Cells.Item(x).Specific.Value = x

x = x + 1

End While

With Best Records,

M.Thippa Reddy.Matrix Da