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

internal tables

Hi all,

i declared a internal table as hashed type,

my problem is that,how can we insert or append data into internal table through work area.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2008 at 02:53 PM

    If your declaration of the table includes WITH HEADER LINE, just use tablename-variablename assignments and then APPEND or MODIFY tablename.

    If it doesn't, declare a variable of the same type as the table structure (this is called WorkArea) and assign values using workareaname-variablename and when you are done APPEND or MODIFY tablename , with APPEND wornareaname INTO tablename.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2008 at 02:53 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 19, 2008 at 03:00 PM

    Hi, it is impossible to use append with hashed table because it is index operation. Use insert.

    INSERT wa_line INTO gt_table.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2008 at 03:02 PM

    True,my bad.

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi,

    try this way-

    DATA:Itab like sorted table of sflight.

    wa like line of itab.

    wa-carrid = 'AA'.

    wa-connid = '017'.

    Append wa to itab.

    Clear wa.

    wa-carrid = 'AB'.

    wa-connid = '012'.

    Append wa to itab.

    As you have declared internal table as sorted so when you insert data you have to maintain sorting order.

    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.