How to Create Module Pool Program in SAP?

Do you know how to create Module Pool Program in SAP? Earlier, we have seen how to create a module pool program by SE80 Tcode directly.

In this tutorial, I will explain how to Create a Module Pool Program by Different TCODE. I will show the screen design as well through SE38 Tcode.

Also, Read: How to Create Append Structure in SAP ABAP

Module Pool Programming in SAP

  • This is also called Screen programming, Module programming, or Dialog programming in SAP. The reason for using module pool programming is for screen design.
  • For example, if we want to see the fields under the SAP table in the output, through the screen design we can bring. See the below screenshot for clarity.
Module pool screen design in SAP ABAP
  • Generally, we need to know about 4 TCODE in module pool programming namely SE38 for setting the module pool programming, SE51 for designing the screen, SE41 for setting the application toolbar, and SE93 for creating the TCODE.
  • If we used all the TCODE then it will be easy in SE38 TCODE to solve the problem or debug what the program is and to know the program screen.

How to Create Module Pool Program in SAP

Let’s see how to create a module pool program in SE38 Tcode.

Step-1:

  • Open SAP ABAP and type SE38 in the transaction code search bar and hit enter.
How to Create Module Pool Program in SAP ABAP

  • Type the program name starting with Z and click Create. Here I have taken the program name ZMODULEPOOL.
Module Pool Program in SAP ABAP

Step-3:

  • Once we click Create, the program Attributes ZMODULEPOOL Change page will appear. Give the Title Module Pool Program and type it as Module pool and click Save.
How to Create Module Pool Program in SAP

Step-4:

  • Now ABAP Editor page will open with our default program name on this screen.
Module Pool Program in SAP ABAP

Step-5:

  • Here no need to declare any code, just save, check, and activate the program.
Module Pool Program in SAP ABAP

This is the first method in the SE38 ABAP Editor to create a design in SAP ABAP.

Check out: How to Create SAP ABAP List View Report (ALV)

How to Design Screen in SE51 TCODE from SAP ABAP

Follow the below steps to design a screen in the SE51 transaction code from SAP ABAP.

Step-1:

  • Type SE51 in the transaction code search bar and hit enter to design the screen in the module Pool Program.
SAP ABAP Screen design in Module Pool

Step-2:

  • Give the program name, which we created in the SE38 transaction code. Give any four-digit Screen number and click Create.
SAP ABAP Screen design in the Module Pool

Step-3:

  • On this page, we can give a Short Description as per your wish. Then click Flow Logic to move next step.
Module pool program from SAP ABAP

Step-4:

  • Once we click Flow logic, the program page will appear with Process Before Output(PBO) and Process After Input(PAI) along with the screen number we have chosen. Uncomment the module status and module user command.
SAP ABAP Screen design in Module Pool Program

Step-5:

  • Double-click the Module Status_1000 output and uncomment the lines SET PF-STATUS and SET TITLEBAR in the program. After this save by CTRL+S and activate by clicking CTRL+F3.
Module Pool report in SAP ABAP

Step-6:

  • Double-click on Module user_command and save the program in the module pool and click the tick mark at the end or click CTRL+S. Then save and activate the program by clicking CTRL+S and CTRL+F3.
Screen design in SAP ABAP Module pool

Step-7:

  • In PBO we can write initialization, events. while in PAI we can write select queries, condition statements, and looping statements. Now click on the Layout option to design the screen in the module pool report.
Layout design in SAP ABAP Module pool

Step-8:

  • The layout screen will open at this point. To draw and name the fields using drag and drop, click the T icon. Once drawn, double-click the rectangle to see the screen painter toolbox, where you can write emp_id in the Text column and T1 in the Name column.
Module pool Screen in SAP ABAP

Step-9:

  • In this step, we have to choose a rectangle icon and double-click to choose input 1 in the Name column from the screen painter. In this same way, give all the fields such as emp_name, emp_phn, and emp_country.
Module pool Program in SAP ABAP

Step-10:

  • As usual, Save and activate the screen to see the design output in the module pool program.

Step-11:

Once saved, execute the layout by clicking the icon on the top of the page in SE51. Click the Test F8 icon at the top of the Screen Painter page which is similar to the save icon to see the output.

Step-12:

  • Now Test Screen ZMODULEPOOL 1000 page will appear. Click the tickmark at the end to see the output for the screen design.
Module pool Output in SAP ABAP

Step-13:

  • Below is the output for the screen design in the module pool program.
Module pool in SAP ABAP Screen

This is how we must create a screen design in SE51 Tcode from the SAP ABAP.

You may also like:

Conclusion

I hope this tutorial might be useful for you to create a module pool and also design the screen in SE51 Tcode. Below are the topics covered in this SAP tutorial.

  • Introduction to Module Pool Program
  • How to Create a Module Pool in SE38 transaction code.
  • How to Design Screen in SE51 TCODE