Skip to Content
0

Copy Matrix Data

Sep 28, 2017 at 12:08 PM

71

avatar image
Former Member

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!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
ANKIT CHAUHAN
Sep 28, 2017 at 12:43 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded