cancel
Showing results for 
Search instead for 
Did you mean: 

RPC_E_SYS_CALL_FAILED Error

Former Member
0 Kudos
1,072

Hi

We've got an addin installed on a customer site that creates a number of Production Orders based on a Sales Order depending on particular rules that are set up in the data against the Sales Order.

We've currently got a problem where at various times in the code, usually when doing a "ProductionOrder.Add" we are getting either of the following errors. The first one being more common.

*Unable to cast COM object of type 'SAPbouiCOM.ApplicationClass' to interface type 'SAPbouiCOM.IApplication'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{D1F75D47-137C-4335-AC2A-3FE209831B6A}' failed due to the following error: System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)).Interop.SAPbouiCOM at SAPbouiCOM.ApplicationClass.get_StatusBar()

at OchibaCode.OCHProdConfigurator.CreateProdOrder(Application SBO_Application, String SorderNoInt, String SorderNoExt, String FormTypeID, String FormUID, String TLJobSeries, String TLAJobSeries, String CreateWIP, String CurrentUser)*

*Error: -2147417851

The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

at SAPbobsCOM.FieldClass.set_Value(Object pVal)

at OchibaCode.OCHProdConfigurator.CopyITT1UDFs(Recordset UDFs, Recordset SourceData, ProductionOrders ProdOrder)*

Now the weird thing is it doesn't always occur in the same position which sort of rules out a data problem and also we've copied the database to a local laptop and ran the code against the same record on here and the problem doesn't occur.

So it looks like somehow the environment is causing the problem. It looks as if possibly there is a problem with memory usage or something where it gets to a particular point and cannot allocate any more memory so just falls over with the error.

Has anyone else come across this problem and if so how can it be resolved?

Thanks

Steve

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member206488
Active Contributor
0 Kudos

or you can try this from SAP Note :1235603

This issue results from using the following code:
SAPbobsCOM.Field f = oPOrders.Lines.UserFields.Fields.Item("U_test")

Instead of the above syntax, you should use the following:
SAPbobsCOM.ProductionOrders_Lines f1 = oPOrders.Lines
SAPbobsCOM.Field  f =  f1.UserFields.Fields.Item("U_test")

Using the suggested syntax lets you perform the operation correctly. The issue does not happen with a regular connection.

The cause for this error in the behavior of the .NET Garbage Collector.
When the Garbage Collector is activated, it decided which memory to release and which not. In the example above, the parent object is release, while the child object (Field in our case) remains which causes the exception.
The Garbage Collectors activation is controlled by .NET. The DI cannot control its activation.

Thanks,

Neetu

Former Member
0 Kudos

Thanks for the replies Neetu.

We've tried removing the SM_OBS_DLL folder from the temp directory, however this didn't resolve the issue. We've also tried clearing down (releasing and doing a garbage collect ) and cleaning some of the code to see if this made a difference but still the problem occurs.

Is there anything else that could be causing the issue?

The RPC_E_SERVERFAULT server exception is occuring when setting the line UDF values of some of the production order.

Steve

former_member206488
Active Contributor
0 Kudos

Hi,

Check if DIAPI verison is same as SAP . also delete Observer.dll from %temp% folder.

or Edit the file Program Files\SAP\SAP Business One\Log \b1LogConfig.xml and set Trace = 0

Thanks,

Neetu