cancel
Showing results for 
Search instead for 
Did you mean: 

Purchase Order - matrix

Former Member
0 Kudos

Hi,

I would like to place some data from an array in my code to the matrix in Purchase Order Screen.But the Below code is throwing "Invalid Column" error

If oApplication.Forms.ActiveForm.TypeEx = "142" Then

oMatrix = oApplication.Forms.ActiveForm.Items.Item(38).Specific

If oMatrix.RowCount <= 0 Then

oMatrix.AddRow()

End If

oEText = oMatrix.Columns.Item("ItemCode").Cells.Item(oMatrix.RowCount).Specific

str = aClist(0)

oEText.Value = str

End If

How to solve this?

Manojkumar

Accepted Solutions (0)

Answers (1)

Answers (1)

AdKerremans
Active Contributor
0 Kudos

Hi Manojkumar,

The column name for itemcode is not "ItemCode", but "1" (between double quotes).

Also for you matrix use "38" instead of 38

You can see the name of the column by selecting the menu option View/SystemInformation and move your mouse over the column.

Regards

Ad

Former Member
0 Kudos

Hi Ad,

Thanks,

Now on Executing the below line it throws "Form - Invalid Form Item"

oEText.Value = aClist(0)

Here aClist is an array.

Manojkumar

AdKerremans
Active Contributor
0 Kudos

Hi Manojkumar,

What type of variable is oEText?

It should be of SAPBouiCOM.EditText.

and does oEText have a value?

Check this through debugging.

Regards

Ad

Former Member
0 Kudos

Hi,

Thanks, I have solved the problem.

Actually, the Problem is i was trying to load a text in the ItemCode column in Purchase order matrix which accepts only the item number from OITM table.

Do u have any idea that of using views which has columns from more than one userTables?

ManojKumar

AdKerremans
Active Contributor
0 Kudos

Hi Manojkumar,

If you mean matrix with view, you have to collect the data by your program and load the data into the matrix.

Regards

Ad

Former Member
0 Kudos

Hi Ad,

My Doubt is below?

In my form i have a matrix.On load of this form i need to fill the matrix with columns from two differrent tables.So i have created a view in my code and i would like it to be binded to the matrix.

Below is the code

ssql = "create view HPreq as select a.docnum as DocNum,a.U_prdt as prdt,a.U_from as frm,b.U_item as item,b.u_Qty as Qty from [@PREQ] a,[@PREQ1] b"

olinrec.DoQuery(ssql)

If olinrec.RecordCount > 0 Then

oDBDataSource = oForm.DataSources.DBDataSources.Add("HPreq")

End If

oMatrix.Clear()

oDBDataSource.Query()

For iLoop = 0 To oDBDataSource.Size - 1

oDBDataSource.Offset = iLoop

oUSDataSource.Value = iLoop + 1

oMatrix.AddRow()

Next

The Problem i face here is

1.On executing the below line

olinrec.DoQuery(ssql)

it throws "Object already exist"

2.It means the view has been already created. So i commented these lines. But on On executing the below line

oForm.DataSources.DBDataSources.Add("HPreq")

It throws "DataTable not found"

How to solve this error?

ManojKumar

AdKerremans
Active Contributor
0 Kudos

Hi,

You are mixing things.

you cannot use a SQL-server view as a datatable.

I would advise you to read the documentation about datatable and grids.

Regards

Ad