System exception thrown while marshaling .NET type System.Byte[] to RFCTYPE_BYTE

System exception thrown while marshaling .NET type System.Byte[] to RFCTYPE_BYTE

Hello guys,

I'm consuming BAPI_USER_CREATE1 in Visual Studio 2008 with My SAP Explorer and integrating with Outsystems.

I give the the username, password and lastname that is what is required by the BAPI.
In SAP it works fine!

When i execute in Outsystems it's gives me the folowing error:

System exception thrown while marshaling .NET type System.Byte[] to RFCTYPE_BYTE

Anyone knows how to resolve it?

Thanks in advance!
Hi Fernando

Can you get the full error detail information from the Service Center, and place it here for analysis?



Miguel João

I "resolve it" by deleting a none required structure that was sending binary data fields and it corresponding code in C#. Now it's working fine. Maybe the error was because i was not inserting data in that binary data field.

However i leave the error detail:

Id: 81f2a7bb-73bb-4597-b680-e014aea70d4a
Time of Log: 2010-02-05 14:28:51
eSpace Name: GestaoUnificadadeUti
Tenant Name: GestaoUnificadadeUti
User Id: 2
Session Id: g31k5045hafqa255lvvuds55
Server: HYFAST2
Module Name:
Message: [1] System exception thrown while marshaling .NET type System.Byte[] to RFCTYPE_BYTE
Stack: em ssGestaoUnificadadeUti.RssExtensionccc.MssBapi_User_Create2(HeContext heContext, IRecord inParamSaplogon_Ccc, IRecord inParamAddress, IRecord inParamAlias, IRecord inParamCompany, IRecord inParamDefaults, String inParamEx_Address, String inParamForce_System_Assignment, IRecord inParamLogondata, IRecord inParamName_In, IRecord inParamPassword, IRecord inParamRef_User, String inParamSelf_Register, IRecord inParamSnc, IRecord inParamUclass, String inParamUsername, RecordList inParamAddcomrem_In, RecordList inParamAddfax_In, RecordList inParamAddpag_In, RecordList inParamAddprt_In, RecordList inParamAddrfc_In, RecordList inParamAddrml_In, RecordList inParamAddsmtp_In, RecordList inParamAddssf_In, RecordList inParamAddtel_In, RecordList inParamAddtlx_In, RecordList inParamAddttx_In, RecordList inParamAdduri_In, RecordList inParamAddx400_In, RecordList inParamExtidhead_In, RecordList inParamExtidpart_In, RecordList inParamGroups_In, RecordList inParamParameter_In, RecordList inParamP...tParamParameter_Out, RLBAPIPARAM4RecordList& outParamParameter1_Out, RLBAPIRET6RecordList& outParamReturn_Out)
em ssGestaoUnificadadeUti.Flows.FlowAssets.ScrnAD_List.Preparation(HeContext heContext)
em ssGestaoUnificadadeUti.Flows.FlowAssets.ScrnAD_List.Page_Load(Object sender, EventArgs e)
em System.Web.UI.Control.OnLoad(EventArgs e)
em System.Web.UI.Control.LoadRecursive()
em System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
(Continues in f8fe4978-2609-4e96-8bdc-13933394ff4d)
eSpaceVer: 244 (Id=704, PubId=820, CompiledWith=
RequestUrl: http://localhost/GestaoUnificadadeUti/admin/_Default.aspx
AppDomain: /LM/W3SVC/1/ROOT/GestaoUnificadadeUti/admin-13-129098536701607496
FilePath: C:\...\PS\test\GestaoUnificadadeUti\admin\AD_List.aspx
Locale: pt-PT
DateFormat: yyyy-MM-dd
PID: 372 ('w3wp', Started='05-02-2010 09:18:05', Priv=186Mb, Virt=576Mb)
TID: 6
.NET: 2.0.50727.4927


Fernando Santos 
Hi Fernando

It's good to know that you've overcome this problem.

Most likely that structure had a datatype not supported by the our SAP Integration Services. The SAP Integration in .NET Extensions technical note includes a list of supported RFC data types, and the correspondent OutSystems datatype mapping.

If you check the SAP BAPI WSDL for that structure attribute's data type, I recommend you compare against that list, to see if any of them is a non-supported data type.

If in the future you'll need to use this structure, depending on the datatype, there may be a solution to support it, if this is the case.


Miguel João

hi Fernando,

i have the same problem.
did you remember which structure you have removed?

Thanks in advance

Best regards,
Olga Santos

I solved this problem by passing something to the fields "Binary Data" (make a httprequest).

Fields with binary datatype of input records/records list to bapis cannot be empty (when using transparency services)

Best Regards,
Olga Santos