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

Reg. comparison of two types of Internal tables.

Hi friends!

I have a doubt while declaring a internal table. whether to declare with header line or without header line. Can all types of manipulations be done after retrieving data from DB table to the Inernal table with headerline. Which of these two is more efficient. I would like to know the clear comparison between these two types.

regards,

prasad

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2005 at 06:11 PM

    Hi,

    Quite a detailed comparison has already been given for the two cases for internal tables. Just wanted to say that if you are looking for performance gains while processing internal tables, take a look at SAP Help for FIELD-SYMBOLS. They eliminate the need for copying internal table contents to and from work areas/header lines.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2005 at 11:53 AM

    Hi Prasad,

    you should declare your internal table without header line. The header lines still work, but they are not allowed in the OO context. Even for more clearness in your programs it is better to use a separate work area instead of a header line. Also in case of maintenance and release changes (you might do an update to a release that will not allow header lines anymore) it is better to use a separate work area.

    regards

    Siggi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2005 at 01:49 PM

    Hi Prasad,

    Internal table with headerline will occupy more memory than the internal without header line. Thus to have a better memory management you can use internal without header line.

    You can do all the manipulations on Tables without headerline as you do with headerlines. Even in the documentation all the internal table related manipulated are seperately provided for table with header line and table without header line. Actually, empty internal also occupy memory,so you need to think about the memory management also.

    In efficiency Table without header lines are more efficient than the tables with Headerlines.

    Check this link for the Manipulations on Internal tables...

    http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb36a1358411d1829f0000e829fbfe/content.htm

    Regards,

    Vara

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2005 at 11:55 AM

    Hi,

    Incase of declaring an Internal table with header line will make the processing looks simple as with in a loop and endloop statement your internal manipulations namely AT NEW, AT LAST, COLLECT and other similar statements will work out, but still clearing of the respective header needs to be done whenever there is exit happens to the application after successful completion. As because I have encountered errors due to failure in clearing header as in case of batch applications and BDC applications. Also as mentioned memory management also needs to be considered.

    Incase of declaring with work area except for the internal manipulations being pointed above, for all other cases it works out effectively and also more safer way to code your application.

    Also the declaration with or without header line also accounts whenever there is a call to a function module at which if we require to receive or pass some data through TABLES option then we need to look for the specified table type being used.

    So in all it depends the process in your application where in the type of declaration accounts.

    Regards,

    Jagath.

    Add a comment
    10|10000 characters needed characters exceeded

    • The last time I have declared a table with header line was somewhen in 1999/2000 when we moved to a 46c System.

      AT LAST, COLLECT etc does work also with internal tables without table lines. And if you pass it on as a tables parameter make sure to refer to its body by using the paranethesis.

      call function....

      tables

      param = it_table_without_header_line[]

      The mayor issue is the difference behaviour of the CLEAR statement.

      CLEAR it_table_with_header_line will just clear the header

      while

      CLEAR it_table_without_header_line will clear the table contents.

      Especially the different behaviour of this statement makes me to avoid those unintended deletes.

      To make it short I do not see any reson to declare a table with header-line.

      Christian

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.