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.
Step-1:
- 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.
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.
Step-4:
- Now ABAP Editor page will open with our default program name on this screen.
Step-5:
- 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.
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.
Step-2:
- Give the program name, which we created in the SE38 transaction code. Give any four-digit Screen number and click Create.
Step-3:
- On this page, we can give a Short Description as per your wish. Then click Flow Logic to move next step.
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.
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.
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.
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.
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.
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.
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.
Step-13:
- 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]
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
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