Skip to Content
Former Member
Oct 11, 2004 at 07:35 AM

How to call rfc with byte[] parameter?


I am building a middleware using SAP.NET connector but Im having a problem with a particular rfc. I am using C# and my problem basically is abut PIDs( persistent instance id, call list id). PIDs are composed of 32 characters(hexstring), 16 bytes in hexadecimal format. (e.g. A42103E78DCAD54A9EB09D5921C76F06). The rfc crm_call_list_get_calls requires a PID input of byte[] datatype (byte[] Iv_Call_List_ID). I've tried converting the hexstring into an array of bytes (C# format) for the said rfc (A42103E78DCAD54A9EB09D5921C76F06----> byte[] PID={0xA4, 0x21, 0x03, 0xE7, 0x8D, 0xCA, 0xD5, 0x4A, 0x9E, 0xB0, 0x9D, 0x59, 0x21, 0xC7, 0x6F, 0x06} but ive been getting the following error:

System exception thrown while marshaling RFCTYPE_XMLDATAto .NET type.

Unhandled Exception: SAP.Connector.RfcMarshalException: System exception thrown while marshaling RFCTYPE_XMLDATAto .NET type. ---> System.Xml.Xsl.XsltException: 'Byte[]' is an invalid QName.

Also a part of the generated code for the same rfc returns an error for missing array initialization.

(public override object CreateNewRow()


return new byte[]();


Ive modified the code to: return new byte[]{}

and I dont know if it will work for all situations. Please advise.

Thanks in advance.

Message was edited by: Kenny Martinez