0% found this document useful (0 votes)
3 views69 pages

Chapter 6 - Module Pool Programming

The document provides a comprehensive guide on Module Pool Programming, detailing the creation of module pool programs, screens, and navigation between them. It covers essential concepts such as events, screen design, and the implementation of functionalities like sub screens, modal dialog boxes, and tab strips. Additionally, it includes step-by-step instructions for creating a module pool program and integrating multiple applications.

Uploaded by

rashmiranjan2021
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views69 pages

Chapter 6 - Module Pool Programming

The document provides a comprehensive guide on Module Pool Programming, detailing the creation of module pool programs, screens, and navigation between them. It covers essential concepts such as events, screen design, and the implementation of functionalities like sub screens, modal dialog boxes, and tab strips. Additionally, it includes step-by-step instructions for creating a module pool program and integrating multiple applications.

Uploaded by

rashmiranjan2021
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1️⃣

Introduction to Module Pool


Programming

1. Introduction
Module Pool Programming is also called as dialog programming.

Module Pool is a pool of modules ( Screens, Includes, Transactions, etc. ).

2. Creating our First Module Pool Program


Step 1 :- Create a module pool program from SE38.

Introduction to Module Pool Programming 1


Mob No :- +916261538504
Whenever we create a module pool program, here the name of the program will start
with PROGRAM keyword.

In case of executable program, the keyword will be REPORT.

Step 2 :- Click on display object list to navigate to SE80.

3. Requirement
Let’s take a requirement to create two screens ( 100 and 200 ) out of which we will display
Employee details on screen 100 and Project details on screen 200.

Tabs of a Screen :-
1. Attributes :-
It gives us the generic information of that screen.

i.e. description, type, package etc.

Introduction to Module Pool Programming 2


Mob No :- +916261538504
2. Element List :-
It provides the list of elements available on that screen.

All the elements that we will design on this screen will be a part of element list.

3. Flow Logic :-
Its purpose is to write the logic.

4. Creating Screens
Step 1 :- Right click on the program name → create → screen to create a screen.

Introduction to Module Pool Programming 3


Mob No :- +916261538504
5. Module Pool Events
1. PBO(Process Before Output)
This event called before displaying a particular screen.

Whenever the program is executed, the module inside the PBO event is triggered first.

2. PAI(Process after Input) :-


This event called after performing some action on a particular screen.

3. POV(Process on Value Request) :-


This event called when we click F4 on a field of a screen.

4. POH(Process on Help Request) :-


This event called when we click F1 ( Technical information ) on a field of a screen.

F4 Help :-
It tells us what are the various possible values for any input field.

Introduction to Module Pool Programming 4


Mob No :- +916261538504
F1 Help :-
It gives us the technical information of any field/column.

6. Navigating from one screen to another


To navigate from screen 100 to screen 200, we will create a button on both screen.

For creating buttons we will use PBO event and for writing logic we will use PAI event.

Creating buttons ( functions ) :-


Step 1 :- Go to flow logic of screen 100.

Step 2 :- Double click on the EMPLOYEE and go to the application toolbar.

Introduction to Module Pool Programming 5


Mob No :- +916261538504
7. Writing Logic for our Function in Screen 100.
Step 1 :- Uncomment the event Process after input.

Double click on the module USER_COMMAND_0100 and write a logic to navigate


from screen 100 to screen 200.

8. Implementation for function on screen 200.


Step 1 :- We will go to screen 200 and we will un comment the PBO event and we will
create function for that.

Introduction to Module Pool Programming 6


Mob No :- +916261538504
Step 2 :- Uncomment the PAI and write the logic to call the screen 100.

9. Creating Transaction for Module Pool


We can not directly execute a Module Pool Program.

A transaction code is required to run a module pool prorgam.

Introduction to Module Pool Programming 7


Mob No :- +916261538504
Press enter.

Introduction to Module Pool Programming 8


Mob No :- +916261538504
Click on save button and assign the package and transport request.

Execute the Program

Introduction to Module Pool Programming 9


Mob No :- +916261538504
2️⃣
Designing the layout and Displaying
data in Module Pool Programming
(Using Screen Painter )
In the previous part we discussed the introduction part of our Module Pool Programming
and we designed two screens 100 and 200 and we wrote logic to navigate from one
screen to another.

