on 11-21-2007 4:04 AM
Hi Experts,
Currently, I have tried to link my VB project with WSDL for a BAPI in SAP.
After adding web reference, I tried to rebuild project and got following error.
"Reference to a non-shared member requires an object reference"
I have tried to add "SYSTEM" in the statement which has error but it does not help.
Please advise what I can try further to resolve this problem.
Thank you !
Hi Erika,
Try removing the keyword SYSTEM from the lines. And also if possible can you post here the line of code generating the error.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:sap-com:document:sap:rfc:functions")> _
Public Class BAPIRET2
'<remarks/>
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
Public TYPE As String
'<remarks/>
I've tried to modify like following
'<remarks/>
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:sap-com:document:sap:rfc:functions")> _
Public Class BAPIRET2
'<remarks/>
<SYSTEM.Xml.Serialization.XmlElementAttribute("SYSTEM", Form:=SYSTEM.Xml.Schema.XmlSchemaForm.Unqualified)> _
Public TYPE As String
Hi Erika,
Remove the "SYSTEM" keyword as shown below-
<b>Old Code</b>:
'<remarks/>
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:sap-com:document:sap:rfc:functions")> _
Public Class BAPIRET2
'<remarks/>
<SYSTEM.Xml.Serialization.XmlElementAttribute("SYSTEM", Form:=SYSTEM.Xml.Schema.XmlSchemaForm.Unqualified)> _
Public TYPE As String
<b>Modified :</b>
'<remarks/>
<Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:sap-com:document:sap:rfc:functions")> _
Public Class BAPIRET2
'<remarks/>
<Xml.Serialization.XmlElementAttribute("SYSTEM", Form:=SYSTEM.Xml.Schema.XmlSchemaForm.Unqualified)> _
Public TYPE As String
Regards.
Hi Erika,
>>Anyway, I would like to have your advice why the error appears only in the
>>BAPIRET2 section.
Because if you see in the BAPIRET2 Class there is a property defined with the same name:
<b>Public SYSTEM As String</b>
And thats causes the confusion to the compiler. If you just want to check- try renaming -
<b>Public SYSTEM As String</b> to something else
may be <b>Public SYSTEM_TEST As String</b>
And the error should be gone.
Now coming back to resolution- Just check whether the reference.vb file has got a header statement like :
Option Strict Off
Option Explicit On
<b>Imports System</b>
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization
And if the above namespaces are already impoted in your reference.vb file then you can safely remove "SYSTEM" keyword as suggested earlier.
Regards.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.