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

Re: Select data from 2 internal tables into one

$
0
0

Hi Denis,

 

Charlie Alquino's solution  may work though it will be slow.

 

If you have 1 record per MBLNR, then this is a unique key. All 3 tables should thus be defined as TYPE SORTED TABLE WITH UNIQUE KEY mblnr.

 

I did not understand if table 3 is alrteady filled with mblnr an some attributes or if this shall be the result of the process.

 

For all table accesses use field-symbols. It is faster, i.e.

 

LOOP AT 3rd_internal_table ASSIGNING <3rd_internal>.

  LOOP AT 1st_internal_table ASSIGNING <1st_internal>

* Loop will use the table key - very fast - one record found or none!

    WHERE mblnr = <3rd_internal>-mblnr.

      <1st_internal>-field1 = <3rd_internal>-field1. 

      <1st_internal>-field2 = <3rd_internal>-field2. 

*...(COPY the values needed from the 1st table to 3rd table).

  ENDLOOP.

*...

ENDLOOP.

 

If you are on ABAP 740 you can use in-line-declaration of field-symbols, i.e.

 

LOOP AT 3rd_internal_table ASSIGNING FIELD-SYMBOL(<3rd_internal>).

 

Regards

 

Clemens


Viewing all articles
Browse latest Browse all 8689

Trending Articles



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