on ‎2025 Mar 27 11:32 AM
I am creating ADDON with SAPbouiCOM.Grid by converting a Data Table into a Grid, but I encountered the error 'Data Table - invalid Unique Id [66000-138]' at the line Grid1.DataTable = oDT. Could anyone help me resolve this issue? Below is the sample code I am using.
SAPbouiCOM.Form oForm = SBO_Application.Forms.ActiveForm;
SAPbouiCOM.DataTable oDT;
oDT = oForm.DataSources.DataTables.Add("dt_GridData");
oDT.Clear();
if (oDT.Columns.Count == 0)
{
oDT.Columns.Add("Branch", SAPbouiCOM.BoFieldsType.ft_AlphaNumeric, 50);
}
foreach (XmlNode node in nodes)
{
System.Data.DataRow oVatRow = dt_output_vat.NewRow();
oVatRow["Branch"] = node.SelectSingleNode("JDT1_U_CompBranch").InnerText.ToString();
dt_output_vat.Rows.Add(oVatRow);
int rowIndex = oDT.Rows.Count;
oDT.Rows.Add();
oDT.SetValue("Branch", rowIndex, oVatRow["Branch"].ToString());
irow++;
}
Grid1.DataTable = oDT;
Grid1.AutoResizeColumns();
Best Regards.
Request clarification before answering.
| User | Count |
|---|---|
| 40 | |
| 21 | |
| 16 | |
| 6 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.