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

modulepool programme

Former Member
0 Likes
311

Hello,

kindly send the sample programme of modulepool that includes delete, exit, update, save buttons.

hope u will do the needful at your earliest.

thanks,

sujatha

1 REPLY 1
Read only

Former Member
0 Likes
290

Hi,

here is the sample code for updating a transparent table

tables: z11_ap_ekko.

data: ok_code_1(4).

data: reply.

data: d_ebeln type z11_ebeln.

data: ok_code_2(4).

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


module status_0100 output.

set pf-status 'MAIN'.

set titlebar 'ENTRY PROGRAM FOR PO_HEADER INFO'.

endmodule. " STATUS_0100 OUTPUT

&----


*& Module exit_prog INPUT

&----


  • text

----


module exit_prog input.

call function 'POPUP_TO_CONFIRM'

exporting

titlebar = 'command to do?? '

  • DIAGNOSE_OBJECT = ' '

text_question = 'exit???? '

text_button_1 = 'yes'(001)

  • ICON_BUTTON_1 = ' '

text_button_2 = 'No'(002)

  • ICON_BUTTON_2 = ' '

  • DEFAULT_BUTTON = '1'

  • DISPLAY_CANCEL_BUTTON = 'X'

  • USERDEFINED_F1_HELP = ' '

  • START_COLUMN = 25

  • START_ROW = 6

  • POPUP_TYPE =

  • IV_QUICKINFO_BUTTON_1 = ' '

  • IV_QUICKINFO_BUTTON_2 = ' '

importing

answer = reply

  • TABLES

  • PARAMETER =

  • EXCEPTIONS

  • TEXT_NOT_FOUND = 1

  • OTHERS = 2

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

if reply = 1.

leave program.

endif.

endmodule. " exit_prog INPUT

&----


*& Module validate_matnr INPUT

&----


  • text

----


module validate_matnr input.

case ok_code_1.

when 'MDF'.

select single z11_ebeln into d_ebeln from z11_ap_ekko where z11_ebelN = Z11_AP_EKKO-Z11_EBELN.

if sy-subrc <> 0.

clear z11_ap_ekko.

message 'PO DOES NOT EXISTS' type 'E' .

endif.

when 'DIS'.

select single z11_ebeln into d_ebeln from z11_ap_ekko where z11_ebelN = Z11_AP_EKKO-Z11_EBELN.

if sy-subrc <> 0.

clear z11_ap_ekko.

message 'PO DOES NOT EXISTS' type 'E' .

endif.

when 'CRT'.

select single z11_ebeln into d_ebeln from z11_ap_ekko where z11_ebelN = Z11_AP_EKKO-Z11_EBELN.

if sy-subrc = 0.

clear z11_ap_ekko.

message 'PO ALREADY EXISTS' type 'E' .

endif.

endif.

endcase.

endmodule. " validate_matnr INPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module user_command_0100 input.

case ok_code_1.

when 'MDF'.

leave to screen 101.

when 'DIS'.

leave to screen 101.

when 'CRT'.

leave to screen 101.

endcase.

endmodule. " USER_COMMAND_0100 INPUT

&----


*& Module STATUS_0101 OUTPUT

&----


  • text

----


module status_0101 output.

set pf-status 'MAIN'.

  • SET TITLEBAR 'xxx'.

endmodule. " STATUS_0101 OUTPUT

&----


*& Module data_retrive OUTPUT

&----


  • text

----


module data_retrive output.

if ok_code_1 = 'DISP' or ok_code_1 = 'MDF'.

select single * from z11_ap_ekko where z11_ebeln = z11_ap_ekko-Z11_EBELN.

endif.

endmodule. " data_retrive OUTPUT

&----


*& Module USER_COMMAND_0101 INPUT

&----


  • text

----


module user_command_0101 input.

case ok_code_2.

when 'BCK'.

clear z11_ap_ekko.

clear ok_code_2.

leave to screen 100.

when 'MDD'.

modify z11_ap_ekko.

clear z11_ap_ekko.

clear ok_code_2.

message 'MODIFIED' type 'I'.

leave to screen 100.

when 'SAV'.

insert z11_ap_ekko.

clear z11_ap_ekko.

clear ok_code_2.

message 'SAVED' type 'I'.

leave to screen 100.

when 'EXT'.

call function 'POPUP_TO_CONFIRM'

exporting

titlebar = 'command to do?? '

  • DIAGNOSE_OBJECT = ' '

text_question = 'exit???? '

text_button_1 = 'yes'(001)

  • ICON_BUTTON_1 = ' '

text_button_2 = 'No'(002)

  • ICON_BUTTON_2 = ' '

  • DEFAULT_BUTTON = '1'

  • DISPLAY_CANCEL_BUTTON = 'X'

  • USERDEFINED_F1_HELP = ' '

  • START_COLUMN = 25

  • START_ROW = 6

  • POPUP_TYPE =

  • IV_QUICKINFO_BUTTON_1 = ' '

  • IV_QUICKINFO_BUTTON_2 = ' '

importing

answer = reply

  • TABLES

  • PARAMETER =

  • EXCEPTIONS

  • TEXT_NOT_FOUND = 1

  • OTHERS = 2

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

if reply = 1.

leave to screen 101.

endif.

endcase.

endmodule. " USER_COMMAND_0101 INPUT

&----


*& Module data_screen OUTPUT

&----


  • text

----


module data_screen output.

if ok_code_1 = 'DIS'.

select single * from z11_ap_ekko where z11_ebeln = z11_ap_ekko-z11_EBELN.

loop at screen.

if screen-group1 = 'G1'.

screen-active = 1.

screen-input = 0.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

if screen-group1 = 'G2'.

screen-active = 1.

screen-input = 0.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

if screen-group1 = 'G3'.

screen-active = 0.

screen-input = 0.

screen-output = 0.

screen-invisible = 1.

modify screen.

endif.

if screen-group1 = 'G4'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

if screen-group1 = 'G5'.

screen-active = 0.

screen-input = 0.

screen-output = 0.

screen-invisible = 1.

modify screen.

endif.

endloop.

endif.

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

if ok_code_1 = 'CRT'.

loop at screen.

if screen-group1 = 'G1'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

if screen-group1 = 'G2'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

if screen-group1 = 'G3'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

if screen-group1 = 'G4'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

if screen-group1 = 'G5'.

screen-active = 0.

screen-input = 0.

screen-output = 0.

screen-invisible = 1.

modify screen.

endif.

endloop.

endif.

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

if ok_code_1 = 'MDF'.

select single * from z11_ap_ekko where z11_ebeln = z11_ap_ekko-z11_EBELN.

loop at screen.

if screen-group1 = 'G1'.

screen-active = 1.

screen-input = 0.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

if screen-group1 = 'G2'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

if screen-group1 = 'G3'.

screen-active = 0.

screen-input = 0.

screen-output = 0.

screen-invisible = 1.

modify screen.

endif.

if screen-group1 = 'G4'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

if screen-group1 = 'G5'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

modify screen.

endif.

endloop.

endif.

endmodule. " data_screen OUTPUT

it will give you a basic idea about the program rest you have to make changes on the screen accordingly

rewards points if helpful