Now, In this part we will design the layout to display data of Employee on screen 100
and Project details on screen 200.

Required design for screen 100.

Designing the layout and Displaying data in Module Pool Programming (Using Screen Painter ) 1
Mob No :- +916261538504
We will create a label Employee Id and then we will create a input field for it where we
will take input from the user.

Then we will create a button SUBMIT and when we will click on that SUBMIT button,
we will display the Employee Details based on the input on Screen 100.

Designing Screen 100


Step 1 :- Click on the layout tab on screen 100.

Step 2 :- Click on the text field to create a field label for Employee Id.

Step 3 :- Then we are require to create a input field to take input from user and for that
we will click on input/output field.

Step 4 :- Then we will create a pushbutton for SUBMIT.

Note :-
Every buttons requires a function code.

Designing the layout and Displaying data in Module Pool Programming (Using Screen Painter ) 2
Mob No :- +916261538504
Step 5 :- Now to display the data from various field of Employee Table

So, for that purpose, we will click on Dictionary/Program fields.

Now, the designing part of screen 100 is done.

Implementing Logic for Screen 100


Step 1 :- Go to the program and declare a structure for our employee table and then we
will create a internal table and work area for the same.

Then we will go to screen 100 and write the logic in PAI of screen 100.

Designing the layout and Displaying data in Module Pool Programming (Using Screen Painter ) 3
Mob No :- +916261538504
Requirement for screen 200
Since, we are getting data from our Employee table on screen 100 and now we want to
display data of the project details tables on screen 200 based on the input of Employee Id
on screen 100.

For showing multiple data we will require the understanding of Table Control with
wizard and we will discuss this in the next part.

Designing the layout and Displaying data in Module Pool Programming (Using Screen Painter ) 4
Mob No :- +916261538504
3️⃣
Table Control With Wizard

In the previous part we designed the layout of screen 100 and we displayed the data from
Employee table on it based on the given input of Employee Id.

In this part we will display the data of Project Details on screen 200.

Now, see we have multiple records in Project Details tables for each employee Id, so for
displaying multiple records in module pool programming we use the concept of Table
Control With Wizard.

Definition
Table Control is used to display data in the form of a table( column and rows ).

Designing layout of Screen 200 :-


Step 1 :- Declare a type structure for Project Details table and also declare a corresponding
internal table and work area.

Step 2 :- Go to Screen 200 and click on layout.

Step 3 :- Click on Table Control With Wizard button.

Table Control With Wizard 1


Mob No :- +916261538504
these are the various steps in a table control with wizard, and whenever one step will be
completed, the status will be changed to green.

Click on continue button.

Step 4 :- Give a name for your table control.

Click on continue button.

Step 5 :- Prove the internal table and work area.

Table Control With Wizard 2


Mob No :- +916261538504
Click on continue button.

Step 6 :- Select the columns which you want to be displayed.

Click on continue button.

Step 7 :- Click on continue button.

Step 8 :- Select the scroll checkbox.

Table Control With Wizard 3


Mob No :- +916261538504
Click on continue button → continue → complete.

Writing logic for displaying data in screen 200.

Go to PAI of screen 100 and write the below logic.

Testing the Implementation :-

Table Control With Wizard 4


Mob No :- +916261538504
Table Control With Wizard 5
Mob No :- +916261538504
4️⃣
Sub Screens in Module Pool

A section of the screen that is defined within in the module pool program is referred to as a
submodule or Sub Screen.

Sub screens are extra screens which can be integrated into the primary screen.

Requirement :-
Calling a Sub screen into the normal screen/ primary screen.

We will display Employee Details on the Sub Screen from our Employee Table.

Sub Screens in Module Pool 1


Mob No :- +916261538504
Hints :-
Create a sub screen area in the normal screen.

Call the Sub Screen in to the sub screen area of the normal screen.

Syntax :-
CALL SUBSCREEN SUB INCLUDING SY-REPID ‘0200’.

WHERE
SUB :- Sub Screen area name

SY-REPID :- System variable for Report Id

0200 :- Sub Screen Number

Implementation
Step 1 :- Create a module pool program from SE38 transaction code.

Step 2 :- Create normal screen ‘0100’..

Sub Screens in Module Pool 2


