Skip to Content
0
Former Member
Oct 23, 2007 at 06:18 AM

Function module (SE37)

946 Views

Hi all.

I have created a Function module <b>(Tcode SE37)</b>. Its not giving any syntax error, my problem is its not displaying output.

Please look at this code and help me to correct this.

Main program.

parameters : plant type zmonthpay-dcode.

data: begin of itab2 occurs 0,

name(20),

age(2),

work(5),

end of itab2.

CALL FUNCTION 'ZP_FM1'

EXPORTING

plant = plant

tables

itab1 = itab2

.

write: itab2-name, itab2-age, itab2-work.

Function module code:-

<b>Import parameter: plant.

Tables: itab1</b>

FUNCTION ZP_FM1.

data: begin of itab occurs 0,

name(20),

age(2),

work(5),

end of itab.

if plant = 'AD00'.

itab-name = 'prajwe'.

itab-age = '24'.

itab-work = 'abap'.

append itab.

endif.

if plant = 'IC00'.

itab-name = 'prajwe12'.

itab-age = '25'.

itab-work = 'abap1'.

append itab.

else.

itab-name = 'prajwe13'.

itab-age = '26'.

itab-work = 'abap2'.

append itab.

endif.

move itab[] to itab1[].

append itab1.

ENDFUNCTION.

Please help me.

Regards.

Prajwal.k