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 to judge a db table is empty or not.

Former Member
0 Kudos

Hi All,

how to judge a db table is empty or not. don't use select clause

7 REPLIES 7

Former Member
0 Kudos

from se11/16 check no of hits.

Regards

Prabhu

Former Member
0 Kudos

Hi..,

You can check this from Tcodes SE11 or SE16..

or from the program also u can check that..

write a <b>select *</b> query on that table without any conditions and check the value of <b>sy-dbcnt</b> after the select statement !!

<b>SY-DBCNT eq 0 </b>, for an empty table after select *..

regards,

sai ramesh

Former Member
0 Kudos

Hi

Use Describe

kiran_k8
Active Contributor
0 Kudos

Johny,

The statement DESCRIBE TABLE sets the system fields sy-tfill and sy-tleng.

and the system fields sy-tfill and sy-tleng are filled with the current number of table rows and the length of a table row in bytes.

use tcode ABAPHELP for more info.

K.Kiran.

Former Member
0 Kudos

Hi.....

you can communicate with Database only with Select statement(SQL)

There is no other way except SELECT CLAUSE.

if you want to it manually use the transaction SE16.

Regards,

Suresh..

Former Member
0 Kudos

As the database tabel is at different server, SAP has to use SELECT statemnt to know the Number of record programatically

Otherwise check manually using SE11/SE16 transaction & get the number of hits

Former Member
0 Kudos

Get Solution from internal colleague