cancel
Showing results for 
Search instead for 
Did you mean: 

DataTable Concept

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Dear All,

I have a problem regarding a data-table. Generally when we write code for CFL for Item Code we write following code..

if (pVal.ItemUID == enControlName.mtxDetails & pVal.ColUID == enControlName.colItemCode & strUid == enCFL.cflItem)

{

SAPbouiCOM.Matrix oMatrix = default(SAPbouiCOM.Matrix);

oMatrix = (SAPbouiCOM.Matrix)this.m_SBO_Form.Items.Item(enControlName.mtxDetails).Specific;

SAPbouiCOM.EventFilters oldFilter = this.SBO_Application.GetFilter();

this.SBO_Application.SetFilter(new SAPbouiCOM.EventFilters());

this.m_SBO_Form.Freeze(true);

int Row = pVal.Row;

for (int i = 0; i <= oDataTable.Rows.Count - 1; i++)

{

try

{

oEdit = (SAPbouiCOM.EditText)oMatrix.Columns.Item(enControlName.colItemCode).Cells.Item(Row).Specific;

oEdit.Value = Convert.ToString(oDataTable.GetValue(0, i));

}

catch (Exception ex)

{

}

oEdit = (SAPbouiCOM.EditText)oMatrix.Columns.Item(enControlName.colItemName).Cells.Item(Row).Specific;

oEdit.Value = Convert.ToString(oDataTable.GetValue(1, i));

((SAPbouiCOM.EditText)oMatrix.Columns.Item(enControlName.colQtyApp).Cells.Item(Row).Specific).Value = "1";

((SAPbouiCOM.EditText)oMatrix.Columns.Item(enControlName.colInstock).Cells.Item(Row).Specific).Value = oDataTable.GetValue(11, i).ToString();

((SAPbouiCOM.EditText)oMatrix.Columns.Item(enControlName.colCommited).Cells.Item(Row).Specific).Value = oDataTable.GetValue(12, i).ToString();

((SAPbouiCOM.EditText)oMatrix.Columns.Item(enControlName.colOrder).Cells.Item(Row).Specific).Value = oDataTable.GetValue(13, i).ToString();

((SAPbouiCOM.EditText)oMatrix.Columns.Item(enControlName.colUOM).Cells.Item(Row).Specific).Value = oDataTable.GetValue(20, i).ToString();

((SAPbouiCOM.EditText)oMatrix.Columns.Item(enControlName.colRemarks).Cells.Item(Row).Specific).Value = oDataTable.GetValue(46, i).ToString();

I want to ask here that what 11,12,13, 20 & 46 describe in highlighted areas respectively ? On which bases we write these object columns...?

Plz. give ur precious replies......

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Those numbers represent Column number for item detail in marketing document.

Examples:

11 - Quantity

12 - UseBaseUN

13 - PackQty

You can get them from system info through the form.

Thanks,

Gordon

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank You Arun.... & Gordon.... It is a very helpful answer.....

former_member689126
Active Contributor
0 Kudos

Hi

if you are using item choosefromlist then you can access the datatable values using the getvalue method oDataTable.GetValue(0, 0).ToString(); this will retrieve the selected rows itemcode value from item master table or you can get the value through this statement also oDataTable.GetValue("ItemCode", 0).ToString(); likewise you can access any columns from the item master table

Hope this helps

Regards

Arun