‎2008 Apr 18 7:17 PM
Hi
I want to update work area (wa)
fields (p1, p2)
with f1,f2 from table t1
where wa.id = t1.id
looping through the wa.
Whats the syntax?
Thanks in advance.
‎2008 Apr 18 8:09 PM
I want to update work area (wa)
fields (p1, p2)
with f1,f2 from table t1
where wa.id = t1.id
looping through the wa.
Whats the syntax?
You cannot loop through the work area. Work area is a structure.
well, in your case, you can either loop through the internal table t1 or you can read the internal table t1.
syntax
1)
read table t1 into w1 with key id = wa-id.
if sy-subrc = 0.
wa-p1 = w1-f1.
wa-p2 = w1-f2.
endif.
or you can loop through the internal table
loop at t1 where id = wa-id.
wa-p1 = t1-f1.
wa-p2 = t1-f2.
endloop.
‎2008 Apr 18 8:09 PM
I want to update work area (wa)
fields (p1, p2)
with f1,f2 from table t1
where wa.id = t1.id
looping through the wa.
Whats the syntax?
You cannot loop through the work area. Work area is a structure.
well, in your case, you can either loop through the internal table t1 or you can read the internal table t1.
syntax
1)
read table t1 into w1 with key id = wa-id.
if sy-subrc = 0.
wa-p1 = w1-f1.
wa-p2 = w1-f2.
endif.
or you can loop through the internal table
loop at t1 where id = wa-id.
wa-p1 = t1-f1.
wa-p2 = t1-f2.
endloop.
‎2008 Apr 18 8:40 PM
Hi,
if u want to update work area
u can simply pass the data like this.
wa is work area with two fields p1 and p2
l1 is the table with header line with two field f1 and f2.
read table l1 with key id = wa-id.
wa-p1 = l1-f1.
wa-p2 = l1-f2.here loop is not used because u r filling data into work area.
so work area can contain only one record at a given point of time
reward if helpful
raam