‎2007 Feb 02 12:42 PM
dear friends,
I have an internal table like below,
F1-F2-F3.(itab1)
2 ---7
3 -
9
based on the above internal table i am using the query to get the F3 field
for all entries in itab1 where F1= itab1-f1.
after getting the F3 value i need to update F3 field in the internal table itab1.
pls give provide me the code for the above
thanks in advance
karthik
‎2007 Feb 02 1:02 PM
Hi karthik,
the logic has been given by you.
if F1 is a unique field on the database as in your itab, it could be
data:
ls_itab like line of itab.
field-symbols:
<itab> like line of itab.
sort itab by f1.
select f1 f3 into corresponding fields of ls_itab
from <database_table>
for all entries in itab1 where F1= itab1-f1.
read table itab assigning <itab>
with key f1 = ls_itab-f1
BINARY SEARCH.
check sy-subrc = 0.
<itab>-f3 = ls_itab-f3.
endselect.
Regards,
Clemens
‎2007 Feb 02 12:45 PM
loop at itab1 into wa_itab1.
read table itab2 with key f1 = wa_itab-f1.
if sy-subrc eq 0.
wa_itab1-F3 = itab2-F3.
modify itab1 from wa_itab1.
endif.
endloop.
‎2007 Feb 02 12:47 PM
‎2007 Feb 02 1:02 PM
Hi karthik,
the logic has been given by you.
if F1 is a unique field on the database as in your itab, it could be
data:
ls_itab like line of itab.
field-symbols:
<itab> like line of itab.
sort itab by f1.
select f1 f3 into corresponding fields of ls_itab
from <database_table>
for all entries in itab1 where F1= itab1-f1.
read table itab assigning <itab>
with key f1 = ls_itab-f1
BINARY SEARCH.
check sy-subrc = 0.
<itab>-f3 = ls_itab-f3.
endselect.
Regards,
Clemens