Skip to Content
0
Apr 22, 2009 at 09:53 AM

How can i to put a ItemCode in a matrix from SDK???

62 Views

I want to put a value (ItemCode) in a matrix of an order form from SDK. I'm trying with this code but give me an error:


Dim oForm As SAPbouiCOM.Form = 
SBO_Application.Forms.GetFormByTypeAndCount(139, 1)

                        //put CardCode
                        Dim edi As SAPbouiCOM.EditText = oForm .Items.Item("4").Specific
                        edi.String = "CardCode"
                        
                        oMatrix = oForm.Items.Item("38").Specific
                        oColumns = oMatrix.Columns

                        Dim DtDocAux As SAPbouiCOM.DataTable
                        DtDocAux = oForm.DataSources.DataTables.Add("MyDataTable")

                        //column ItemCode
                        DtDocAux.Columns.Add("1", SAPbouiCOM.BoFieldsType.ft_Text)
                        oColum = oColumns.Item("1")
                        oColum.DataBind.Bind("MyDataTable", "1")

                        DtDocAux.Rows.Add()
                        DtDocAux.SetValue("1", 0, "8500001")
                        
                        oMatrix.LoadFromDataSource() //skip the exception
//............
                       

this is the excepcion: Item - The item is not a user-defined item [66000-8]

Anyone can help me???

Thanks.