Posted: Wed Feb 25, 2009 1:43 pm Post subject: Upload Data From MS Access Into an Internal Table
Code:
*———————————————————————*
* Report Name : YGECICI
*———————————————————————*
* Author : Amit Khari
* Location :ABAPcode site
* Date / Time : 05 may 2007
* Subject : Upload Data From MS Accsess Into an Internal Table
*———————————————————————*
REPORT ygecici MESSAGE-ID 00 NO STANDARD PAGE HEADING
LINE-SIZE 200
LINE-COUNT 65.
INCLUDE ole2incl.
DATA: con TYPE ole2_object,
rec TYPE ole2_object.
DATA sql(1023).
DATA: BEGIN OF spl OCCURS 0,
val(1023),
END OF spl.
DATA: BEGIN OF i1 OCCURS 0,
f1 TYPE i ,
f2(10),
f3(10),
END OF i1.
IF con-header IS INITIAL OR con-handle = -1.
CREATE OBJECT con 'adodb.connection'.
IF NOT sy-subrc = 0.
EXIT.
ENDIF.
CREATE OBJECT rec 'adodb.recordset'.
IF NOT sy-subrc = 0.
EXIT.
ENDIF.
ENDIF.
* MDB Connetion Infomations ….
CONCATENATE 'provider=' '"microsoft.jet.oledb.4.0"' ';'
INTO sql.
CONCATENATE sql 'password=' '''' ';'
INTO sql.
CONCATENATE sql 'user id=’ '"admin"' ';'
INTO sql.
CONCATENATE sql 'data source=' '"c:\mm.mdb"' ';'
INTO sql.
CONCATENATE sql 'mode=' '"share deny none"'
INTO sql.
* MDB Connection …
CALL METHOD OF con 'open'
EXPORTING #1 = sql.
*
* Query (Insert) Statement …
sql = 'insert into [test] values('.
CONCATENATE sql '"a"' ',' '"1"' ')' INTO sql.
* Query Run …
CALL METHOD OF rec 'open'
EXPORTING #1 = sql
#2 = con
#3 = '1'.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.