Sunteți pe pagina 1din 16

10/31/2018 TECHSAP : MODULE POOL

More Create Blog Sign In

TECHSAP
Hello Visitors,The blog contents are now available in my new site: https://sapcodes.com/ .

Wednesday, 30 May 2012

MODULE POOL
SIMPLE PROGRAM ON MODULE POOL
Scenario : Here we would design a single screen(9000) with two i/p fields & one o/p field.
Upon entering the values in the i/p field, if the user clicks on the add button then the sum
will be displayed in the o/p field.
Step-1. Go to SE80. Choose Program And Give a Name ( zmp_test1 ) and press Enter.

Pages - Menu

Home
ABAP
ABAP-2
Web-Dynpro
FPM
WorkFlow
BASIS
Interview Ques
ABAP Short Ques

Step-2. Choose Yes .  Blog Archive

► 2017 (27)
► 2016 (57)

► 2015 (160)

► 2014 (175)

► 2013 (46)

▼ 2012 (14)
► June (1)

▼ May (7)
MODULE POOL
EXCEPTION HANDLING
OOABAP PROGRAMS

Step -3. Un check the check box and Click Yes button. FIELD SYMBOLS
ALV REPORTS
INTERACTIVE REPORTS
CLASSICAL REPORT PROGRAMS

► April (6)

Total Pageviews

1 2 9 3 2 0 3

Popular Posts

OO ALV WITH
CONTAINERS
1. OO ALV USING
Step-4. Select Module Pool From the Type and Click on Save button. DOCKING CONTAINER d...

MODULE POOL
SIMPLE PROGRAM ON
MODULE POOL Scenario :
...

Creation of Table Control in Module Pool


Program
Description: Table Control generally used to
display Multiple records in a single screen.

http://freesapabap.blogspot.com/2012/05/module-pool.html 1/16
10/31/2018 TECHSAP : MODULE POOL
Step 1. Create a Module
Pool Program , declare ...

Modal Dialog Box (Pop Up


Screen) In Module pool
program
Description : Modal Dialog
Box is a Pop up window
which is displayed on the
top of the screen. When calling this type of
screen we have to...

CLASSICAL REPORT PROGRAMS


*****VERY SIMPLE REPORT PROGRAM
TO DISPLAY RECORDS FROM SPFLI
TABLE**** * REPORT
ZCLASSICAL_REPORT_01 NO
STANDARD PAGE HEADING LINE-...

Chain - EndChain In Module


Pool Program
--------------------------------------
Step-5. Click on Local Object To save it local package ($TMP). --------------------------------------
--------------------------------------
----------------- Descri...

INTERACTIVE REPORTS
*****Simple Interactive Report *******
REPORT ZREP_0012 NO STANDARD
PAGE HEADING line-count 30(2). data :
it_spfli type table o...

10. Smartform :Designing a


template in Smartform
--------------------------------------
--------------------------------------
--------------------------------------
------------- Step1. ...

Creating Lock Object and


Using Lock in Program
Step 1. Go to TCODE-
SE11, Provide the lock
object name and Click on
Create Button. Step 2.
  Provide the Short text and cli...

ABAP System Variables


1. SY-CPAGE - Holds Current Page
Number 2. SY-CPROG - Contains Program
Name 3. SY-CUCOL - Cursor Position (
Column) 4. SY-CUROW - C...

Step-6. Double Click on Program Name & Click on Change Button.

Step-7. Create A screen - right click on Program Name ->Create->Screen

http://freesapabap.blogspot.com/2012/05/module-pool.html 2/16
10/31/2018 TECHSAP : MODULE POOL

                        

 Step-8.  Give Screen number - 9000 & click on Yes Button.

Step-9. Give a short Description &  It's a normal Screen.

 
 

Step-10. Click on layout Button & the Screen Painter Window will appear .

http://freesapabap.blogspot.com/2012/05/module-pool.html 3/16
10/31/2018 TECHSAP : MODULE POOL

Step-11. Create two input fields , one push button & an output field & at last click on flow
logic button on the toolbar.

Step-12.  Now uncomment the two modules in PBO & PAI . Double click on the module
name and create it in main program.

Step-13. Write the code in the program.


PROGRAM zmp_test1.

DATA : num1 TYPE i,


num2 TYPE i,
res TYPE i.

MODULE status_9000 OUTPUT.


SET PF-STATUS 'STATUS'.
* SET TITLEBAR 'xxx'.

http://freesapabap.blogspot.com/2012/05/module-pool.html 4/16
10/31/2018 TECHSAP : MODULE POOL
ENDMODULE. " STATUS_9000 OUTPUT

MODULE user_command_9000 INPUT.


