on 10-18-2005 8:29 AM
Hello,
can someone tell/explain me how to cast a .NET byte[] array to an RFCTYPE_BYTE[] array, because i get a marshalling error when filling a BAPICONTENT255Table.
Thanks for any help in advance,
CHM
My mistake! The .Net Connector handels any marshaling for you, i guess. It just throws an exeception (System exception thrown while marshaling .NET type System.Byte[] to RFCTYPE_BYTE) when you do not assign a value to a table row field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
as i posted before you should not experience problems when you properly assign a value to each field. maybe this code fragment can help you
for ( i = 0; count < fs.Length-254; i++ )
{
count += 255;
bincontent.Add((SAPRM.BAPICONTENT255)bincontent.CreateNewRow());
bincontent<i>.Line=r.ReadBytes(255);
}
bincontent.Add((SAPRM.BAPICONTENT255)bincontent.CreateNewRow());
byte [] fill= new byte[255];
r.ReadBytes(255).CopyTo( fill, 0);
bincontent<i>.Line = fill;
Finally we've solved it.
Firstly we tried to "cut" the last file since it doesn't need to be so long but that's where SAP Connector error raises up. For whatever reason, SAP structure needs to have all rows with the same length.
Filling up with empty bytes at the end works nice for us.
See ya!
User | Count |
---|---|
82 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.