Skip to Content
author's profile photo Former Member
Former Member

count the entries in internal table

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    Posted on Sep 23, 2008 at 04:50 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 10:49 PM

    Hi,

    You can use the syntax DESCRIBE TABLE..

    DESCRIBE TABLE itab.

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

    Thanks

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 12:04 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 03:13 AM

    hi

    use this statement

    describe table itab line lin occurs ini kind knd.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 04:07 AM

    hi,

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

    Shruthi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 04:11 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 04:22 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 05:57 PM

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.