Application Development and Automation 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: 
Read only

Select

Former Member
0 Likes
450

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
Read only

valter_oliveira
Active Contributor
0 Likes
431

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.

Read only

Former Member
0 Likes
431

Hi,

Use transporting option.

then u can insert data into new fields.

Read only

0 Likes
431

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.