Application Development and Automation 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 only

function modules

Former Member
0 Likes
458

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

3 REPLIES 3
Read only

h_senden2
Active Contributor
0 Likes
437

I dont think you can use the start-of-selection event in a function module.

regards,

Hans

Please reward all helpful answers !!!!!

Read only

Former Member
0 Likes
437

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

Read only

Former Member
0 Likes
437

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.