2009 Sep 22 2:11 PM
Hi,
I have an abap that is reading an MS-ACCESS database.
When I execute it +online,+ it works just fine.
However when I want to run it as step in a batch job, I receive upon
CALL METHOD OF REC 'Open'
EXPORTING #1 = SQL
#2 = CON
#3 = '1'.
no error, but the field CON-HANDLE contains "1-" and no data can be read.
Has anyone any idea how to solve this please?
Thanks!
Danny
2009 Sep 27 6:55 PM
In background, direct OLE can't work (because it can work only when the ABAP is called from SAPGUI).
This solution might work (assuming the MS-access computer is always switched on of course) : Your ABAP must call a program by RFC on the MS-Access computer. This program, you must create it with RFC SDK in any language (C, java, etc.) The RFC server program has to be installed too. It will read MS-Access database.
There are 2 ways:
1) If you don't want to recode everything, and keep your OLE ABAP code, the program should "call back" your OLE ABAP code on the the SAP system by RFC again (enable dialog mode so that OLE can be used). You just have to create an RFC enabled function module which executes the whole OLE.
2) Or migrate your OLE ABAP code to the new program on the MS-access computer (you have to re-code everything, but maybe it's best)
2009 Sep 27 5:42 PM
Hi,
Batch job is executed in the application server. Make sure your application server has ms-access installed and it has acces to the odbc datasource or to the network directory where the mdb file is located.
-Simo
2009 Sep 27 6:55 PM
In background, direct OLE can't work (because it can work only when the ABAP is called from SAPGUI).
This solution might work (assuming the MS-access computer is always switched on of course) : Your ABAP must call a program by RFC on the MS-Access computer. This program, you must create it with RFC SDK in any language (C, java, etc.) The RFC server program has to be installed too. It will read MS-Access database.
There are 2 ways:
1) If you don't want to recode everything, and keep your OLE ABAP code, the program should "call back" your OLE ABAP code on the the SAP system by RFC again (enable dialog mode so that OLE can be used). You just have to create an RFC enabled function module which executes the whole OLE.
2) Or migrate your OLE ABAP code to the new program on the MS-access computer (you have to re-code everything, but maybe it's best)
2009 Sep 28 7:58 AM
Thank you all for your suggestions!
However it seems strange to me that MS-ACCESS can not be accessed from the server, I keep on searching...
2009 Sep 28 8:47 AM
It can if it is windows, but mostly it is some kind of unix. Maybe there are odbc driver files available for unix, ask your basic guys for that.