Hi,
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")
Thanks!
Markus
Yes, sorry again a bug.
I was fixing a special case where you have strange characters in ABAP names that are not supported in XML and forgot "_" which is an allowed char.
In the moment you can fix it by replacing "_--5f" with "_", which should be perfectly Ok.
I'll try posting a fix soon.
Hi,
when comparing the proxy classes generated with NCO 1 and version 2, I found the difference that probably causes the problem.
Each parameter of a RFM in Version 2 is marked with [XmlElement("XYZ", IsNullable=false, Namespace="")]. In the proxy class generated with version 1 "Namespace="" " is missing.
Removing the Namespace property solves the problem. Under some circumstances the Namespace property in combination with my special RFM's - parameter obviously causes the reflection problem.
What is the difference between setting the Namespace to "" and omitting it?
Thanks!
Markus
Add a comment