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

delete table from DB table

Former Member
0 Likes
575

HI,

when i try do delete table (itab) from DB table for instance for 10 records and one of the record not found in the DB

i get sy-subrc = 4.

How i know that the all the delete is not success or just one record is not in the table ,just do compering for sy-db count ?

Regards

Nina

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
523

sy-dbcnt can be one option.

from sap help itself if you press F1.

>The statement DELETE sets sy-dbcnt to the number of deleted rows.

so..

describle table itab lines gv_lines.

now use the delete statement.

now check if sy-dbcnt NE gv_count.

Edited by: Soumyaprakash Mishra on Oct 9, 2009 12:42 PM

3 REPLIES 3
Read only

Former Member
0 Likes
524

sy-dbcnt can be one option.

from sap help itself if you press F1.

>The statement DELETE sets sy-dbcnt to the number of deleted rows.

so..

describle table itab lines gv_lines.

now use the delete statement.

now check if sy-dbcnt NE gv_count.

Edited by: Soumyaprakash Mishra on Oct 9, 2009 12:42 PM

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
523

just do compering for sy-db count

So what exactly is your question?

BR,

Suhas

Read only

Former Member
0 Likes
523

better you go to database table and give the key field values which you want to check and execute it.