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: 

Which is a better performing DELETE method for code optimization?

vaibhav_pandey
Explorer
0 Kudos
278

Hello Experts,

I am new to the SAP ABAP programming language and I am confused on DELETE query used with databases, both the below mentioned methods performs the same action of deleting the mentioned records but are written differently.

Which of the below mentioned method has better performance and why? Are there any more alternatives to do the same thing (deleting directly from database using SE16 is not an option).


DELETE z_vp_temp FROM TABLE @( VALUE #( ( cusid = '109') ( cusid = '106' ) ( cusid = '12' ) ) ). "Method 1

DELETE FROM z_vp_temp WHERE cusid IN ('106' , '109', '12').

"Method 2

2 REPLIES 2

matt
Active Contributor
205

Why not write a program and check the runtimes. And also use ST05 to see the path used by the SQL.

(My guess is the second method is faster).

Sandra_Rossi
Active Contributor
0 Kudos
205

The goal of an interview question is to see how well organized is your mind. Not to give the good answer. You can ask the community about the details that you can't find elsewhere.

So, what do you think?