CASE sy-ucomm.
WHEN 'SHOW'.
res = num1 + num2.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
 

Step-14. Uncomment the SET PF-STATUS 'XXXX'  line  and give any name(STATUS) &
double click  on it to create it. From the popup click on yes .

Step-15. Give A short text and Click on yes button.

Step-16. Click on the (+)


Button on the right of
Function keys to expand it. Give SAVE, BACK,   EXIT & CANCEL in the standard toolbar &
activate it and press back button to come back to the program.

Step-17. Now create a transaction code for the program. Right click on program name-
>create->transaction.

http://freesapabap.blogspot.com/2012/05/module-pool.html 5/16
10/31/2018 TECHSAP : MODULE POOL

 
 

Step-18. Give a T-code, short description and click yes button.

Step-19. Give program name , screen number and click on the three check boxes and then
click on save button on the standard toolbar. Click on back button to come the program.

Step-20. Now  open a new session and put the T-code of the program in the Command
field and press Enter.

http://freesapabap.blogspot.com/2012/05/module-pool.html 6/16
10/31/2018 TECHSAP : MODULE POOL
 

Step-21. Fill the two input field with some values and then press ADD button. Find the
Result.

PROGRAM DEMONSTRATING (ON INPUT)


data : N1 type i.
data : N2 type i.
data : ok_code type sy-ucomm.

module STATUS_9000 output.


* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.

endmodule. " STATUS_9000 OUTPUT

module USER_COMMAND_9000 input.


CASE OK_CODE.
WHEN 'SHOW'.
CALL SCREEN 9001.
ENDCASE.
endmodule. " USER_COMMAND_9000 INPUT

module STATUS_9001 output.


* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
N2 = N1.
endmodule. " STATUS_9001 OUTPUT

module USER_COMMAND_9001 input.


CASE OK_CODE.
WHEN 'BACK'.
CALL SCREEN 9000.
ENDCASE.
endmodule. " USER_COMMAND_9001 INPUT

module CHECK_N1 input.


N1 = N1 + 10.
endmodule. " CHECK_M1 INPUT

FLOW LOGIC OF SCREEN 9000


PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.

PROCESS AFTER INPUT.


FIELD N1 MODULE CHECK_N1 ON INPUT.
MODULE USER_COMMAND_9000.

http://freesapabap.blogspot.com/2012/05/module-pool.html 7/16
10/31/2018 TECHSAP : MODULE POOL

FLOW LOGIC OF SCREEN 9001

PROCESS BEFORE OUTPUT.


MODULE STATUS_9001.

PROCESS AFTER INPUT.


MODULE USER_COMMAND_9001.

 Run the program and if you give any value to the input field (n1) then only    CHECK_N1 
module will execute . press SHOW & BACK button many times to see the change. If it finds
any value in the input field (n1) then every time  CHECK_N1 module will execute and it
will add up 10 to its value.
PROGRAM DEMONSTRATING (ON REQUEST)
data : N1 type i.
data : N2 type i.
data : ok_code type sy-ucomm.

module STATUS_9000 output.


* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.

endmodule. " STATUS_9000 OUTPUT

module USER_COMMAND_9000 input.


CASE OK_CODE.
WHEN 'SHOW'.
CALL SCREEN 9001.
ENDCASE.
endmodule. " USER_COMMAND_9000 INPUT

module STATUS_9001 output.


* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
N2 = N1.

http://freesapabap.blogspot.com/2012/05/module-pool.html 8/16
10/31/2018 TECHSAP : MODULE POOL
endmodule. " STATUS_9001 OUTPUT

module USER_COMMAND_9001 input.


CASE OK_CODE.
WHEN 'BACK'.
CALL SCREEN 9000.
ENDCASE.
endmodule. " USER_COMMAND_9001 INPUT

module CHECK_N1 input.


N1 = N1 + 20.
endmodule. " CKECK_N1 INPUT

FLOW LOGIC OF SCREEN 9000


PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.
*
PROCESS AFTER INPUT.
field N1 MODULE CHECK_N1 on REQUEST.

MODULE USER_COMMAND_9000.
FLOW LOGIC OF SCREEN 9001
PROCESS BEFORE OUTPUT.
MODULE STATUS_9001.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9001.
  Run the program and if you give any value to the input field (n1) then only    CHECK_N1 
module will execute . press SHOW & BACK button many times to see the change.
PROGRAM DEMONSTRATING (ON CHAIN-INPUT)
DATA : N1 TYPE i.
DATA : N2 TYPE i.
DATA : N3 TYPE i.
DATA : res TYPE i.
DATA : ok_code TYPE sy-ucomm.

MODULE status_9000 OUTPUT.


* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_9000 OUTPUT

MODULE user_command_9000 INPUT.


CASE ok_code.
WHEN 'ADD'.
CALL SCREEN 9001.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT

MODULE status_9001 OUTPUT.


* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
res = N1 + N2 + N3.
ENDMODULE. " STATUS_9001 OUTPUT

MODULE user_command_9001 INPUT.


CASE ok_code.
WHEN 'BACK'.
CALL SCREEN 9000.
ENDCASE.
ENDMODULE. " USER_COMMAND_9001 INPUT

module CHECK_TWO_NUMBER input.


N1 = N1 + 10.
N2 = N2 + 10.

endmodule. " CKECK_THREE_NUMBER INPUT

FLOW LOGIC OF SCREEN 9000

PROCESS BEFORE OUTPUT.


MODULE status_9000.
PROCESS AFTER INPUT.
CHAIN.
FIELD : N1,N2.
MODULE CHECK_TWO_NUMBER ON CHAIN-INPUT.

http://freesapabap.blogspot.com/2012/05/module-pool.html 9/16
10/31/2018 TECHSAP : MODULE POOL
ENDCHAIN.
MODULE user_command_9000.

FLOW LOGIC OF SCREEN 9001


PROCESS BEFORE OUTPUT.
MODULE STATUS_9001.

PROCESS AFTER INPUT.


MODULE USER_COMMAND_9001.

  Run the program and if you provide any value to either n1 or n2  or both  then only 
CHECK_TWO_NUMBER  module will execute . press ADD & BACK button many times to see
the change.
PROGRAM DEMONSTRATING (ON CHAIN-REQUEST)
DATA : N1 TYPE i.
DATA : N2 TYPE i.
DATA : N3 TYPE i.
DATA : res TYPE i.
DATA : ok_code TYPE sy-ucomm.

http://freesapabap.blogspot.com/2012/05/module-pool.html 10/16
10/31/2018 TECHSAP : MODULE POOL

MODULE status_9000 OUTPUT.


* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_9000 OUTPUT

MODULE user_command_9000 INPUT.


CASE ok_code.
WHEN 'ADD'.
CALL SCREEN 9001.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT

MODULE status_9001 OUTPUT.


* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
res = N1 + N2 + N3.
ENDMODULE. " STATUS_9001 OUTPUT

MODULE user_command_9001 INPUT.


CASE ok_code.
WHEN 'BACK'.
CALL SCREEN 9000.
ENDCASE.
ENDMODULE. " USER_COMMAND_9001 INPUT

module CHECK_TWO_NUMBER input.


N1 = N1 + 10.
N2 = N2 + 10.
endmodule. " CKECK_TWO_NUMBER INPUT
FLOW LOGIC OF SCREEN 9000
PROCESS BEFORE OUTPUT.
MODULE status_9000.

PROCESS AFTER INPUT.


CHAIN.
FIELD : N1,N2.
MODULE CHECK_TWO_NUMBER ON CHAIN-REQUEST.
ENDCHAIN.
MODULE user_command_9000.
FLOW LOGIC OF SCREEN 9001
PROCESS BEFORE OUTPUT.
MODULE STATUS_9001.

PROCESS AFTER INPUT.


MODULE USER_COMMAND_9001.
  Run the program and if you provide any value to either n1 or n2  or both  then only 
CHECK_TWO_NUMBER  module will execute . press ADD & BACK button many times to see
the change.
PROGRAM DEMONSTRATING (AT EXIT-COMMAND)
Scenario : Generally if a screen contains any obligatory(Required) input field & we
execute the MP program , the screen appears & if we want to come out of the program it
will not allow us . We have to fill the mandatory field on the screen and then we can come
out of the program by clicking on the application tool bar buttons. To overcome this
problem , generally we use AT EXIT-COMMAND at PAI of the screen to force exit from the
screen that contains a required field without filling any value to it.

Here we have two screens 9000 and 9001. In the 9000 screen we have an required i/p
field & a single record is displayed on 9001 screen based on the i/p.

******** program on at exit-command *************

data : p_carr type spfli-carrid,


wa_spfli type spfli,
ok_code type sy-ucomm.

module STATUS_9000 output.


SET PF-STATUS 'STATUS'. " DOUBLE CLICK ON 'STATUS' TO CREATE IT
* SET TITLEBAR 'xxx'.

endmodule. " STATUS_9000 OUTPUT

module FORCE_EXIT input.

http://freesapabap.blogspot.com/2012/05/module-pool.html 11/16
10/31/2018 TECHSAP : MODULE POOL
CASE OK_CODE.
WHEN 'EXIT' OR 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
endmodule. " FORCE_EXIT INPUT

