cancel
Showing results for 
Search instead for 
Did you mean: 

Swnc_Statrec_Read_Instance failed to marshal RFCTYPE_XMLDATA to .NET type

Former Member
0 Kudos

Hi,

We have a C# application using .Net Connector 2.0.1. When I used function Swnc_Statrec_Read_Instance to get STAD records, I got an error "System exception thrown while marshaling RFCTYPE_XMLDATA to .NET type.".

I have isolated the issue to one import parameter Read_Transids. Here is its definition in the SapProxy code.

[RfcParameter(AbapName = "READ_TRANSIDS",RfcType=RFCTYPE.RFCTYPE_XMLDATA, Optional = true, Direction = RFCINOUT.IN)]

[XmlArray("READ_TRANSIDS", IsNullable=false, Form=XmlSchemaForm.Unqualified)]

[XmlArrayItem("item", IsNullable=false, Form=XmlSchemaForm.Unqualified)]

SWNC_T_TRANSIDS Read_Transids,

Its C# class is SWNC_T_TRANSIDS. When I passed in an empty SWNC_T_TRANSIDS, it threw the exception “System exception thrown while marshaling RFCTYPE_XMLDATA to .NET type.”.

namespace.SapProxy.SWNC_T_TRANSIDS TransIds =

new namespace..SapProxy.SWNC_T_TRANSIDS();

An empty SWNC_T_TRANSIDS worked well if I ran the function through SE37 in SAPGUI.

When I added a trans id into the SWNC_T_TRANSIDS table, the function worked fine and returned STAD result for the specifc trans id.

TransIds.Add("44F24CAEFCCE0FE3E10000000A0A28B8");

It looks like the SWNC_T_TRANSIDS table has to have at least one trans id to avoid the marshalling exception. Since I want to get all STAD entries in a time window, I cannot specify a specific trans id.

I have tried to add an asterisk, it threw the same exception. The function with an asterisk returns all the records if I ran it through SE37.

TransIds.Add("*");

Then I tried to add 32 asterisks, it did not work either.

TransIds.Add("********************************");

I also tried to add an empty trans id, the function worked, but it did not return any STAD records.

TransIds.Add("");

I have found an SAP note "858707 – RFC Patch Collection 26 2005” about issues in marshalling RFCTYPE_XMLDATA. I applied the note and I still got the same issue.

How can I resolve or work around the marshalling issue? Any suggestions are appreciated.

Thank you,

David

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi David,

I have a similar problem with my connection between my R/3 4.7 Enterprise and my .NET.

System exception thrown while marshaling .NET type Axa.Sap.Iscd.ZCDCT_ICM_TABS to RFCTYPE_XMLDATA

Did you solve this issue?

Thanks and regards

António Nunes

Former Member
0 Kudos

Hi Antonio,

SAP confirmed that it was XML data marshalling issue in the Swnc_Statrec_Read_Instance API and they are working on a note to fix it. The fix should be available pretty soon.

I am not sure if the fix will address all the RFCTYPE_XMLDATA marshalling issues, or it will just fix the issue specific to the Swnc_Statrec_Read_Instance API.

You may want to contact SAP support with your issue and see if there is a fix for it.

Regards,

David