cancel
Showing results for 
Search instead for 
Did you mean: 

Removing a ValidValue from a system ComboBox

Former Member
0 Kudos

In the sales order form, I want to remove a valid value from the 'series' combobox.

I did this:

    Dim Series As SAPbouiCOM.ComboBox = Form.Items.Item("88").Specific ' the Series combobox
    For i As Integer = 0 To Series.ValidValues.Count - 1
      SBO_UI.MessageBox(Series.ValidValues.Item(i).Value & ": " & Series.ValidValues.Item(i).Description)
    Next

And saw the value -1, which is the 'manual' series.

I tried to remove it:

Series.ValidValues.Remove(-1, SAPbouiCOM.BoSearchKey.psk_ByValue)

but I got 'invalid value' exception.

Does that mean that removing combobox validvalues is not supported on system forms?

btw, I didnt manage to add a validvalue to that combobox...

Accepted Solutions (1)

Accepted Solutions (1)

AdKerremans
Active Contributor
0 Kudos

Hi Avi,

Try

Series.ValidValues.Remove(<b>"-1"</b>, SAPbouiCOM.BoSearchKey.psk_ByValue)

Regards

Ad

Former Member
0 Kudos

ok, now I get the 'item is not a user-defined item' exception...

but your approach did help me realize that values in a validvalue must also be strings

AdKerremans
Active Contributor
0 Kudos

Hi Avi,

I already was afraid that sap does not allow to remove valid values from comboboxes on system forms.

Regards

Ad

Answers (0)