Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Copy table to another ABAP 7.4

$
0
0

Hi guys,

 

today I was happy to try one of the new ABAP 7.4 language features. However I am not quite sure this is the best approach.

My goal: I have two internal tables. One with many attributes in the table line structure. One with just a single. Now I want to fill the second table with a specific attribute of all lines of the first table.

 

My approach as example (which is working):

REPORT zcka_test.
START-OF-SELECTION.  DATA:    lt_tcurt TYPE TABLE OF tcurt,    ls_tcurt TYPE tcurt.  SELECT *    FROM tcurt    INTO TABLE lt_tcurt.  lt_record_id = VALUE #( FOR ls_line1 IN lt_tcurt ( ls_line1-KTEXT ) ).

Now I have all short texts in LT_RECORD_ID.

 

Is it the best approach? I thought about using REDUCE to only get the short text KTEXT. How would I go about this?

 

lt_record_id = VALUE #( ( LINES of lt_tcurt ) ).

This just copies the table. How do I REDUCE it to the relevant attribute?

 

cheers Carsten

 

PS: Please remember the above is just an example to give an idea. Please do not get at me about using SQL to only select the correct component! My exact case does not have SELECTs.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



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