Mob No :- +916261538504
Step 3 :- Create a Sub Screen ‘0200’.

Step 4 :- We will go to screen ‘100’ and we will create a label for Employee Id, input/output
field for Employee id and a Submit button.

Step 5 :- Create a sub screen area on screen 100 with name SUB.

Sub Screens in Module Pool 3


Mob No :- +916261538504
Step 6 :- Then we will go to screen ‘200’ and we will design a layout for screen 200.

Step 7 :- From the 100 screen we will call the screen 200 from PBO event.

Sub Screens in Module Pool 4


Mob No :- +916261538504
Step 8 :- Create the transaction code for the program.

Code :-
*&-----------------------------------------------------------
*& Module Pool ZAR_SUB
*&
*&-----------------------------------------------------------
*&
*&
*&-----------------------------------------------------------

PROGRAM ZAR_SUB.
TABLES : ZAR_EMP_TAB.
TYPES : begin of ty_employee,
EMP_ID type ZAR_EMP_ID,
EMP_NAME type ZAR_EMP_NAMe,
department type ZAR_DEPARTMENT,
manager type ZAR_MANAGER,
end of ty_employee.
DATA : lt_employee type table of TY_EMPLOYEE,
ls_employee type TY_EMPLOYEE.
*&-----------------------------------------------------------
*& Module USER_COMMAND_0100 INPUT
*&-----------------------------------------------------------
* text
*------------------------------------------------------------
MODULE USER_COMMAND_0100 INPUT.
if sy-ucomm eq 'SUBMIT'.
Select emp_id emp_name department manager
from ZAR_EMP_TAB
into table LT_EMPLOYEE
where EMP_ID = ZAR_EMP_TAB-EMP_ID.

Read table LT_EMPLOYEE into LS_EMPLOYEE with key emp_id =

Sub Screens in Module Pool 5


Mob No :- +916261538504
if sy-subrc eq 0.
ZAR_EMP_TAB-EMP_NAME = ls_employee-EMP_NAME.
ZAR_EMP_TAB-department = LS_EMPLOYEE-DEPARTMENT.
ZAR_EMP_TAB-manager = LS_EMPLOYEE-MANAGER.
endif.
endif.
ENDMODULE. " USER_COMMAND_0100 INPUT

Output

Sub Screens in Module Pool 6


Mob No :- +916261538504
5️⃣
Modal Dialog Box

1. Introduction
This screen appears in the form of dialog box.

This screen usually appears in the form of a pop up screen.

2. Requirement

On Screen 100, when we click on Submit button, the data from our Employee table will
appear in form of Modal Dialog box from screen 200 and when the user will click on OK
button, the control will get back to the 100 screen.

Syntax :-
CALL SCREEN 0200 STARTING AT 10 20 "Top Left Corner Coordinates
ENDING AT 70 80. "Bottom Righ

Modal Dialog Box 1


Mob No :- +916261538504
3. Implementation
*&--------------------------------------------------------------
*& Module Pool ZAR_MODAL
*&
*&--------------------------------------------------------------
*&
*&
*&--------------------------------------------------------------

PROGRAM ZAR_MODAL.

TABLES : ZAR_EMP_TAB.

TYPES : begin of ty_employee,


EMP_ID type ZAR_EMP_ID,
EMP_NAME type ZAR_EMP_NAME,
DEPARTMENT type ZAR_DEPARTMENT,
manager type ZAR_MANAGER,
end of ty_employee.

DATA : lt_employee type table of ty_employee,


ls_employee type TY_EMPLOYEE.

*&--------------------------------------------------------------
*& Module USER_COMMAND_0100 INPUT
*&--------------------------------------------------------------
* text
*---------------------------------------------------------------
MODULE USER_COMMAND_0100 INPUT.

if sy-ucomm eq 'SUBMIT'.
Select EMP_Id EMP_NAME DEPARTMENT MANAGER
from ZAR_EMP_TAB
into table LT_EMPLOYEE

Modal Dialog Box 2


Mob No :- +916261538504
where EMP_ID = ZAR_EMP_TAB-EMP_ID.

Read table LT_EMPLOYEE into ls_employee with key emp_id =


if sy-subrc eq 0.
ZAR_EMP_TAB-EMP_NAME = ls_employee-emp_name.
ZAR_EMP_TAB-department = ls_employee-department.
ZAR_EMP_TAB-manager = ls_Employee-manager.

