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

Moving Incompactible Internal Table without loop...

benu_mariantony2
Product and Topic Expert
Product and Topic Expert
0 Likes
640

Hi All,

I need to move the incompactible internal table using field symbol, (without loop statement)

I've got a internal table

lt_itab TYPE TABLE OF string

The above internal table should be moved to internal table with different field, for instance

TYPES: BEGIN OF ty_tab,
                 Name  TYPE string,
             END OF ty_tab.

DATA lt_maintab  TYPE TABLE OF ty_tab.

I need to to assign lt_tab to lt_maintab without loop statement..

Please advice.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
524

if you could change the types from string to a fixed char width, e.g. char1024 instead of string, than you could assign the tables to each other.

As long as you use string as type, ABAP is talking about deep structures. Only flat structures can directly be assigned. So for me, using ABAP, there's no way around looping.

For somebody used to other languages also, this seems quite strange, but unfortunately is the fact.

2 REPLIES 2
Read only

Former Member
0 Likes
525

if you could change the types from string to a fixed char width, e.g. char1024 instead of string, than you could assign the tables to each other.

As long as you use string as type, ABAP is talking about deep structures. Only flat structures can directly be assigned. So for me, using ABAP, there's no way around looping.

For somebody used to other languages also, this seems quite strange, but unfortunately is the fact.

Read only

Ryan-Crosby
Active Contributor
0 Likes
524

Hi Benu,

Unfortunately based on the definition of the structures you have it is not possible without the use of the LOOP construct. The definition would have to be altered or a LOOP must be used to achieve this.

Regards,

Ryan Crosby