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

No of records in internal table for particular value(without loops)

Hi all,

I want to get the number of records in an internal table with a particular value for a field. Can it be done by using the “describe” statement? Can anyone help me to solve this problem.I dont want to use loops to do the same

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Feb 14, 2005 at 06:37 AM

    Hello,

    Define a temporary Internal table which is similar to the one which holds the data.

    G_T_ITAB_TMP[] = G_T_ITAB[].

    Delete G_T_ITAB_TMP where <Field> <> <value>

    describe table G_T_ITAB_TMP lines....

    Hope this helps you.

    Regds, Murugesh AS

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 14, 2005 at 06:51 AM

    Hello Dominic,

    If you are very particular about not using the LOOPs, then the approach suggested by Murugesh seem to me to be the only option.

    But then, let us say you want to find out how many times each different value occurs for a particular field in an internal table, then the best option is to use a loop.

    Regards,

    Anand Mandalika.

    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.