CALL SCREEN 0200 STARTING AT 10 20


ENDING AT 70 80.
endif.

endif.
ENDMODULE. " USER_COMMAND_0100 INPUT

*&--------------------------------------------------------------
*& Module USER_COMMAND_0200 INPUT
*&--------------------------------------------------------------
* text
*---------------------------------------------------------------
MODULE USER_COMMAND_0200 INPUT.
leave to screen 0. "to get back to previous screen on pressing e
ENDMODULE. " USER_COMMAND_0200 INPUT

Output

Modal Dialog Box 3


Mob No :- +916261538504
Modal Dialog Box 4
Mob No :- +916261538504
6️⃣
Tab Strip With Wizard

1. Introduction
A tab strip with a wizard interface combines the functionality of tabs for navigation with the
step-by-step guidance of a wizard.

For every tab SAP generates a Sub Screen.

Using Tab Strip With Wizard we can create multiple tabs in Module Pool and we can display
various kinds of data according to our requirement.

2. Requirement
Our Requirement is to create two tabs on a screen and to display Employee Details from
Employee Table on one tab and Project Details from Project Details table on another tab.

Tab Strip With Wizard 1


Mob No :- +916261538504
3. Implementation
Step 1 :- Create a module pool program from SE38.

Step 2 :- We will create a screen 100 and we will define a label, input/output field, a
Submit button.

Step 3 :- Create a tab strip with wizard.

Step 4 :- Click on continue button.

Tab Strip With Wizard 2


Mob No :- +916261538504
Step 5 :- Two sub screens has been created for each tab.

Step 6 :- Create structure for employee and project details.

Tab Strip With Wizard 3


Mob No :- +916261538504
Step 7 :- Then we will go to each sub screen and we will design the layout for each tab.

Step 8 :- uncomment the PAI of screen 100 and implement the logic.

Tab Strip With Wizard 4


Mob No :- +916261538504
Step 9 :- Create a transaction for the program.

Execute the program

Tab Strip With Wizard 5


Mob No :- +916261538504
Tab Strip With Wizard 6
Mob No :- +916261538504
7️⃣
Integrating Multiple Module Pool
Applications into One

Till now we have seen various kinds of screens in Module and we used them to achieve our
various kinds of requirements.

In this part we will see how we can integrate all Module Pool applications that we created
into a single one.

Requirement :-
We have created four module pool programs for our previous requirement which includes,

Table Control With Wizard

Sub Screen

Modal Dialog Box

Tab Strip With Wizard

In this part, we will call all these programs from one single Module Pool program.

Integrating Multiple Module Pool Applications into One 1


Mob No :- +916261538504
Field label for a heading, then 4 radio button and then a Submit push buttons.

Implementation :-
Step 1 :- Create a Module Pool Program from ABAP Editor.

Step 2 :- Create a normal screen and then design a label, 4 radio buttons, a SUBMIT
pushbuttons on it.

Now we are require to define our radio buttons to one group, otherwise you will see all
of them as ticked.

Integrating Multiple Module Pool Applications into One 2


Mob No :- +916261538504
So, to make them belong from one group, we are require to select all of them → click
on edit → grouping → Radio button group → Define.

Step 3 :- Now, we are required to define the variable for all the four radio buttons.

Integrating Multiple Module Pool Applications into One 3


Mob No :- +916261538504
Step 4 :- Implement the PAI of screen 100 to call all the module pool applications.

Step 5 :- Create a transaction code for the program.

Testing the Application :-

Integrating Multiple Module Pool Applications into One 4


Mob No :- +916261538504
Integrating Multiple Module Pool Applications into One 5
Mob No :- +916261538504
8️⃣
At Exit Command in Module Pool

AT EXIT COMMAND is used to leave the current screen without automatic input checks
taking place.

When we discussed the concept of Tab Strip With Wizard, we designed the below screen.

At Exit Command in Module Pool 1


Mob No :- +916261538504
When we do not provide any in input in Employee and we are clicking on Submit, then we
want a message to be displayed that please enter Employee Id.

Implementation of Above Requirement :-


Go to Screen 100 layout and double click on input field of Employee Id.

and mark it as required.

At Exit Command in Module Pool 2


