cancel
Showing results for 
Search instead for 
Did you mean: 

combo box value value ....exists?

Former Member
0 Kudos
106

Hi.. See the image emp..

This is my Small addon just like a  emp master data....

I have inserted the fileds...

country is allso one of the filed....like in emp screen.

My requirement is if i click country all the country names will come...

but only some values are comming...

in emp screen upto z names are comming..

See emp2 image only upto 'c' values are comming..

if i once run the program """"value value is exisiting" is comming..

If i comment the code the error is not comming..

remaining combo values like position,depatment, branch every value is comming except country.

(small info: [the country names are containing some duplicates one or two are repeating is it giving any error)

may i know what is the problem..

how can i solve this one

my code is.... exactly at country is

    Dim ocombo6 As SAPbouiCOM.ComboBox

                oform = sbo_app.Forms.Item("TT")

                ocombo6 = oform.Items.Item("129").Specific

                Dim or7 As SAPbobsCOM.Recordset

                or7 = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

                or7.DoQuery(" select distinct t0.name from ocry t0")

                For i As Integer = 1 To ocombo.ValidValues.Count - 1

                    ocombo6.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)

                Next

                While or7.EoF = False

                    ocombo6.ValidValues.Add(or7.Fields.Item(0).Value, or7.Fields.Item(0).Value)

                    or7.MoveNext()

                End While

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mr. Seenu,

Try this :

For i As Integer =ocombo.ValidValues.Count - 1 to 0 Step -1

                    ocombo6.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)

                Next

Regards,

Former Member
0 Kudos

Hi...I tried

One error is comming..

Data source value is not found is comming....;

     Dim ocombo8 As SAPbouiCOM.ComboBox

                oform = sbo_app.Forms.Item("TT")

                ocombo8 = oform.Items.Item("110").Specific

                Dim or9 As SAPbobsCOM.Recordset

                or9 = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

                or9.DoQuery(" select  t0.name from ocry t0 ")

                For i As Integer = ocombo.ValidValues.Count - 1 To 0 Step -1

                    ocombo8.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)

                Next

                While or9.EoF = False

                    ocombo8.ValidValues.Add(or9.Fields.Item(0).Value, or9.Fields.Item(0).Value)

                    or9.MoveNext()

                End While

Former Member
0 Kudos

According to the error "Data source value is not found is comming....;" it seems you may have not bound the Country ComboBox to UserDataSource. In this case, you need to bind the UserDataSource to the ComboBox, please add below code while loading the User Define Form i.e. .srf file :

oform = sbo_app.Forms.Item(“TT”)

oform.DataSources.UserDataSources.Add("CountryDS", BoDataType.dt_SHORT_TEXT, 100)

Dim ocombo8 As SAPbouiCOM.ComboBox

ocombo8 = oform.Items.Item("129").Specific

ocombo8 .DataBind.SetBound(True, "", "CountryDS")

Dim or9 As SAPbobsCOM.Recordset

or9 = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

or9.DoQuery("Select Code,Name From OCRY")


If ocombo8 .ValidValues.Count > 0 Then

       Dim i As Integer = ocombo8 .ValidValues.Count - 1

      While Not ocombo8 .ValidValues.Count = 0

      Try

           ocombo8 .ValidValues.Remove(i, SAPbouiCOM.BoSearchKey.psk_Index)

      Catch ex As Exception

      End Try

      i = i - 1

      End While

     If or9.RecordCount > 0 Then

           or9.MoveFirst()

           For iRow = 1 To or9.RecordCount

                Try

                      '//Item(0) --> Code and Item(1) -->Name

                      ocombo8 .ValidValues.Add(or9.Fields.Item(0).Value, or9.Fields.Item(1).Value)

                Catch ex As Exception

                End Try

           or9.MoveNext()

    Next  '// For iRow = 1 To or9.RecordCount

End If  '//If or9.RecordCount > 0 Then


Please let us know if this helps!

Regards,

Greytrix (I) Pvt. Ltd.

Former Member
0 Kudos

Yeah...It's Working.....

Could u plz solve this problem...(about button combo(copy to))

The above screen had two fields one is cardcode and card name

how can i copy these two field value to the another screen if i press copy to button.....

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Seenu,

On the Item Pressed event activate the menu for the form where u want to copy your data. Suppose u want to copy data on the 'Purchase Quotation'. Then use this code :

SAPbouiCOM.MenuItem oMenu = (SAPbouiCOM.MenuItem)SBO_Application.Menus.Item("39698");

                                                     oMenu.Activate();                                                    

                                                     oForm = (SAPbouiCOM.Form)SBO_Application.Forms.GetForm("540000988", 1);

                                                     oForm.Freeze(true);

string SQL = "Select U_ItemCode,U_ItemName,U_ReqQty from [@REQUISITIONDETAIL] where DocNum= '" + edDocEntry.Value + "'";

                                                         oRecSet.DoQuery(SQL);

and send your data accordingly picking it up from oRecSet.

Hope it helps....

Thanks

Answers (0)