Skip to Content
0
Former Member
Mar 02, 2006 at 06:20 PM

function module

18 Views

Hi friends,

I Have wriiten a dialog program to enter a employee deatils, i had used my own tales for that.

Now i need to create a function module, like grupoing all the PAI events into this function module, and then to call it form the dialog programing.

Could you please helpme to walk through this.

Please suggest me some ideas , so that i can follow it up and meet the needs.

this is my program:

&----


*

*& Module pool Z_PK_DIALOG1 *

*& *

&----


*& *

*& *

&----


program z_pk_dialog1 message-id zp01.

tables: zzemp,zzdept,mara.

data : pempno like zzemp-empno,

pfirstname like zzemp-firstname,

pdeptno like zzdept-deptno.

data : userentered like sy-ucomm.

******************************

module displaymenu output.

set pf-status 'ZPKMENU'.

set titlebar '001'.

endmodule. " STATUS_0010 OUTPUT

***************************

module inserttable .

case userentered.

when 'SAVE' or 'STORE'.

if pempno = 0 .

message i001 with pempno.

else.

zzemp-empno = pempno.

zzemp-firstname = pfirstname.

zzemp-deptno = pdeptno.

insert zzemp.

endif.

when 'MOD'.

zzemp-empno = pempno.

zzemp-firstname = pfirstname.

zzemp-deptno = pdeptno.

update zzemp.

when 'DELETE'.

zzemp-empno = pempno.

zzemp-firstname = pfirstname.

zzemp-deptno = pdeptno.

delete zzemp.

when 'REFRESH'.

clear zzemp.

clear : pempno, pfirstname, pdeptno.

when 'LIST'.

select single empno deptno firstname from zzemp into (pempno, pdeptno,

pfirstname) where empno = pempno.

zzemp-empno = pempno.

zzemp-firstname = pfirstname.

zzemp-deptno = pdeptno.

when 'BACK'.

set screen 0.

leave screen.

when 'EXIT' or 'CANCEL'.

leave program.

endcase.

endmodule. " USER_COMMAND_0010 INPUT

Thanks in advance

Regards

Tina