cancel
Showing results for 
Search instead for 
Did you mean: 

SAP DI method GetByKey() crash my app if the key does not exist

former_member244307
Participant
0 Kudos

Hi All,

I have an issue in recent our SAP upgrade from 882 to SAP 9, I noticed that my application will crash if GetByKey() method receive a none exist key value. For example, items.GetByKey(item_code) for ItemMaster, if the item_code doesn't exist in SAP OITM table, then my application crashes. The exception says "Attempted to read or write protected memory. This is often an indication that other memory is corrupted" But if I pass a exist ItemCode value then no exception. I am using 8.8 DI dll, but I tried DI 9.0, seems same result. I tried for BP object, similar issue.  Seems my try/catch can't capture this exception. Any idea?

P.S. Everything is running well in my previous 882.

Thanks,

Lan

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member244307
Participant
0 Kudos

Hi All,

Thank all your replies. I did try use SAP 9 DI reference, it works in our SAP 9 lab but not our real live environment(I mean after upgrade to SAP 9). My system admin mentioned to me that there could be some hot fix patch not exactly same between our SAP 9 lab and live environment. But regardless, how come DI 882 is not supported by SAP 9 anymore? Is any official announcement talking about this issue? Any one know it? The main reason is that we have so many DI application in our company, if we switch to SAP 9 DI dll, then we have to re-test them. I remember we did it when we upgrade from DI 2007 to 8.8.

Thanks,

Lan

pvsbprasad
Active Contributor
0 Kudos

Hi,

For getting Item name u can get it by "query".

or

try this

Dim oOrder As SAPbobsCOM.Item

oOrder = company.GetBusinessObject (SAPbobsCOM.BoObjectTypes.oitem)

ret = oOrder.GetByKey(ItemCode)

Regards,

Prasad

maik_delly
Active Contributor
0 Kudos

Hi Lan,

can you give some more information, since this error is not reproduceable.

Which patchlevel are you using ?

Is it a 32 or 64 bit OS and project ?

Did you reference the new SBO 9.0 SAPbobsCOM  ?

regards,

Maik

former_member244307
Participant
0 Kudos

Hi Maik,

Thanks for your reply. Here is my SAP 9 ver : SAP 9.0 (9.02.230) PL:13 (32-bit), My OS is 64-bit Win7, x64-based processor. My app is compiled under x86 platforrn in VS 2010.I want to keep my  app to use 882 DLL

Thanks,

Lan

Former Member
0 Kudos

Hi ,

first remove the existing reference of SAPbobsCOM.dll and  add a new reference of SAPbobsCOM.dll of SAP version, then compile to x86

Hope this will solve the issue.

regards, alessandro