Application Development 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: 

EXEC SQL. command [UPDATE]

former_member207153
Participant
0 Kudos

Hi Expert.

on 4.6c i use below statement to update other table which reside in other sql server :

DATA: Updatedby(10).

updatedby = sy-repid.

exec sql.

update SAP_BOOKING

set contractno = '1234',

sapstatusdate = GETDATE(),

lastupdatedby = :updatedby

where BOOKINGNO = '22384'

commit

endexec.

but when i trigger this statement on ECC6 env, this command failed , its due to :updatedby parameter.

how to deal with this problem? did anyone encounter this problem before? please kindly help.

5 REPLIES 5

former_member222860
Active Contributor
0 Kudos

Hi,

Check the tcode SM21, you'll find the detailed analysis of the error.

former_member207153
Participant
0 Kudos

i did try using that sm21, but not helping to solve problem.

not much information specify in there.

0 Kudos

Pl. check the datatype and length of the field 'Updatedby' at the database level and Maintain the same at the ABAP level.

former_member207153
Participant
0 Kudos

Seem either because of kernel error or something,

This coding only work in 4.6C , but in ECC6, i tested and found that

it must use Method EXECUTE_UPDATE instead using direct command on my previous thread.

anyone have other comment , prob can share with me any SAP Notes related with my thread?

former_member207153
Participant
0 Kudos

case close