cancel
Showing results for 
Search instead for 
Did you mean: 

Form serial number selection (Form=25)

Former Member
0 Kudos

Hi All,

I want to transfert the content of the left matrix to the right matrix automatically when the user put something and press TAB in the field Filter.

I try to do this with use this :

oMatrixTo.AddRow(j, 1);

oForm.DataSources.DBDataSources.Item("OSRN").SetValue("2", i, "AZ");

But i cannot because the item is not an userdefined object.

So i want to select all lines in the left matrix and simulate a click in the button "8" (Button ">") but i don't arrived to simulate a press to CTRL and click to the header rows.

My questions are :

It is possible to transfert automatically data from left matrix to right ? Is yes, how can i do this ?

How to simulate CTRL + Click on the Header rows ?

Thanks for your help.

Best regards,

Michael

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Michael,

Yes it is possible to automatically transfer available serial numbers to the selected list. As njmog1 suggests, to select an available serial number you have to simulate a click in the first cell on the required row (the # column), then to transfer you need to simulate a click on the transfer ">" button. The following code will select all available serial numbers and transfer them across (ofcourse SAP will only bring across the required amount):

Dim oForm As SAPbouiCOM.Form = oApp.Forms.Item(FormID)
Dim mtx As SAPbouiCOM.Matrix = oForm.Items.Item("5").Specific
'Select first row.
mtx.Columns.Item(0).Cells.Item(1).Click()
'Shift click on last row to select all.
mtx.Columns.Item(0).Cells.Item(mtx.RowCount).Click(SAPbouiCOM.BoCellClickType.ct_Regular, SAPbouiCOM.BoModifiersEnum.mt_SHIFT)
'Cick on > button to transfer to selected list.
oForm.Items.Item("8").Click()
oForm = Nothing

You would use Shift not Ctrl on the last row click to select all rows. Ctrl only selects individual rows. Hope that helps.

Andrew.

[www.beabetterbusiness.com|www.beabetterbusiness.com]

Former Member
0 Kudos

Your solution might work, although I've not tested it;

To select all the rows, click on the first cell that is first row, first column (the number column).

Then click on the cell that is last row, first column.

For the second click, use

oMatrix.Columns.Item(0).Cells.Item(oMatrix.Rowcount).Click(BoCellClickType.ct_Regular, 4096);

4096 simulates holding ctrl while clicking.