Application Development and Automation 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: 
Read only

standard table, sorted table & hashed table

Former Member
0 Likes
1,039

how can i transfer a standard table into sorted table ( and hashed table ).thanks.

1 ACCEPTED SOLUTION
Read only

former_member186741
Active Contributor
0 Likes
673

I think you can copy the tables directly and abap will take care of it,

data t_standard_t type standard table of mara.

data t_sorted_t type sorted table of mara with unique key matnr.

select * from mara up to 10 rows into corresponding fields of table t_standard_t.

t_sorted_t[] = t_standard_t[].

4 REPLIES 4
Read only

Former Member
0 Likes
673

Hi,

With SORTED APPEND will not work. You will have to use the INSERT command.

If the table strucutres are same

INSERT lines of tab1 to sorted_Tab.

If NOT, then you will have to build the work area for the SORTED tab, and then do a INSERT.

For HASHED, append also should work.

Regards,

Ravi

Note - Please mark the helpful answers

Read only

Former Member
0 Likes
673

Hi Mao,

YOu can try this -

Loop at the standard table into a work area.

Use the <b>insert</b> command to add entries to sorted / hashed tables.

Endloop.

Regards,

Aniket

Read only

former_member186741
Active Contributor
0 Likes
674

I think you can copy the tables directly and abap will take care of it,

data t_standard_t type standard table of mara.

data t_sorted_t type sorted table of mara with unique key matnr.

select * from mara up to 10 rows into corresponding fields of table t_standard_t.

t_sorted_t[] = t_standard_t[].

Read only

Former Member
0 Likes
673

thanks for all of your replys . <b>problem solved</b>. haha!