cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Matrix Data

Former Member
0 Kudos
676

Hello,

i have created a user form with a matrix and a button using SAP B1 studio for vs2010.

I need to copy data from the matrix, when the button is pressed. I saw that there is a menu "Copy Table" with the id "784", but unfortunately is disabled and i cannot use it in my addon.

What do you propose to do?

Thank you in advance!

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi Makis,

You can opt to use the following:

SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx_0000").Specific;
oMatrix.Clear();
oForm.DataSources.DBDataSources.Item("@LINETABLENAME").Clear();
SAPbouiCOM.DBDataSource oDB = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@LINETABLENAME");
oForm.DataSources.DBDataSources.Item("@LINETABLENAME").InsertRecord(oDB.Size);
oDB.SetValue("U_LineID", oDB.Size - 1, Convert.ToString(oRecSet.Fields.Item("LineID").Value));
oDB.SetValue("U_Code", oDB.Size - 1, Convert.ToString(oRecSet.Fields.Item("Code").Value));
oDB.SetValue("U_Name", oDB.Size - 1, Convert.ToString(oRecSet.Fields.Item("Name").Value));
oMatrix.LoadFromDataSource();

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Answers (0)