cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with combobox.select method in 2007A

Former Member
0 Kudos

Hi,

When I'm trying to select the empty validvalue with a combo in SBO 2007 A, I've the error "Out of Range"


myCombo.Select( 0, BoSearchKey.psk_Index);

However I'm sure that the item 0 of my ValidValues is blank.

I tried to do the same thing by value or description and it's the same problem.

Can anyone help me ?

Thanks

(I'm using 2005 version of SAPboui/bobsCom.dll)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try the 0 give between quotes myCombo.Select( "0", BoSearchKey.psk_Index)

Former Member
0 Kudos

Sorry, Doesn't work.

Nussi
Active Contributor
0 Kudos

Hi Julien,

did you add the Validvalue 0 by yourselft ?

or do you mean the blank standard value when you have no item selected ?

because when you mean the "not selected blank" value you must

1. delete all values

2. add a pseude empty value with description ""

3. select this pseudo value

4. add all values from point 1. again and remove the pseudo value

regards

Former Member
0 Kudos

Hi,

Yes I've added this blank value ("",""), at position 0 by myself at the creation of the form.

My combobox (actually it's a cell of a matrix) is not binded to a multivalue field in database

It's quite crazy because, i can access all the validvalues and select all these values except the first one ("").

Former Member
0 Kudos

Hi Julien,

i tried it as

oComboBox.ValidValues.Add("1", "Combo Value 1")

oComboBox.ValidValues.Add("", "") - as you wrote

oComboBox.ValidValues.Add("2", "Combo Value 2")

oComboBox.ValidValues.Add("3", "Combo Value 3")

oComboBox.Select("", SAPbouiCOM.BoSearchKey.psk_ByValue)

oComboBox.Select(1, SAPbouiCOM.BoSearchKey.psk_Index)

and both select method work. Are you sure that you have added this blank value?

Try to debug it as

Dim q As Integer

Dim s As String

For q = 0 To oComboBox.ValidValues.Count - 1

s = oComboBox.ValidValues.Item(q).Value

Next

maybe it helps you.

Petr

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks for your answers,

I found a solution.

The problem is I've added a value with a blank space " " and not a blank value "" at the first position.

Now with a blank value the Select method works:

myCombo( 0, ByIndex ).

Visibly, SBO 2007 doesn't like the selection of a blank space in a ComboBox.