‎2008 Jan 29 12:39 PM
Hi,
One of my feloow associates has SAP witn Windows/SQL and an external SQL database for Website purposes.
he can read a table from the external database and load it in a SAP table.
but he can't write the external table from SAP/ABAP.
How could he do it?
‎2008 Jan 30 5:40 AM
As it's explained in abaphelp for exec keyword) If you have update
rights to the external table, then
Exec sql.
Uptade table ...
Endexec
Or
Exec sql.
Insert into table (field list) values (value list)
Endexec.
Should do the task.
(you don't need to put the performing form part of the exec)
The exact sintax for update or insert varies from RDBMS to RDBMS (but
many of them rely on insert into to add new rows and update to change
current values stored in a given row.
If you have an internal table holding the values to be updated then a
loop like the following is mandatory:
loop at youritab
exec sql
<< Update routine in native sql >>
End exec
Endloop
Cheers,
Chaitanya.
‎2008 Jan 30 5:40 AM
As it's explained in abaphelp for exec keyword) If you have update
rights to the external table, then
Exec sql.
Uptade table ...
Endexec
Or
Exec sql.
Insert into table (field list) values (value list)
Endexec.
Should do the task.
(you don't need to put the performing form part of the exec)
The exact sintax for update or insert varies from RDBMS to RDBMS (but
many of them rely on insert into to add new rows and update to change
current values stored in a given row.
If you have an internal table holding the values to be updated then a
loop like the following is mandatory:
loop at youritab
exec sql
<< Update routine in native sql >>
End exec
Endloop
Cheers,
Chaitanya.