‎2007 May 29 8:46 AM
HI ,
how can i write thgis code in function modules.
if i write it in function modules it is showing errors.
tables : zsvj.
data : begin of itab occurs 0,
enum like zsvj-enum,
ename like zsvj-ename,
end of itab.
start-of-selection.
itab-enum = 1.
itab-ename = 'sss'.
append itab.
itab-enum = 2.
itab-ename = 'www'.
append itab.
itab-enum = 3.
itab-ename = 'ttt'.
append itab.
itab-enum = 4.
itab-ename = '999'.
append itab.
data : h type i value 0.
loop at itab.
select * from zsvj where ename = itab-ename .
h = h + 1.
write:/ itab-enum, itab-ename,h.
endselect.
Regards
saisri
‎2007 May 29 8:48 AM
I dont think you can use the start-of-selection event in a function module.
regards,
Hans
Please reward all helpful answers !!!!!
‎2007 May 29 9:02 AM
Hi,
You dont have to use start-of-selection event in function modules.
Also if u wish u can make Internal Table in the calling program and pass it to the function module as a table parameter. It's not compulsury.
And as an additional suggestion,Don't use Select inside LOOP...Endloop.
Regards,
Harsha
‎2007 May 29 9:09 AM
hi,
data : begin of itab occurs 0,
enum like zsvj-enum,
ename like zsvj-ename,
end of itab.
itab-enum = 1.
itab-ename = 'sss'.
append itab.
itab-enum = 2.
itab-ename = 'www'.
append itab.
itab-enum = 3.
itab-ename = 'ttt'.
append itab.
itab-enum = 4.
itab-ename = '999'.
append itab.
data : h type i value 0.
start-of-selection.
loop at itab.
select * from zsvj where ename = itab-ename .
h = h + 1.
write:/ itab-enum, itab-ename,h.
endselect.
if helpful reward some points.
Regards
suresh babu aluri.