module USER_COMMAND_9000 input.


case ok_code.
WHEN 'DISP'.
CALL SCREEN 9001.
WHEN 'BACK'.
LEAVE PROGRAM.
endcase.
endmodule. " USER_COMMAND_9000 INPUT

module STATUS_9001 output.


* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
SELECT SINGLE * FROM SPFLI INTO WA_SPFLI WHERE CARRID = P_CARR.

endmodule. " STATUS_9001 OUTPUT

module USER_COMMAND_9001 input.


case ok_code.
when 'BACK'.
LEAVE TO SCREEN 0.
endcase.
endmodule. " USER_COMMAND_9001 INPUT

TO CREATE PF STATUS 
STEP-1 : Double click on 'STATUS' to create pf status and click on yes button.

STEP-2:  Give a short description.

 STEP-3: Click on the '+' button of the Function key & fill values 'BACK',  'EXIT' & 'CANCEL'.

http://freesapabap.blogspot.com/2012/05/module-pool.html 12/16
10/31/2018 TECHSAP : MODULE POOL

 STEP-4: Double click on 'EXIT' & the following screen will appear. Click of the value help
of theFunction Type field and choose the first entry. 'E' type.

  

STEP-5  : Click yes to set 'E' for the EXIT and also set 'E' type also for 'CANCEL'

 FLOW LOGIC OF SCREEN 9000


PROCESS BEFORE OUTPUT.
  MODULE status_9000.

PROCESS AFTER INPUT.
  MODULE force_exit AT EXIT-COMMAND.
  MODULE user_command_9000.

http://freesapabap.blogspot.com/2012/05/module-pool.html 13/16
10/31/2018 TECHSAP : MODULE POOL

FLOW
LOGIC OF
SCREEN
9001
PROCESS BE
FORE OUTPU
T.
 MODULE STATUS_9001.
PROCESS AFTER INPUT.
 MODULE USER_COMMAND_9001.

OUTPUT:

at 10:49:00

10 comments

Add a comment

Top comments

Sieve Software 2 months ago  -  Shared publicly


 
The information have been given by this blog, which is very informative and
truly helpful, for who are looking for https://www.sievesoftware.com/sap-
mm/ SAP MM Training in Hyderabad. Sieve Software is the best institute for
SAP MM training and placements in Hyderabad.
http://freesapabap.blogspot.com/2012/05/module-pool.html 14/16
10/31/2018 TECHSAP : MODULE POOL

1  ·  Reply

calfre services 2 months ago  -  Shared publicly


I  am reading your post from the beginning, it was so interesting to read & I
feel thanks to you for posting such a good blog, keep updates
regularly..https://www.calfre.com/India/Hyderabad/Ameerpet/SAP-HR-
ABAP-Training/listing

1  ·  Reply

ragu varan 1 year ago  -  Shared publicly


 
Best SAP FIORI Training in Chennai by leading FIORI UI Consultant.
Reach at 9003085882 or
http://thecreatingexperts.com/category/sap- ori-training-in-chennai/

1  ·  Reply

Sanaya Mohit 1 year ago  -  Shared publicly


 
SAP ABAP hands on training is available with real time scenarios in THE
CREATING EXPERTS

http://thecreatingexperts.com/sap-abap-training-in-chennai/

1  ·  Reply

vidya sagar 5 years ago


 how to create radio buttons in module pool program

Siva Prasad Jena 5 years ago


 Create a variable like data: rb1 type c. and take it to the module pool
screen. Then right click on the element on the screen to convertt it to a
radio button or check box and follow the path: Transform-Radiobutton-
Left button/Right button.

Hugo Omar Rodriguez 5 years ago


 GREAT JOB. !!!

alex linh 5 years ago


 
How to create a status bar in module pool /user dialog abapprogramming,
you could check this link
http://saptechnicals.blogspot.com/2012/12/module-pool-programming-
create-gui.html

ragu varan 1 year ago  -  Shared publicly


 
Best sap MM and SD training with placement chennai
http://thecreatingexperts.com/sap-mm-training-in-chennai/

1  ·  Reply

ragu varan 1 year ago  -  Shared publicly


 
Best sap MM and SD training with placement Chennai
http://thecreatingexperts.com/sap-mm-training-in-chennai/

1  ·  Reply

Post a Comment

http://freesapabap.blogspot.com/2012/05/module-pool.html 15/16
10/31/2018 TECHSAP : MODULE POOL

Newer Post Home Older Post

Subscribe to: Post Comments (Atom)

Comments system

Disqus Shortname

Simple theme. Powered by Blogger.

http://freesapabap.blogspot.com/2012/05/module-pool.html 16/16

S-ar putea să vă placă și