Skip to Content
author's profile photo Former Member
Former Member

sap b1 problem


We are trying to customizing the Sapb12005b

i want to take the input value given by the user from my Addon.

i put one Combobox on my addon, i want to bring data from database by using that combobox selected value.

i am using, in that i am getting the selected value like


but i am getting error like Null reffrence exception. plz help me. asap



Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jun 07, 2007 at 04:39 AM

    Hi Nagababu,

    It's better to bind DataSources to your controls and then read the values that the user has entered using these DataSources. Perhaps you can post your code as this will help us analyse the problem.

    Kind Regards,


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2007 at 10:28 AM


    U please try this code to fill the combo where the datas from database

    Dim oCmb As SAPbouiCOM.ComboBox

    Dim Rec As SAPbobsCOM.Recordset

    Dim i As Integer

    Rec = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

    frm = app.Forms.ActiveForm

    Rec.DoQuery("select cardcode,cardname from OCRD")


    oCmb = frm.Items.Item("cmb_agy").Specific

    If oCmb.ValidValues.Count > 0 Then

    For i = 0 To Rec.RecordCount - 1

    oCmb.ValidValues.Add(Rec.Fields.Item(0).Value, Rec.Fields.Item(1).Value)



    End If

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Bruno PEYRON


      as ofcourse adele is rite. if the combo had values before it wont rewrite the values. This will be help while updating. If u didt use tht if oCmb.ValidValue.count>0

      if statement also it work for adding and navigating.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.