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

Difference between DESCRIBE TABLE..... and SY-DBCNT

Former Member
0 Likes
3,729

Hi,

i want to know the difference between DESCRIBE TABLE.. command and SY-DBCNT.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,379

Hi,

Describe tells how many records are there in the table

Sy-dbcnt tells number of records u retrieved

Regards

Hi,

i want to know the difference between DESCRIBE TABLE.. command and SY-DBCNT.

7 REPLIES 7
Read only

Former Member
0 Likes
2,380

Hi,

Describe tells how many records are there in the table

Sy-dbcnt tells number of records u retrieved

Regards

Read only

Former Member
0 Likes
2,379

i m not sure..but i think so that the describe table list the number of records in internal table at runtime where sy-dbcnt gives the no. of records of database table.

Read only

Former Member
0 Likes
2,379

hi santosh,

To find out the attributes of an internal table at runtime that were not available statically, use the statement:

DESCRIBE TABLE itab [LINES lin] [OCCURS n] [KIND knd].

The DESCRIBE TABLE statement is processed before and after the table is filled. The current number of lines changes, but the number of initial lines cannot change.

The sy-dbcnt system field displays the number of records for which the desired database operation was actually carried out.

Reward points if useful.

Thanks you,

Regards.

Read only

Former Member
0 Likes
2,379

DESCRIBE TABLE - Related to Internal Table. If u want to know how many number of records in Internal Table means it will provide the details.

SY-DBCNT - Related to Database Table. After select statement we come to know how many records we retrieved.

- S

Read only

Former Member
0 Likes
2,379

SY-DBCNT ( No of database lines processed)

SQL statements set the content of SY-DBCNT to the number of database lines processed. With SELECT loops in Open SQL, SY-DBCNT is set after the ENDSELECT statement. In Native SQL, SY-DBCNT is set after the ENDEXEC statement.

· DELETEsets SY-DBCNT to the number of lines deleted.

· FETCHsets SY-DBCNT to the number of lines already read by the current cursor.

· INSERTsets SY-DBCNT to the number of lines inserted.

· MODIFYsets SY-DBCNT to the number of lines processed.

· UPDATE sets SY-DBCNT to the number of lines changed.

DESCRIBE TABLE ( No of Records in the Internal table)

- is to Determining the Attributes of Internal Tables .

To find out the attributes of an internal table at runtime that were not available statically, use the statement:

DESCRIBE TABLE : ‘T’ for standard table, ‘S’ for sorted table, and ‘H’ for hashed table

Regards,

Maha

Read only

Former Member
0 Likes
2,379

hi

good

SY-DBCNT->

SY-DBCNT gives the number of records in database table

After an open SQL statement, the system field sy-dbcnt contains the number of database lines processed.

REPORT ychatest.

DATA : v_matnr LIKE mara-matnr.

SELECT matnr FROM mara INTO v_matnr UP TO 1 ROWS.

ENDSELECT.

WRITE : sy-dbcnt.

DESCRIBE->

DESCRIBE LIST

The DESCRIBE LIST statement allows you to import certain list attributes, such as the number of lines or pages, into program variables.

you need to know the attributes of list levels that were not stored in system variables during list creation, you can use the DESCRIBE LISTstatement.

To retrieve the number of lines or pages of a list, use:

DESCRIBE LIST NUMBER OF LINES|PAGES n ...

To get the page number of a particular line number, use:

DESCRIBE LIST LINE lin PAGE pag ...

To get the properties of a particular page, use:

DESCRIBE LIST PAGE pag ...

Use DESCRIBE LIST for completed lists only, since for lists in creation (index is sy-lsind) some properties are not up to date.

http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba42335c111d1829f0000e829fbfe/content.htm

thanks

mrutyun^

Read only

Former Member
0 Likes
2,379

sy-dbcnt gives the no-of records fetched from the database.

describe gives the no-of records exist in the ITAB.

after fetching records from datyabase to ITAB, if we do not manipulate the ITAB, these 2 values r same.

if we manipulate iTAB (deleteing some rows/ adding some rows) , these values will be differ

Narendra