cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting a value in a combobox within an matrix in a system dialog

dan_benamar
Explorer

I'm a novice UI API developer, developing my first add-on.

I'm using system form 146 (payment means, inside incoming payments).

The matrix is item UID 112.

I'm trying to select the credit card type from code within my add-on.

I couldn't find an example in the SDK how to achieve this.

Again, this is a system form, and it's bound to a system data table (OCRC).

I know the value I want to select, however I can't figure out how to do the selection from code.

Thanks,

Dan

Accepted Solutions (1)

Accepted Solutions (1)

former_member185682
Active Contributor

Hi Dan,

Try something like this:


            Matrix mtx = (Matrix)Form.Items.Item("112").Specific;

            ((ComboBox)mtx.Columns.Item("Your collumn ID").Cells.Item("Your row index").Specific).Select("your value", BoSearchKey.psk_ByValue);

Regards,

Diego

Former Member
0 Kudos

this is the correct one. sorry, i thought your combobox wa on the form, not in a matrix

Answers (2)

Answers (2)

dan_benamar
Explorer
0 Kudos

Thank you all,

By the time my post was published, I already found the solution.

It's still great to be part of such a helpful community.

This is my final code in case someone will need something similar in the future:

SAPbouiCOM.Item oItem = oform.Items.Item("112");

SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)oItem.Specific;

SAPbouiCOM.Columns oColumns = oMatrix.Columns;

SAPbouiCOM.Column oColumn = oColumns.Item("41");

SAPbouiCOM.Cell oCell = oColumn.Cells.Item(1);

SAPbouiCOM.ComboBox oComboBox = ((SAPbouiCOM.ComboBox)(oCell.Specific));

oComboBox.Select(sCardName, SAPbouiCOM.BoSearchKey.psk_ByDescription);


Dan

Former Member
0 Kudos

hi, first get the item from the form, then cast combobox item and

sapbouicom.item item = form.items.item("UID");
(((SAPbouiCOM.ComboBox)item.Specific).Select("<KEYVALUE>", SAPbouiCOM.BoSearchKey.psk_ByValue);

check the documentation, under combobox object , select method.

happy coding