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: 

Read statement

former_member349098
Participant
0 Kudos

hi

my requirement is to read the data from it1 to it2 . for multiple equipment numbers that we had given in the select-options

i have used read statement ..but prob is it reading only for one equipment no...

when cursor is in loop statement the data of second record coming in [wa_final1 ] but when it going for read again the first record coming again it transferring first record data only

LOOP AT it_final1 into wa_final1.

READ TABLE it_final1 into wa_final1 WITH KEY idate = date-low.

if sy-subrc = 0.

wa_output-point1 = wa_final1-point1.

wa_output-pttxt = wa_final1-pttxt.

wa_output-date1 = wa_final1-idate.

wa_output-cntr1 = wa_final1-power1.

endif.

READ TABLE it_final1 into wa_final1 WITH KEY idate = date-high.

if sy-subrc = 0.

wa_output-cntr2 = wa_final1-power2.

wa_output-date2 = wa_final1-idate.

endif.

append wa_output to it_output.

clear wa_output.

write sy-tabix.

endloop.

Thanks a lot ...

2 REPLIES 2

Sandra_Rossi
Active Contributor
0 Kudos

Hi,

To use correctly select-options, you must use the IN keyword, that is not available in READ TABLE, but it's there in LOOP AT.


LOOP AT it_final1 into wa_final1
      WHERE idate IN date.

Sandra

0 Kudos

hi sandra ..

my problem is i have to make two recods into one record ..

in it1 2 is there but in it2 i want 1 that 4 fields from 1 record and two fields from 1 record ..

here for first record it is coming writly

but it is not taking second record

i want to know where is the prob in my code that i had posed above

thanks a lot