Mob No :- +916261538504
Now, if you will click on Submit button, then it will give error if there will no input in
Employee Id.

Requirement 2 :-
In the above scenario if there is no input of Employee Id and we are clicking on Submit
button, then It will give error,

Even if you will click on any button, it will give the same error that no input in Employee Id.

Now, this time we want that if we click on Submit button, then and then only this error
should be shown and rest buttons should be working properly.

Implementation :-
Step 1 :- Mark the function type of the button as E.

At Exit Command in Module Pool 3


Mob No :- +916261538504
Step 2 :- Then we are require to create a module in PAI of screen 100 using AT EXIT-
COMMAND.

At Exit Command in Module Pool 4


Mob No :- +916261538504
9️⃣
Chain and End Chain in Module
Pool

1. Introduction
The purpose of Chain and End Chain is to validate the input Field.

We will validate the input given by user by using chain and end chain.

Note :-
To validate the user input you will provide a error message on your screen and as soon
as you will provide an error message on your screen your input screen will be disabled.

To overcome this issue, SAP has given us Chain and End Chain statement to perform
the validation step.

We can validate any number of field through chain and end chain.

2. Implementation

Chain and End Chain in Module Pool 1


Mob No :- +916261538504
We will use our first module pool program for this particular requirement.

Step 1 :- We will write a message that when we click on Submit button and Select query do
not return any result, then we will get a message that Employee details do not exist.

Now, when you will pass a wrong data on screen your screen will change to read mode
and you will not be able to pass the correct details.

So, to achieve this requirement so that our field will remain in change mode even we
pass the wrong details, we will implement the chain and end chain concept.

Step 2 :- We will go to Flow logic for screen 100 and we will implement the Chain and End
chain.

We can use multiple fields and we can write logic for each of them.

Chain and End Chain in Module Pool 2


Mob No :- +916261538504
Step 3 :- Double click on the validate and write the logic.

Execute the Code

Chain and End Chain in Module Pool 3


Mob No :- +916261538504
🔟
Changing the Screen Field
Properties

In this part we are going to see, how we can change the properties of screen fields based on
various kind of requirements.

Let’s take the example of our Table Control with wizard program which we have developed
in our previous parts.

Requirement
Our requirement is that when I given 101 as employee id, my screen fields of Employee
Details should be disabled and when I give employee id as 102, then screen field should be
enabled.

We will write a logic to achieve this requirement.

Implementation :-

Step 1 :- Go to PBO of 101 screen.

Step 2 :- Use the concept of loop at screen to implement it.

Changing the Screen Field Properties 1


Mob No :- +916261538504
LOOP at screen.
if ZAR_EMPLOYEE_TAB-EMP_ID = '101'.
if screen-name = 'ZAR_EMPLOYEE_TAB-EMP_NAME' or screen-nam
OR screen-name = 'ZAR_EMPLOYEE_TAB-MANAGER' or screen-na
screen-input = 0.
MODIFY SCREEN.
endif.
else.
screen-input = 1.
MODIFY SCREEN.
endif.
endloop.

Output

Changing the Screen Field Properties 2


Mob No :- +916261538504
Changing the Screen Field Properties 3
Mob No :- +916261538504
1️⃣
Drop Down List in Module Pool
Programming

In this part we will see how want have drop down list in Module Pool Programming.

Let’s take a requirement to understand this concept.

Requirement :-
We are going to create 2 drop down list, the second one should be dependent on the first one.

First drop down list should be regarding states which will consist of names of state and on
the basis of it, the second drop down list will have the values of cities present in that state.

Implementation :-
Step 1 :- To achieve this requirement, we will start with creation of a table having two
columns State and City in it.

Drop Down List in Module Pool Programming 1


Mob No :- +916261538504
Step 2 :- We have used the concept of value range to store data in state column in the above
table.

Step 3 :- Then we will create a module pool program through ABAP Editor ( SE38 )
transaction code.

Step 4 :- We will create a screen 100 there and we will design our requirement there.

Drop Down List in Module Pool Programming 2


Mob No :- +916261538504
Step 5 :- We will create a drop down for both the fields.

Step 6 :- Now we will write the logic, so that name of cities should only be shown for a
particular state in drop down format.

