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

Re: ASSIGN COMPONENT from a table to a dynamic table

$
0
0

Hi,

first of all, the answer is yes.

Now for your code-sample. Upto ASSIGN DREF->* TO <GT_DYN_TABLE> everything is fine.

With the next Statement however, you messed it up..

 

Provided you are on NW 7.4 or later, you could just use

 

MOVE_CORRESPONDING TB_DATA[] TO <GT_DYN_TABLE>.

 

BTW. does your TB_DATA really have a headerline? And if so, to what purpose?

Otherwise the brackets [] aren't necessary.

 

On lower Releases, you'll need at least another set of field-symbols, one for each table.

 

Then, you can just

LOOP A TB_DATA ASSIGNING <FS1>.

APPEND INITIAL LINE TO <GT_DYN_TABLE> ASSIGNING <FS2>.

MOVE-CORRESPONDING <FS1> TO <FS2>.

ENDLOOP.

 

Or, in case you really have a Header line use:

LOOP AT TB_DATA INTO TB_DATA.

APPEND INITIAL LINE TO <GT_DYN_TABLE> ASSIGNING <FS2>.

MOVE-CORRESPONDING TB_DATA TO <GT_DYN_TABLE>.

ENDLOOP.

 

That should do the trick.

 

Best regards - Jörg


Viewing all articles
Browse latest Browse all 8944

Trending Articles



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