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: 

How do I check the delete database table is successful?

Former Member
0 Kudos
760

After delete all the records from the database table, how do I check it is successful? When do I need to 'commit'? (after delete table or after insert new data?)

Thanks,

Helen

1 ACCEPTED SOLUTION

dani_mn
Active Contributor
0 Kudos
123

HI,

you can check with following query.

SELECT SINGLE * FROM db_table.

IF sy-dbcnt = 0.

"table is empty"

ENDIF.

REgards,

6 REPLIES 6

Former Member
0 Kudos
123

ya i think after deleting u have to commit it...

for just check deleting data u put brakpoint in program and just check what is flow and all things..

also u can check using se11 for perticular value whcih u deleted.

dani_mn
Active Contributor
0 Kudos
124

HI,

you can check with following query.

SELECT SINGLE * FROM db_table.

IF sy-dbcnt = 0.

"table is empty"

ENDIF.

REgards,

Former Member
0 Kudos
123

Hi,

Check sy-subrc = 0..

DELETE ZTABLE..OR INSERT ZTABLE...

IF SY-SUBRC <> 0.

MESSAGE E000 WITH 'DATABASE DELETE FAILED'.

ELSE.

COMMIT WORK...

ENDIF.

Thanks,

Naren

jayanthi_jayaraman
Active Contributor
0 Kudos
123

Hi,

delete ztab.

if sy-subrc eq 0.

message s000 with 'success'.

endif.

0 Kudos
123

if sy-subrc = 0.

show msg that delete is success.

endif.

Regards

- Gopi

former_member223537
Active Contributor
0 Kudos
123

Hi Helen,

DELETE ZTABLE.

<b>If sy-subrc eq 0.

  • DELETION IS SUCCESSFUL

else.

  • DELETION IS NOT SUCCESSFUL.

endif.</b>

<b>Yes you need to do COMMIT WORK.</b>

Best regards,

Prashant