Note :-
Whenever we will give any value for the State then PAI should be triggered, so that we
write logic for city field.

So, to achieve that requirement, we will simply, give a function code for State
field.

Drop Down List in Module Pool Programming 3


Mob No :- +916261538504
Step 7 :- We will create the type structure and corresponding internal table and work area for
the same.

Step 8 :- Then we will write the logic for fetching and storing data in PAI of screen 100.

Drop Down List in Module Pool Programming 4


Mob No :- +916261538504
Step 9 :- Now, before displaying the data PBO event will trigger, so we will simply use
PBO to map the values of cities for the corresponding states.

Note :-
We have a dedicated function module VRM_SET_VALUES, which we can use for this
mapping.

Drop Down List in Module Pool Programming 5


Mob No :- +916261538504
Code :-
*&--------------------------------------------------------------
*& Modulpool ZAR_MODULE_POOL_DROP_DOWN
*&--------------------------------------------------------------
*&
*&--------------------------------------------------------------
PROGRAM zar_module_pool_drop_down.
TABLES : zar_state_city.
TYPES: BEGIN OF ty_state_city,
state TYPE zar_state,
city TYPE zar_city,
END OF ty_state_city.

DATA : lt_state_city TYPE TABLE OF ty_state_city,


ls_state_city TYPE ty_state_city.

*&--------------------------------------------------------------
*& Module STATUS_0100 OUTPUT
*&--------------------------------------------------------------
*&
*&--------------------------------------------------------------
MODULE status_0100 OUTPUT.
SET PF-STATUS 'DROP_DOWN'.
SET TITLEBAR 'DRP'.

IF zar_state_city-state IS NOT INITIAL.


DATA : lt_values TYPE vrm_values,
ls_values TYPE vrm_value.
clear lt_values.
LOOP AT lt_state_city INTO ls_state_city.

Drop Down List in Module Pool Programming 6


Mob No :- +916261538504
ls_values-key = ls_state_city-city.
ls_values-text = ls_state_city-city.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ENDLOOP.

CALL FUNCTION 'VRM_SET_VALUES'


EXPORTING
id = 'ZAR_STATE_CITY-CITY'
values = lt_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.

ENDIF.
ENDMODULE.
*&--------------------------------------------------------------
*& Module USER_COMMAND_0100 INPUT
*&--------------------------------------------------------------
* text
*---------------------------------------------------------------
MODULE user_command_0100 INPUT.
IF sy-ucomm EQ 'BACK'.
LEAVE TO SCREEN 0.
ENDIF.

IF sy-ucomm EQ 'STATE'.
SELECT state city
FROM zar_state_city
INTO CORRESPONDING FIELDS OF TABLE lt_state_city
WHERE state = zar_state_city-state.
ENDIF.
ENDMODULE.

Drop Down List in Module Pool Programming 7


Mob No :- +916261538504
Execute the Code :-

Drop Down List in Module Pool Programming 8


Mob No :- +916261538504
2️⃣
Select Option in Module Pool
Programming

Till now, In our Module Pool programming, we saw how we can create input/output field
and field labels etc.

Now, In this part we will see how we can create Select Options in case of Module Pool
Programming.

Implementation :-
Step 1 :- Go to SE38 transaction code and create a module pool program.

Step 2 :- Create a Screen.

Select Option in Module Pool Programming 1


Mob No :- +916261538504
Step 3 :- We will create a selection screen in our program as a sub screen.

and in this sub screen we will create our select options.

Step 4 :- We will go to screen 100, there we will create a sub screen area.

Select Option in Module Pool Programming 2


Mob No :- +916261538504
Step 5 :- Then we will call our sub screen into this sub screen area.

We will write this logic in PBO of screen 100.

Step 6 :- Create a transaction code.

Code :-
*&--------------------------------------------------------------
*& Modulpool ZAR_SELECT_OPTION_MODULE_POOL
*&--------------------------------------------------------------
*&
*&--------------------------------------------------------------
PROGRAM ZAR_SELECT_OPTION_MODULE_POOL.

DATA : lv_emp_id type ZAR_EMPLOYEE_ID.

Select Option in Module Pool Programming 3


Mob No :- +916261538504
SELECTION-SCREEN : begin of screen 200 as SUBSCREEN.

SELECT-OPTIONS : s_emp_id for lv_emp_id.

