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

Hashed to Standard table conversion

Former Member
0 Likes
1,394

Hi.

I want download the a table via gui_download method. This method only accepts table of type standard.

I have hashed table and i wan to conver to standard one.

This statement does not work : ANY OTHER ?

T_wA IS A HASHED TABLE.

Data: twa_stnd like STANDARD TABLE OF T_wA.

twa_stnd = T_wa.

Please help.

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
954

You could define your standard table in a similar way to your hashed table - so something like:

DATA: lth_test LIKE HASHED TABLE OF t000 WITH UNIQUE KEY mandt,
      lts_test LIKE STANDARD TABLE OF t000 WITH NON-UNIQUE KEY table_line.

lts_test = lth_test

Alternatively, define an intermediate type:

TYPES: wa_stnd_type like line of t_wa. 
DATA twa_stnd like STANDARD TABLE OF wa_stnd_type. 

twa_stnd = T_wa.

matt

5 REPLIES 5
Read only

matt
Active Contributor
0 Likes
955

You could define your standard table in a similar way to your hashed table - so something like:

DATA: lth_test LIKE HASHED TABLE OF t000 WITH UNIQUE KEY mandt,
      lts_test LIKE STANDARD TABLE OF t000 WITH NON-UNIQUE KEY table_line.

lts_test = lth_test

Alternatively, define an intermediate type:

TYPES: wa_stnd_type like line of t_wa. 
DATA twa_stnd like STANDARD TABLE OF wa_stnd_type. 

twa_stnd = T_wa.

matt

Read only

Former Member
0 Likes
954

Hi Matt.

The T_wa is a field symbol for hashed table

so the code below will not working as during compile time the structure is now known.

TYPES: wa_stnd_type like line of t_wa.

DATA twa_stnd like STANDARD TABLE OF wa_stnd_type.

twa_stnd = T_wa.

CHANGED TO WILL ALSO NOT WORK. - Reason: Structure of <T_wa> Not known.

TYPES: wa_stnd_type like line of <t_wa>.

DATA twa_stnd like STANDARD TABLE OF wa_stnd_type.

twa_stnd = <T_wa>.

Read only

matt
Active Contributor
0 Likes
954

Ah, OK - that's important information.

FIELD-SYMBOLS: <lth_data> TYPE HASHED TABLE,
               <lts_data> TYPE STANDARD TABLE,
               <ls_wa>   TYPE ANY.

DATA: lp_data TYPE REF TO DATA.
... " <lth_data> is defined and populated, but only known at run time.
CREATE DATA lp_data LIKE LINE OF <lth_data>.
ASSIGN lp_data->* TO <ls_wa>.

CREATE DATA lp_data LIKE STANDARD TABLE OF <ls_wa>.
ASSIGN lp_data->* TO <lts_data>.

<lts_data> = <lth_data>.

matt

Read only

Former Member
0 Likes
954

Excellent POints rewarded

Read only

Former Member
0 Likes
954

hi

good

you have to define another itab (TYPE STANDARD) and:

itab1 = itab2

(itab1 is the standard one, itab2 the hashed one)

thanks

mrutyun^