Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP witn Windows/SQL

Former Member
0 Likes
402

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
377

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.

1 REPLY 1
Read only

Former Member
0 Likes
378

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.