SAP和外圍系統(.NET)的交換一直是一件頭痛的事情,目前比較靈活的也就是RFC了,但是還是怪異的異常頻發。。。。
異常1:調用端沒有安裝SAP用戶端組件,主要是system32下缺少了一個librfc32.dll檔案
異常2:
The CLR has been unable to transition from COM context 0x211618 to COM context 0x211788 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
逾時,RFC太複雜,或是資料量太多都會造成逾時,這個還算比較好處理
異常3:
System exception thrown while marshaling RFCTYPE_BCD to .NET type.
如果RFC中用TIMS類型或DATS類型一定要小心,SAPLogin 710和Framework 好像相容性不好很容易報錯,但是用640的librfc32.dll(大概7M左右)不會出錯。