‎2008 May 13 12:23 PM
I have the following query
loop at int_tab1 into wa_tab1
read table tab2 with key tab2-field1 = wa_tab1-field2
Now for the record fetched above I want to do the following
move tab2-field2 to tab3-field3.
How can I capture the record from read statement
endloop
‎2008 May 13 12:26 PM
loop at int_tab1 into wa_tab1
read table tab2 with key tab2-field1 = wa_tab1-field2.
if sy-subrc = 0.
tab3-field3 = tab2-field2.
<....>
append tab3.
endif.
endloop
‎2008 May 13 12:28 PM
loop at int_tab1 into wa_tab1.
read table tab2 with key tab2-field1 = wa_tab1-field2
if sy-subrc = 0.
write tab2-field2 to tab3-field3.
*or ... tab3-field3 = tab2-field2.
append tab3.
endif.
endloop.
‎2008 May 13 12:28 PM
hi check this..
loop at int_tab1 into wa_tab1 .
read table tab2 with key field1 = wa_tab1-field2
tab3-field3 = itab2-field1.
append itab3.
endloop
regards,
venkat
‎2008 May 13 12:29 PM
HI,
do this way ..
loop at int_tab1 into wa_tab1
read table tab2 with key tab2-field1 = wa_tab1-field2.
if sy-subrc = 0.
move tab2-field2 to tab3-field3.
append tab3.
clear tab3.
endif.
endloop
‎2008 May 13 12:36 PM
Hi,
If your output requirement is such that you can fill the output table even though tab2-field2 is empty then you can proceed as given below.
loop at int_tab1 into wa_tab1
read table tab2 with key tab2-field1 = wa_tab1-field2
if sy-subrc = 0.
tab3-field3 = tab2-field2.
endif.
append tab3.
clear tab2.
endloop.
if the requirement is such that you need to proceed further only if tab2-field2 is filled then you can proceed as given below
loop at int_tab1 into wa_tab1
read table tab2 with key tab2-field1 = wa_tab1-field2
if sy-subrc = 0.
tab3-field3 = tab2-field2.
append tab3.
clear tab2.
endif.
clear tab2.
endloop.
Reward if useful.
Regards,
Anu.
‎2008 May 13 12:38 PM
Hi,
loop at int_tab1 into wa_tab1
read table tab2 with key tab2-field1 = wa_tab1-field2.
if sy-subrc = 0.
tab3-field3 = tab2-field2.
<....>
append tab3.
endif.
endloop
Reward points