Ads

SAP ABAP Dialog Programming

SAP ABAP Dialog Programming(Module Pool Programming)

When we enter into any SAP Transaction code ,we will enter the data into screen fields and clicking on menu item and we will click on SAVE button .These interactions btween user and screen is calling the dailog programming

Dialog program provides us  to navigate back and forth between screens
Dialog programs are created with type as 'M' - Module Pool. They cannot be executed independently and must be attached to at least one transaction code in which you specify an initial screen.

Dialog Program:

With the help of  dialog program ,we can work interactively with the system and we can change the contents of the database tables. Each and every dialog program having  a certain sequence of screens which are processed by the system one after the other.


Structure of Dialog Program


Transaction code
The transaction code starts a screen sequence.
We are creating Transaction codes in  SE93 Tcode.
A transaction code is linked to an ABAP program and an initial screen.
.
Screens
Each dialog in an SAP system is controlled by one or more screens.
We will create screens using the Screen Painter in the ABAP Workbench using transaction SE51

GUI status
Each screen has a GUI status(es) which are independent components of a program.
This controls the menu bars, standard toolbar, application toolbar , with which the user can choose functions in the application.
You create them in the ABAP Workbench using the Menu Painter (SE41).
ABAP Program
Each screen and GUI status in the R/3 System belongs to one ABAP program.
The ABAP program contains the dialog modules that are called by the screen flow logic, and also process the user input from the GUI status.

Screen Flow Logic

Screen Flow logic is primarily divided into four components.
Process Before Output (PBO) event: which is processed before the screen is displayed
Process After Input (PAI) event: which is processed after a user action on the screen
Process on help request (POH): which is processed when F1 is pressed
Process on value request (POV):which is processed when F4 is pressed






We should create every module pool program with the help of four transactions.

1.Create Module pool program in the SE38 transaction code.
2.Create screens and its elements and attributes in SE51 transaction code.
3.Create All Menu's in the SE41 transaction code.
4.Create Transaction code for your module pool program in SE91 Transaction Code.

Screen Painter(SE51) :


The Screen Painter is a tool in the ABAP Workbench that you use to create screens for ABAP programs and flow logic for the screens.

Screen Attributes
Screen attributes describe a screen object in the SAP system. They describe the program to which the screen belongs and the type of screen.
Screen Layout
The screen layout describes both the screen elements and their layout. The most common screen elements are I/O fields, text fields, check boxes, radio buttons, push buttons and controls. Fields are defined in the ABAP Dictionary or in your program.
Flow Logic
The flow logic controls the flow of your program.
Screen Painter Modes
The Screen Painter has a Layout Editor with two modes:
●      Graphical mode (available only on Windows platforms)
●      Alphanumeric mode.
 In the graphical mode, you use a drag and drop interface similar to a drawing tool. In the alphanumeric mode, you use your keyboard and menus. To activate the graphical mode, in the Screen Painter choose Utilities → Settings →Graphical layout editor.

Screen Elements 

A screen can contain a wide variety of elements, either for displaying field contents, or for allowing the user to interact with the program (for example, filling out input fields or choosing pushbutton functions). You use the Screen Painter to arrange elements on the screen.
You can use the following elements:
·        Text fields

·        Input/output fields and templates

·        Dropdown list boxes

·        Checkbox elements

·        Radio button elements

·        Pushbuttons

·        Frame

·        Subscreens

·        Table controls

·        Tabstrip controls

·        Custom Controls

·        Status icons

·        OK field

Menu Painter(SE41):


The Menu Painter is one of the tools of the ABAP Workbench. You use it to design user interfaces for your ABAP programs and to define the functions that you want to use within these interfaces.


ABAP programs contain a wide variety of functions which fall into different categories within the user interface. An instance of the user interface consisting of a menu bar, a toolbar for system function keys (standard toolbar), and an application toolbar, is called a GUI status. The GUI status and GUI title defines how the user interface looks and behaves in an ABAP program. You can see a representation of these objects in the figure below.

What can we create in Module Pool Prgogramming:

Let us learn more features of screen elements and using screen painter what elements can we create .

Modal Dialog Box:

Description : Modal Dialog Box is a Pop up window which is displayed on the top of the screen.

Respond to double Click

