cancel
Showing results for 
Search instead for 
Did you mean: 

object reference....

Former Member
0 Kudos
65

Hi To All,

In my screen there is textbox with link button. when i click the link button another screen should open... Here is my source


 Case "lnkWNo"
                        Select Case pVal.EventType
                            Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
                                objXML.LoadForm("aaa.xml")
                                objForm = App.Forms.Item("AAA")
                                objForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE
                                objForm.Items.Item("txtOrderNo").Enabled = True
                                objForm.Items.Item("txtOrderNo").Specific.value = Datasource.GetValue("U_worderno", Datasource.Offset).Trim
                                objForm.Items.Item("1").Click()
                        End Select

When i crossed this line


      objForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE

error message as


object reference not set to an instance of object

same as when i crossed this line


       objForm.Items.Item("txtOrderNo").Specific.value = Datasource.GetValue("U_worderno", Datasource.Offset).Trim
             

error message comes as


object reference not set to an instance of object

Wats the problem.........

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You need to initilise the form and linked button object also.

as

Dim oLink As SAPbouiCOM.LinkedButton

Set oColumn = oColumns.Add("A", it_LINKED_BUTTON)

Set oLink = oColumn.ExtendedObject

oLink.LinkedObject = lf_BusinessPartner

hope this will help you..

lg Mahendra

Former Member
0 Kudos

This particular link button is not in matrix.. its a master screen.

Answers (3)

Answers (3)

Former Member
0 Kudos

For Master you can use the following code

Dim OCT_LinkButton As SAPbouiCOM.LinkedButton

OCT_Item = OCT_Form.Items.Add("lnkGINo", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON)

OCT_Item.Left = OCT_Form.Items.Item("lblGINo").Left + OCT_Form.Items.Item("lblGINo").Width + 5

OCT_Item.Width = 10

OCT_Item.Top = OCT_Form.Items.Item("lblGINo").Top

OCT_Item.Height = OCT_Form.Items.Item("lblGINo").Height

OCT_Item.LinkTo = "editGINo"

OCT_LinkButton = OCT_Form.Items.Item("lnkGINo").Specific

OCT_LinkButton.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_GoodsIssue

lg Mahendra

Former Member
0 Kudos

It doesnot matters where it is.just set the following property

Dim oLink As SAPbouiCOM.LinkedButton

Set oColumn = oColumns.Add("A", it_LINKED_BUTTON)

Set oLink = oColumn.ExtendedObject

oLink.LinkedObject = lf_BusinessPartner

I hope It will resolved ur issue.

lg Mahendra

Former Member
0 Kudos

Hi Sridhar,

The problem are that your variable objForm is null because the Form.Item(XX) require the UID of the form.

I think it was the problem.

Hope i help you

Michael

Former Member
0 Kudos

I think u r telling to initialize the form... i had already initialized... but no use....