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

Insert timestamp into external MS SQL table using ABAP

former_member239066
Participant
0 Likes
1,482

Hi Expert,

We have a requirement for which we have to insert records in an MS SQL table. The table contains a field of type DATETIME. We need to fill that field with the actual date and time.

We have concatenated date and time in the format 'YYYY-MM-DD HH:MM:SS' and we are getting the dump 'SQL error 241 occurred while executing Native SQL.'.

We are looping on an internal table to insert each record 1 by 1.

Could you please help to find a solution for the timestamp?

Thanks,

Vitish.

1 ACCEPTED SOLUTION
Read only

former_member239066
Participant
0 Likes
1,020

Hello Jelena,

The issue is solved. The timestamp format should be 'YYYY-DD-MM HH:MM:SS' instead of 'YYYY-MM-DD HH:MM:SS'.

Regards,

3 REPLIES 3
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,020

What have you tried so far? Google -> "SQL error 241" finds 400K+ entries, surely some of the posts should have triggered some ideas and further analysis. Ask the external database's DBA as well. It's not really an ABAP question.

Read only

former_member239066
Participant
0 Likes
1,021

Hello Jelena,

The issue is solved. The timestamp format should be 'YYYY-DD-MM HH:MM:SS' instead of 'YYYY-MM-DD HH:MM:SS'.

Regards,

Read only

0 Likes
1,020

If this is resolved then kindly let others know by accepting an answer. Otherwise this still shows up as "unanswered". Thank you.