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

System Variable For Internal table count

Former Member
0 Likes
3,803

Can anybody tell me what the system variable for internal table count?

I just wants to know how many recoreds are there in my internal table ?

Regards,

pandu.

13 REPLIES 13
Read only

Former Member
0 Likes
1,787

Hi,

Use the command describe table itab lines n.

Regards

Shiva

Read only

Former Member
0 Likes
1,787

HI

sy-tabix.

or use describe table.

DESCRIBE TABLE it_vendor LINES v_totalrec.

Edited by: Jyothsna M on Feb 21, 2008 7:55 AM

Read only

Former Member
0 Likes
1,787

use DESCRIBE statemenmt

DESCRIBE TABLE itab LINES n.

here, n will give the numbmer of records in theinternal table itab.

Regards.

Read only

Former Member
0 Likes
1,787

SY-TABIX

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Feb 21, 2008 4:53 PM

Read only

Former Member
0 Likes
1,787

Check sy-dbcnt .

or use

data :lv_no type i .

Desrcribe table itab lines lv_no .

Regards,

Vijay

Read only

0 Likes
1,787

Hi ,

DESCRIBE TABLE <itab> [LINES <l>] [OCCURS <n>] [KIND <k>].

If you use the LINES parameter, the number of filled lines is written to the variable <lin>. If parameter, the you use the OCCURS value of the INITIAL SIZE of the table is returned to the variable <n>. If you use the KIND parameter, the table type is returned to the variable <k>: ‘T’ for standard table, ‘S’ for sorted table, and ‘H’ for hashed table.

using variable

SY-TFILL

After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table.

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Feb 21, 2008 4:53 PM

Read only

0 Likes
1,787

Thanks to all,

But dint get the solution. my problem is , i have in internal table and in that i have data . i have created one more fields in the same internal table , and i have to return total no of records to that field...

Anybody help me pls..

Regards,

pandu.

Read only

Former Member
0 Likes
1,787

hi,

DESCRIBE TABLE itab LINES v_lines.

regards,

pavan t.

Read only

Former Member
0 Likes
1,787

I

Hi,

SY-TABIX

Current line of an internal table. It is set only for index tables. The field is either not set or is set to 0 for hashed tables. It iset by ABAP commands APPEND,COLLECT,LOOP AT,READ TABLE,SAERCH itab FOR .

SY-TFILL

After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table.

Database Access

SY-DBCNT

It contains the number of table entries processed. In an loop it is not set until after the ENDSELECT or ENDEXEC statement. It is set by ABAP

Regards.

Read only

Former Member
0 Likes
1,787

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

DESCRIBE TABLE <itab> [LINES <l>] [OCCURS <n>] [KIND <k>].

If you use the LINES parameter, the number of filled lines is written to the variable <lin>. If you use the OCCURS parameter, the value of the INITIAL SIZE of the table is returned to the variable <n>. If you use the KIND parameter, the table type is returned to the variable <k>: ‘T’ for standard table, ‘S’ for sorted table, and ‘H’ for hashed table

DATA RECS TYPE I.

DESCRIBE TABLE <ITAB> LINES RECS.

Read only

0 Likes
1,787

Thank u for ur reply.

This is iam working for BAPI, i got that no. of records while debugging, but iam iam not gettimg in the out put.

How to do that ?

actually i have written the query like this....

select matnr

werks

maabc form marc into table itab where mabbc <> ' '.

describe table itab lines itba-tot_num_rec.

can pls tell me y iam not getting the value in bapi output?

Regards,

pandu

Read only

0 Likes
1,787

Hi,

not sure whether this solves the problem or not.

create a new variable for the number of lines and assign it to the field in itab.

pls make sure that you are APPENDing the data.

regards,

teja.

Read only

Former Member
0 Likes
1,787

Hi,

use this staement for getting total number of records.

DESCRIBE TABLE itab LINES v_lines.

best regrds

Satya