We can create double click property for screen fileds

Subscreens

A Sub screen is nothing but a screen with in a screen.
Displaying of data of one screen (sub screen) in the other screen (normal screen) is done by using sub screens.  
The below functions are not possible in the sub screens.

GUI status cannot be set to the sub screen.
OKCODE is not applicable to the sub screen.
Sub screen cannot call another screen.
It cannot contain AT EXIT-COMMAND. 
MULTIPLE SUB SCREENS

You can call multiple sub screens in the same area and is done dynamically during runtime by using variable screen number.
 At any given point of time, only one sub screen can be called in the sub screen area. 

F4 help

You can call dialog modules in the POV event using the event keyword PROCESS ON VALUE-REQUEST.

PROCESS ON VALUE-REQUEST.
...
  FIELD <f> MODULE <mod>.
...
F4IF_FIELD_VALUE_REQUEST

F4IF_INT_TABLE_VALUE_REQUEST

There are also two function modules - DYNP_VALUES_READ and DYNP_VALUES_UPDATE - that can read the values of screen fields and return values to them during the POV event. 

field mandatory/obligatory

We can assign the mandatory options the screen input fileds.

Radio buttons

Special input/output fields that are combined into groups. Within a radio button group, only a single button can be selected at any one time. When the user selects one button, all of the others are automatically deselected. Radio button elements can be linked with function codes.

Creation of Variants

We can create selection screen variant for module pool programs. Module programming can be used with Selection Screens and similar to the report programming, variants can be saved and loaded.

Context Menu

 The Use of Context menu in Screen  ,is adding Right click menu options in  screen Through Screen painter context-specific menus can be defined on dynpros for any of the following screen elements:

Input/output fields
Text fields
Table controls
Group boxes
Subscreens

Wizard creation

Wizard is a tool that guides a user to do a certain task in SAP step by step. 

Step-loops

Step-loops in Module Pool Programming

 Step loops are objects for screen table display that are added to a screen in the Screen Painter. They are preferred in cases of Radio-frequency applications where ALV displays or table controls pose a hindrance with respect to small displays and navigational issues.


Fixed Step-loops
In case of Fixed step-loops, the number of lines of records would be fixed as when designed. You can increase the number of records at run time. Although the number of records can be decreased as per programming logic if number of records in table to be displayed are less than fixed number.
Variable Step-loops
In case of variable step-loops, at run time we can increase the number of repetitive blocks depending on the size of the screen.

Select-options 

It is possible in Module Pool program to create select-options as in the report programs.
Selection-screen can be defined as sub screen and can be applied in the sub screen area of module pool program.  

Dynamically editable cells 

We can make a specific cell as dynamically editable in a table control.

Table Control

We can display the data in the table format using table control which provides us with the below functions:

Scroll through the table vertically and horizontally
Re-size the width of a column
Scroll within a field .
Select table rows or columns
Re-order the sequence of columns
Save the current display settings for future use

automatic table resizing (vertical and horizontal) when the user resizes the window
separator lines between rows and between columns (vertical and horizontal)


Insertion
Deletion
Scrolling
First
Last
Next
Previous
Select
Select all
Deselect
Deselect all  

Splitter Controls and Graphs

Sample code for creating a splitter screen and graph.
The screen is divided into two by splitter control and can be resized
Two graphs are drawn on the two splitter containers.
The sample code also describes creating graphs in ABAP.

 images 

We can Upload picture into SAP using the transaction SE78. 

Tabstrips

Areas on the screen in which you can switch between various pages.

Checkbox

We would design a screen with an input field for customer number and three check boxes for Name, City and Address. Upon entering the customer number and selecting any of the check boxes, the corresponding data should be displayed

Logo 

We can attach logos on the screens.

Defining a Range

We can create renge option in module pool Program.

Dynamic Button Text

 We can display the button with different text after the click or some action.

    Module Pool Programming
     SAP ABAP Guide Tutorials

Comments

Popular posts from this blog

BADI Interview Questions in SAP ABAP

Sample SAP ABAP Programming Examples for Practice

Module Pool Programming Interview Questions and Answers in SAP ABAP

Step by Step tutorial on BDC Session Method Program in SAP ABAP

SAP ABAP Interview Questions and Answers for 10 Years Experienced