Skip to Content
Former Member
Oct 07, 2004 at 06:18 AM

Exception: "Method xyz can not be reflected." in .Net Connector 2.0



I have generated a proxy class with two RFC's. The first RFC has a table parameter with the same name and type as an export parameter of the second RFC.

When I create an object of the proxy class with "SAPProxy sap = new SAPProxy();" I get an exception "Method SAPProxy.Z_Rfc_Aenr_Suchen_Via_Ccart can not be reflected." where "Z_Rfc_Aenr_Suchen_Via_Ccart" is the name of the first RFC and the following inner exception

"The XML element named 'AENR_--5fRFC' from namespace '' references distinct types ZAENR_RFC and ZAENR_RFCTable. Use XML attributes to specify another XML name or namespace for the element or types.".

The generated code for the parameter of the first RFC is:

[RfcParameter(AbapName = "AENR_RFC",RfcType=RFCTYPE.RFCTYPE_ITAB, Optional = false, Direction = RFCINOUT.INOUT)]

[XmlArray("AENR_--5fRFC", IsNullable=false, Namespace="")]

[XmlArrayItem("item", IsNullable=false)]

ref ZAENR_RFCTable Aenr_Rfc)

and for the second RFC:

[RfcParameter(AbapName = "AENR_RFC",RfcType=RFCTYPE.RFCTYPE_STRUCTURE, Optional = true, Direction = RFCINOUT.OUT)]

[XmlElement("AENR_--5fRFC", IsNullable=false, Namespace="")]

out ZAENR_RFC Aenr_Rfc)

now when I change one of the XML Names from "AENR_ 5fRFC" to "AENR_ 5fRFC1" in the generated proxy class, the proxy class instantiates correctly, but that should not be the solution.

Is this a bug in .Net Connector 2.0? In Version 1 I didn't get this exception although the parameters where generated with the same name "AENR_RFC" (not "AENR_--5fRFC")