Dialog Programming Tutorial: Module Pool in SAP ABAP
Module Pool programming is a vital part of SAP ABAP
(Advanced Business Application Programming) that allows developers to create
interactive and user-friendly interfaces for SAP applications. These interfaces
are known as "Dialogs" and provide a seamless way for users to
interact with the SAP system. In this tutorial, we will explore the basics of
Module Pool programming, its components, and step-by-step instructions to
create a simple dialog using SAP ABAP.
1. Understanding
Module Pool Programming
Module Pool programming enables the creation of SAP screens
that facilitate user interactions. The primary components of a Module Pool
include:
2. Creating
a Simple Dialog Program
Let's create a simple Module Pool program that displays a
dialog screen with an input field and a push button. Upon clicking the push
button, the program will display a message with the entered data.
Step 1: Creating a New Dialog Program Launch the ABAP
Workbench (Transaction code: SE80) and choose "Package" or
"Development Class" to organize your objects. Right-click and select
"Create" -> "Program" to create a new program. Enter a
program name and description.
Step 2: Creating a New Screen (Dynpro) Right-click on
"Screen Painter" and choose "Create" to design a new
screen. Enter a screen number and description. Design the screen with a text
field for user input (e.g., P_NAME) and a push button (e.g., PB_OK).
Step 3: Designing the Flow Logic In the "Flow
Logic" tab, define the flow logic to handle the push button's action.
Double-click on the push button to add logic. For example:
SAP-ABAP upholds two sorts of projects - Report Program and Dialog Program.
On the off chance that your ABAP program requests client input , Dialog writing computer programs is utilized.
In this instructional exercise you will learn:
A client exchange is any type of connection between the client and the program and could be any of the accompanying
Entering information
Picking a menu thing
Clicking a button
Clicking or double tapping a passage
Discourse program is additionally utilized when we really want to explore this way and that between screens
Exchange programs are made with type as 'M' - Module Pool. They can't be executed autonomously and should be appended to something like one exchange code in which you determine an underlying screen.
Distinction among Report and Dialog Programs
Report Program:
A report is a program that commonly peruses and dissects information in data set tables without changing the data set.
Discourse Program:
A discourse program permits you to work intuitively with the framework and to change the items in the data set tables. Every exchange program has a specific succession of screens that are handled by the framework consistently.
A Sample exchange handling in Dialog Programming
Parts of Dialog Program
Dissimilar to report which by and large involves the formation of one independent program which can be executed autonomously of different articles, discourse program advancement involves improvement of numerous articles none of which can be executed all alone. Rather all items are connected progressively to the principal program and are executed in a grouping directed by the Dialog Main Program.
The parts of a discourse program are:
The exchange code begins a screen succession.
You make exchange codes in the Repository Browser in the ABAP Workbench or utilizing Transaction SE93.
An exchange code is connected to an ABAP program and an underlying screen.
You can begin a screen grouping from any ABAP program utilizing the CALL SCREEN explanation.
Screens
Every exchange in a SAP framework is constrained by at least one screens.
You make screens involving the Screen Painter in the ABAP Workbench through exchange SE51
Each screen has a place with an ABAP program.
These screens comprise of a "screen cover" or "design" and its stream rationale. The screen has a design that decides the places of information/yield fields and other graphical components, for example, checkboxes and radio buttons. A stream rationale decides the consistent handling inside screen.
GUI status
Each screen has a GUI status(es) which are free parts of a program.
This controls the menu bars, standard toolbar, application toolbar , with which the client can pick capabilities in the application.
You make them in the ABAP Workbench utilizing the Menu Painter.
ABAP Program
Each screen and GUI status in the R/3 System has a place with one ABAP program.
The ABAP program contains the discourse modules that are called by the screen stream rationale, and furthermore process the client input from the GUI status.
ABAP programs that utilization screens are otherwise called discourse programs.In a module pool (type M program); the principal handling block to be called is consistently a discourse module. Nonetheless, you can likewise utilize separates other ABAP programs, like executable projects or capability modules. The principal handling block is then called in an unexpected way; for instance, by the runtime climate or a strategy call. The screen succession is then begun utilizing the CALL SCREEN articulation.
Experience the difference |
Screen Flow Logic
Screen Flow rationale is principally separated into four parts.
Process Before Output (PBO) occasion: which is handled before the screen is shown
Process After Input (PAI) occasion: which is handled after a client activity on the screen
Process on help demand (POH): which is handled when F1 is squeezed
Process on esteem demand (POV):which is handled when F4 is squeezed
Dynpro
A screen along with its Flow rationale is known as a Dynpro ("Dynamic Program" since the screen stream rationale impacts the program stream)Each dynpro controls precisely one stage of your Dialog Program. The screens having a place with a program are numbered. The screen stream grouping can be either direct or cyclic. From inside a screen chain, you might in fact call another screen chain and, subsequent to handling it, return to the first chain. You can likewise abrogate the statically-characterized next screen from inside the exchange modules of the ABAP program.
ABAP Module Pool
On a PBO or PAI occasion a Dynpro calls an ABAP discourse program. Assortment of such projects is known as the ABAP module pool.For instance modules called at the PAI occasion are utilized to check the client input and to set off fitting exchange stages, for example, the update task. All dynpros to be called from inside one exchange allude to a typical module pool.