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: 

internal tables

Former Member
0 Kudos

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.

10 REPLIES 10

Former Member
0 Kudos

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.

Former Member
0 Kudos

former_member1033672
Participant
0 Kudos

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

INSERT wa_line INTO gt_table.

0 Kudos

hi,

Thank u for reply,

can we access hashed tables through index ?....

how can we use insert .

0 Kudos

any one give me reply soon.............

0 Kudos

No, as I wrote you before, you cannot access hashed tables via indexes.

0 Kudos

thank u ,

then how to insert data into hashed table.......

0 Kudos

INSERT wa_data INTO gt_data.

of course, you can also select data into hashed tables from DB, or you can use COLECT....

Former Member
0 Kudos

True,my bad.

Former Member
0 Kudos

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.