Application Development 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: 

Select

Former Member
0 Kudos

I have an internal table ITAB with work area WA_ITAB with (n-2) fields filled in

I need to fill two more fields from anotehr database table depending on condition databse table-fieldname = WA_ITAB

Hoe to do this

3 REPLIES 3

valter_oliveira
Active Contributor
0 Kudos

Hello.

Considering that the key of that database table is field1 of your internal table, do like this:


LOOP AT itab INTO wa.
  SELECT SINGLE fieldn-1 fieldn
    FROM database_table
    INTO (wa-fieldn-1, wa-fieldn)
   WHERE field1 = wa-field1.
  CHECK sy-subrc EQ 0.
  MODIFY itab FROM wa TRANSPORTING fieldn-1 fieldn.
ENDLOOP.

Best regards.

Valter Oliveira.

Former Member
0 Kudos

Hi,

Use transporting option.

then u can insert data into new fields.

0 Kudos

Use "for all entries"

select query in loop is not at all advisable..

It will reduce ur performance to a level in production..

Regards..

Manish.