Read Matrix Columns Records using SerializeAsXML
#MatrixColumns #SerializeAsXML #ReadRecords #DataSerialization #XML #DataManagement #Coding #Programming #LinkedIn #EnglishLanguage

Read Matrix Columns Records using SerializeAsXML

Code is below

    Friend Function GetMatrixMultipleValue(ByRef oForm As SAPbouiCOM.Form, ByVal oMatrixUID As String, ByVal strEleID() As Object, ByVal inrRow As Integer) As Object()
        Dim strRetValue(strEleID.Length - 1) As Object
        Try
            Dim oMatrix As SAPbouiCOM.Matrix = oForm.Items.Item(oMatrixUID).Specific
            Dim strMatrixXML As String = oMatrix.SerializeAsXML(BoMatrixXmlSelect.mxs_All)
            Dim xDoc = XDocument.Parse(strMatrixXML)
            Dim strXMLmatrixRows = xDoc.Descendants("Rows")
            Dim intXMLRowsCount As Integer = strXMLmatrixRows.Count
            If intXMLRowsCount > 0 Then
                For ColIndex As Integer = 0 To strEleID.Length - 1
                    Dim strColName As String = strEleID(ColIndex)
                    Dim strStkStatus = From s In strXMLmatrixRows.Descendants("Column") Where s.Element("ID").Value = strColName Select s.Element("Value").Value
                    strRetValue(ColIndex) = strStkStatus.ElementAt(inrRow)
                Next
            End If
        Catch ex As Exception
            strRetValue = Nothing
        End Try
        Return strRetValue
    End Function         

#MatrixColumns #SerializeAsXML #ReadRecords #DataSerialization #XML #DataManagement #Coding #Programming #LinkedIn #EnglishLanguage

要查看或添加评论,请登录

Lakshmi Narayanan的更多文章

社区洞察

其他会员也浏览了