通过SAP访问SAP时面临错误。下面是详细信息:我可以从存储在out中的SAP获得响应,但是它在将异常返回到我的函数时抛出一个异常。以下是代码:
internal string FromBupaToBupaGuid(string sBupa)
{
using (SAPContext db = new SAPContext(base.GetConnectStringForRfcUser()))
{
ERPConnect.LIC.SetLic(base.GetLicenseKey());
string sBupaGuid;
SAPContext.MESSAGESTable mESSAGESTable = new SAPContext.MESSAGESTable();
sBupa = ToBupa(sBupa);
db.IST_GET_BPARTNER_GUID(out sBupaGuid, sBupa, mESSAGESTable);
return sBupaGuid;
}
}以下是异常信息:
System.AccessViolationException was unhandled
HResult=-2147467261
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=ERPConnect40
StackTrace:
at ERPConnect.RFCAPI.RfcCallReceiveExt(Int32 handle, Int32 hSpace, String FuncName, StringBuilder Exception)
at ERPConnect.R3Connection.Ping()
at ERPConnect.Linq.ERPDataContext.Dispose(Boolean disposing)
at ERPConnect.Linq.ERPDataContext.Dispose()注意:代码中没有问题,因为它的旧代码很安静,在我早期的机器(Windows7+ VS 2012)上运行良好,现在使用的是Windows8.1。
我已经试过了:
请帮帮忙。
发布于 2015-10-12 11:54:25
就我的情况而言,问题与lfc32.dll丢失在SystemWow文件夹中有关,通过将两个librfc (一个为32位,另一个为64位)放置在SystemWow文件夹中来解决这个问题。
我参考了以下链接,其中包含了有关库位置和dll的所需信息:
希望这对其他人有帮助。
发布于 2015-10-06 08:37:11
在使用connection.CreateFunction()方法使用标准BAPI函数时,我也遇到了同样的问题。它似乎也是随机发生的。
RFCFunction funcModify = _r3Connection.CreateFunction("BAPI_ALM_NOTIF_DATA_MODIFY");
funcModify.Exports["NUMBER"].ParamValue = notifNo.PadLeft(12,'0');我用theobald软件发了一张票,是ERPconnect的所有者。将张贴任何有用的信息,如果我设法到工作。
https://stackoverflow.com/questions/32009476
复制相似问题