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.
- 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.
- Open SAP ABAP and type SE38 in the transaction code search bar and hit enter.
- Type the program name starting with Z and click Create. Here I have taken the program name ZMODULEPOOL.
- 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.
- Now ABAP Editor page will open with our default program name on this screen.
- Here no need to declare any code, just save, check, and activate the program.
This is the first method in the SE38 ABAP Editor to create a design in SAP ABAP.
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.
- Type SE51 in the transaction code search bar and hit enter to design the screen in the module Pool Program.
- Give the program name, which we created in the SE38 transaction code. Give any four-digit Screen number and click Create.
- On this page, we can give a Short Description as per your wish. Then click Flow Logic to move next step.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- As usual, Save and activate the screen to see the design output in the module pool program.
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.
- Now Test Screen ZMODULEPOOL 1000 page will appear. Click the tickmark at the end to see the output for the screen design.
- Below is the output for the screen design in the module pool program.
This is how we must create a screen design in SE51 Tcode from the SAP ABAP.
You may also like:
- How to Create a Foreign Key in SAP ABAP
- How to Create Basic SAP ABAP Program?
- How to Create a Package in SAP ABAP
- How to Use Select Statement in SAP HANA Cloud
- How to Create Table Maintenance Generator in SAP ABAP
- What are Reports and their Types in SAP ABAP [With Examples]
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
I am Chris Waldron, working as a Senior SAP HANA Consultant at Halliburton, Houston, Texas, United States. I have been working in SAP for more than 15 years, especially in SAP IT consulting and business consulting. I worked in various industries in Sales & Distribution, Customer Relationship Management, banking, Risk Management, etc. And I am an SAP Certified Development Specialist – ABAP for SAP HANA 2.0 and SAP HANA Modeling Certified consultant. Read more