SELECTION-SCREEN : END OF SCREEN 200.

Execute the Code :-

Select Option in Module Pool Programming 4


Mob No :- +916261538504
3️⃣
Process on Value Request

POV stands for Process on Value Request in Module Pool Programming

When you will F4 on a field, then at that Process on Value Request event will call.

Requirement :-
In the previous part, we developed the below programs

Our Requirement is that we want to create a search help for our Employee Id.

Hints :-

Process on Value Request 1


Mob No :- +916261538504
We will use the concept of POV ( Process on Value Request ) to achieve this requirement .

Implementation :-
Step 1 :- We will go to screen 100 we will assign the event Process on value request.

Then we will use field statement to give the name of the field for which we want to
apply process on value request.

Step 2 :- Double click on the module and create it.

After that we can see we will have a F4 button enabled for our employee id.

Step 3 :- Now we are require to write the logic to fill this employee id value.

For that purpose, we use a function module F4IF_INT_TABLE_VALUE_REQUEST

Process on Value Request 2


Mob No :- +916261538504
Code :-
types : begin of ty_emp,
EMP_ID type ZAR_EMPLOYEE_ID,
end of ty_emp.

DATA : lt_emp type table of ty_emp.

Select emp_id from ZAR_EMPLOYEE_TAB


into table lt_emp.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'


EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'EMP_ID'
* PVALKEY = ' '
DYNPPROG = sy-repid
DYNPNR = sy-dynnr
DYNPROFIELD = 'LV_EMP_ID'
VALUE_ORG = 'S'
* STEPL = 0

tables
value_tab = lt_emp
EXCEPTIONS

Process on Value Request 3


Mob No :- +916261538504
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.

Testing :-
Execute the code and press F4 button on output screen for employee Id.

Process on Value Request 4


Mob No :- +916261538504
4️⃣
Process on Help Request

Whenever you click on a Field it shows us the technical information of that particular field.

In this part we will see how we can create a technical information for a particular field.

Requirement :-
In the previous part, we saw how we can create a F4 help for a particular field.

Our Requirement is to create a F1 help for the same field Employee Id.

Hints :-
In SAP We create a documentation through SE61 transaction code.

We use the function module HELP_OBJECT_SHOW.

Implementation :-
Step 1 :- Go to SE61 transaction code.

Step 2 :- For general documentation select General text for document class.

Step 3 :- Give a name for the document.

Process on Help Request 1


Mob No :- +916261538504
Step 4 :- Click on create button.

Step 5 :- Click on Go to → change editor.

Step 6 :- Give the documentation that you want.

Save the documentation.

Step 7 :- Go to the flow logic of screen 100 and write the event Process on help request and
give the field and a corresponding module.

Step 8 :- Double click on the given module and write the logic inside the module.

Process on Help Request 2


Mob No :- +916261538504
Code :-
MODULE help_request INPUT.

CALL FUNCTION 'HELP_OBJECT_SHOW'


EXPORTING
dokclass = 'TX'
* DOKLANGU = SY-LANGU
dokname = 'ZEMP'
* DOKTITLE = ' '
* CALLED_BY_PROGRAM = ' '
* CALLED_BY_DYNP = ' '
* CALLED_FOR_TAB = ' '
* CALLED_FOR_FIELD = ' '
* CALLED_FOR_TAB_FLD_BTCH_INPUT = ' '
* MSG_VAR_1 = ' '
* MSG_VAR_2 = ' '
* MSG_VAR_3 = ' '
* MSG_VAR_4 = ' '
* CALLED_BY_CUAPROG = ' '
* CALLED_BY_CUASTAT =
* SHORT_TEXT = ' '
* CLASSIC_SAPSCRIPT = ' '
* MES_PROGRAM_NAME = ' '
* MES_INCLUDE_NAME = ' '
* MES_LINE_NUMBER =
* MES_EXCEPTION = ' '
* TABLES
* LINKS =
EXCEPTIONS
OBJECT_NOT_FOUND = 1
SAPSCRIPT_ERROR = 2
OTHERS = 3
.

Process on Help Request 3


Mob No :- +916261538504
ENDMODULE.

Execute the code :-


Press F1 on Employee Id input field.

Process on Help Request 4


Mob No :- +916261538504

You might also like