Application Development 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: 

please give me answer for this.....

Former Member
0 Kudos

hello i want small information about modulepool programing. pls

give some programs for reference.........

pls give requirement of that program.............

before

3 REPLIES 3

Former Member

Former Member
0 Kudos

Hi,

REPORT ZBHMOD1 .

DATA:OKCODE1 LIKE SY-UCOMM,

OKCODE2 LIKE SY-UCOMM.

DATA:N1(10) TYPE N,N2(10) TYPE N,RES(12) TYPE N.

MODULE USER_COMMAND_1000 INPUT.

CASE OKCODE1.

WHEN 'NEXT'.

RES = N1 + N2.

SET SCREEN 1001.

WHEN 'CLEA'.

CLEAR:N1,N2.

WHEN 'BACK'.

SET SCREEN '0'.

ENDCASE.

ENDMODULE. " USER_COMMAND_1000 INPUT

MODULE STATUS_1000 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'TIT1'.

ENDMODULE. " STATUS_1000 OUTPUT

MODULE USER_COMMAND_1001 INPUT.

CASE OKCODE2.

WHEN 'BACK'.

SET SCREEN 1000.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 INPUT

MODULE STATUS_1001 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'TIT2'.

ENDMODULE. " STATUS_1001 OUTPUT

FLOW LOGIC:

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

PROCESS BEFORE OUTPUT.

MODULE STATUS_1001.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1001.

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

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

2)

REPORT ZBHMOD2.

DATA: OKCODE1 TYPE SY-UCOMM,

OKCODE2 TYPE SY-UCOMM,

ENAME(10) TYPE C,

DNAME(10) TYPE C.

MODULE STATUS_1000 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'TIT1'.

ENDMODULE. " STATUS_1000 OUTPUT

MODULE STATUS_1001 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'TIT2'.

ENDMODULE. " STATUS_1001 OUTPUT

MODULE USER_COMMAND_1000 INPUT.

CASE OKCODE1.

WHEN 'BACK'.

SET SCREEN '0'.

WHEN 'NEXT'.

DNAME = ENAME.

SET SCREEN '1001'.

ENDCASE.

ENDMODULE. " USER_COMMAND_1000 INPUT

MODULE USER_COMMAND_1001 INPUT.

CASE OKCODE2.

WHEN 'BACK'.

SET SCREEN '1000'.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 INPUT

FORM ON_CTMENU_FORM USING ZDEMO1 TYPE REF TO CL_CTMENU.

CALL METHOD ZDEMO1->LOAD_GUI_STATUS

EXPORTING

PROGRAM = 'ZDEMO1'

STATUS = 'ZDEMO1'

MENU = ZDEMO1.

ENDFORM. " ON_CTMENU_FORM

FLOW LOGIC:

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

PROCESS BEFORE OUTPUT.

MODULE STATUS_1001.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1001.

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

Every Screen has a pbo and a pai.

Screen elements are the textbox, buttons, radio buttons and check boxes .....

If we want to pass data from a abap program to a screen element, we have to create a variable with the name we have given in the screen.So whatever the value is present in that variable is reflected on to the screen element.

Here is an example :

Using subscreens and some of the screen elements

REPORT demo_dynpro_subscreens.

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA: number1(4) TYPE n VALUE '0110',

number2(4) TYPE n VALUE '0130',

field(10) TYPE c, field1(10) TYPE c, field2(10) TYPE c.

CALL SCREEN 100.

MODULE status_100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE fill_0110 OUTPUT.

field = 'Eingabe 1'(001).

ENDMODULE.

MODULE fill_0120 OUTPUT.

field = field1.

ENDMODULE.

MODULE fill_0130 OUTPUT.

field = 'Eingabe 2'(002).

ENDMODULE.

MODULE fill_0140 OUTPUT.

field = field2.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE save_ok INPUT.

save_ok = ok_code.

CLEAR ok_code.

ENDMODULE.

MODULE user_command_0110 INPUT.

IF save_ok = 'OK1'.

number1 = '0120'.

field1 = field.

CLEAR field.

ENDIF.

ENDMODULE.

MODULE user_command_0130 INPUT.

IF save_ok = 'OK2'.

number2 = '0140'.

field2 = field.

CLEAR field.

ENDIF.

ENDMODULE.

MODULE user_command_100 INPUT.

CASE save_ok.

WHEN 'SUB1'.

number1 = '0110'.

WHEN 'SUB2'.

number1 = '0120'.

CLEAR field1.

WHEN 'SUB3'.

number2 = '0130'.

WHEN 'SUB4'.

number2 = '0140'.

CLEAR field2.

ENDCASE.

ENDMODULE.

  • flow logic for screen 100

PROCESS BEFORE OUTPUT.

MODULE STATUS_100.

CALL SUBSCREEN: AREA1 INCLUDING SY-REPID NUMBER1,

AREA2 INCLUDING SY-REPID NUMBER2.

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

MODULE SAVE_OK.

CALL SUBSCREEN: AREA1,

AREA2.

MODULE USER_COMMAND_100.

  • flow logic for screen 110

PROCESS BEFORE OUTPUT.

MODULE FILL_0110.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0110.

  • flow logic for screen 120

PROCESS BEFORE OUTPUT.

MODULE FILL_0120.

PROCESS AFTER INPUT.

  • flow logic for screen 130

PROCESS BEFORE OUTPUT.

MODULE FILL_0130.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0130.

  • flow logic for screen 140

PROCESS BEFORE OUTPUT.

MODULE FILL_0140.

PROCESS AFTER INPUT.

Regards,

Priyanka.