File when convert into bytes and passing to RFC without any issue but when
trying to open file at SAP its does not opening or it seems to be
corrupted. Please provide me any solution what went wrong, below is my code:
IRfcTable BINARCHIVOBJECT_TBL =
IT_ATTACHMENTS_STRUC.GetTable(RFC_Constant.BINARCHIVOBJECT);
RfcStructureMetadata BINARCHIVOBJECT_MetaDataAtt =
BINARCHIVOBJECT_TBL.Metadata.LineType;
IRfcStructure BINARCHIVOBJECT_STRUC = null;
//List<byte> bytes = new List<byte>();
#region - Split file byte by 1024 -
List<byte[]> arrList =
splitArray2(objLicenseAndCertificateDocument.File, 1024);
int BinaryLength = 0;
foreach (byte[] b in arrList)
{
BINARCHIVOBJECT_STRUC =
BINARCHIVOBJECT_MetaDataAtt.CreateStructure();
BINARCHIVOBJECT_STRUC.SetValue("LINE", b);
BINARCHIVOBJECT_TBL.Append(BINARCHIVOBJECT_STRUC);
BinaryLength += 1;
//bytes.AddRange(b.ToList());
}
For Split array into size of 1024
private List<byte[]> splitArray2(byte[] barray, int splitSize)
{
var bList = new List<byte[]>();
byte[] dest = new byte[splitSize];
for (int i = 0; i < barray.Length; i += splitSize)
{
if (barray.Length - i >= 1024)
{
Array.Copy(barray, i, dest, 0, splitSize);
}
else
{
dest = new byte[barray.Length - i];
Array.Copy(barray, i, dest, 0, barray.Length - i);
}
bList.Add(dest);
dest.Initialize();
}
return bList;
}
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.