Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10473

Re: Copying Dynamic Internal Table

$
0
0

First you need to create another table with the structure that you have.

 

call method cl_alv_table_create=>create_dynamic_table

     exporting

       it_fieldcatalog = LT_FIELDCATALOG

     importing

       ep_table = <FS_DATA2>

     exceptions

       generate_subpool_dir_full = 1

       others = 2

 

field-symbols  : <fs_line1>, <fs_line2>, <fs_tmp1>, <fs_tmp2>.

 

assign <FS_DATA2->* to <FS_2>.

 

Now FS_1 and FS_2 are the tables.

 

Also create work areas for the tables.

CREATEDATA gw_line1 LIKELINEOF<fs_1>
CREATEDATA gw_line2 LIKELINEOF<fs_2>.
ASSIGN gw_line1->* TO<fs_line1>.

assign gw_line2->* to <fs_line2>.


With field symbols, you cannot move the rows directly, you will have to move it field by field.

 

 

 

Once all the values are populated in the first table, copy it with the following logic.

 

 

 

loop at <fs_1> into <fs_line1>

Loop at   LT_FIELDCATALOG into LS_FIELDCATALOG.

ASSIGNCOMPONENT ls_fieldcatalog-fieldname OFSTRUCTURE<fs_line1> TO<fs_tmp1>.

ASSIGNCOMPONENT ls_fieldcatalog-fieldname OFSTRUCTURE<fs_line2> TO<fs_tmp2>.

<fs_tmp2> = <fs_tmp1>

endloop.

append <fs_line2> to <fs_2>

endloop.


 

 

 

 

 



Viewing all articles
Browse latest Browse all 10473

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>