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: 

count the entries in internal table

Former Member
0 Kudos
167

Hi ,

I want to count the entries nd updated in the same internal table or other internal table

Thanks,

Asha

REPORT ZCOUNT.

TYPES: BEGIN OF i_ekko,

cbox TYPE c,

text(15) TYPE c,

ln_AA TYPE i,

ln_wr TYPE i,

ln_rj TYPE i,

END OF i_ekko.

DATA: it_ekko TYPE STANDARD TABLE OF i_ekko INITIAL SIZE 0,

wa_ekko TYPE i_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'APPROVED'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'WARNING'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'REJECTED'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'APPROVED'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'WARNING'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'REJECTED'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'WARNING'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'WARNING'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'REJECTED'.

APPEND wa_ekko TO it_ekko.

LOOP AT IT_EKKO INTO WA_EKKO.

ENDLOOP.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
102

Hi,

Use the follwing statement.

data lines type i.

DESCRIBE TABLE it_ekko LINES lines.

WRITE:/ lines.

or

DESCRIBE TABLE it_ekko.

WRITE:/ sy-tfill.

Regards,

Amit

8 REPLIES 8

Former Member
0 Kudos
102

Hi,

You can use the syntax DESCRIBE TABLE..

DESCRIBE TABLE itab.

WRITE: / 'Number of rows', SY-TFILL.

Thanks

Naren

Former Member
0 Kudos
102

Hi asha,

Use the below syntax to find the number of internal table records.

DATA: G_LIN TYPE I.

DESCRIBE TABLE IT_EKKO LINES G_LIN.

G_LIN contains number of lines in internal table IT_EKKO.

Regards,

KK

Former Member
0 Kudos
102

hi

use this statement

describe table itab line lin occurs ini kind knd.

Former Member
0 Kudos
102

hi,

you can use count = lines(internal table name).

Shruthi

Former Member
0 Kudos
102

Hi Asha,

Use DESCRIBE and SY-TFILL .

SY-TFILL gives the number of records in the internal table.

DESCRIBE TABLE t_itab.

Write: SY-TFILL.

Regards,

Chandra Sekhar

Former Member
0 Kudos
102

just copy paste the below code :

TYPES: BEGIN OF i_ekko,

cbox TYPE c,

text(15) TYPE c,

ln_AA TYPE i,

ln_wr TYPE i,

ln_rj TYPE i,

END OF i_ekko.

DATA: it_ekko TYPE STANDARD TABLE OF i_ekko INITIAL SIZE 0,

wa_ekko TYPE i_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'APPROVED'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'WARNING'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'REJECTED'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'APPROVED'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'WARNING'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'REJECTED'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'WARNING'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'WARNING'.

APPEND wa_ekko TO it_ekko.

wa_ekko-cbox = 'X'.

wa_ekko-text = 'REJECTED'.

APPEND wa_ekko TO it_ekko.

describe table it_ekko.

write sy-tfill.

Former Member
0 Kudos
103

Hi,

Use the follwing statement.

data lines type i.

DESCRIBE TABLE it_ekko LINES lines.

WRITE:/ lines.

or

DESCRIBE TABLE it_ekko.

WRITE:/ sy-tfill.

Regards,

Amit

Former Member
0 Kudos
102

Thanks