0% found this document useful (0 votes)
123 views

Simple Module Pool

This document provides instructions for creating a simple ABAP module pool program to display records from table MARA on a secondary screen. It describes how to create the module pool program and screen painter programs, define fields and buttons, and code the program logic and screen flows to display selected records and return to the main screen. The module pool program accesses MARA table data and uses screen flows and button commands to display records on a secondary screen and return to the initial screen.

Uploaded by

ssvallabhaneni
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views

Simple Module Pool

This document provides instructions for creating a simple ABAP module pool program to display records from table MARA on a secondary screen. It describes how to create the module pool program and screen painter programs, define fields and buttons, and code the program logic and screen flows to display selected records and return to the main screen. The module pool program accesses MARA table data and uses screen flows and button commands to display records on a secondary screen and return to the initial screen.

Uploaded by

ssvallabhaneni
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 9

This simple module program is to display the records from mara with selected fields on the another screen.

To perform this we can create a module pool program. Open SE 38 transaction to create a program name and here program name is ysimplemodule . Select the Type : Module Pool and save it .

Here in this module pool programs we can use PARAMETER statements. Here we declared the Tables statement and an variable to retrieve the data from mara .
*&---------------------------------------------------------------------* *& Module pool YSIMPLEMODULE *& * *&---------------------------------------------------------------------* *& * *& * *&---------------------------------------------------------------------* PROGRAM YSIMPLEMODULE tables : mara . data : v_matnr like mara-matnr . . *

Activate it and Go to transaction code SE 51 and name the screen painter name similar to module pool program name and enter the screen which should be unique to this program.

Enter the short description and save it and press the LAYOUT button to get into Graphical screen editor. Click on Dictionary/Program fields icon which is located on Standard tool. Enter the Field name: V_matnr and click on Get from program button . And place the fields on the Layout editor screen and place the push buttons for example here one push button named DISPLAY and EXIT. Display Push button is to display the selected fields records on to the next screen and Exit button it is to terminate from program. Here double click on Display push button to get into properties and assign the FctCode: DISP and for Exit push button properties FctCode: EXIT.

And save the screen and click on Flow logic to get into coding form Process Before vents and Process after Input events. Double click on user command _100 which is in PAI event in order to enter the code for push buttons and which will get in to SE 38 module pool program.

Click Yes to get into SE 38 screen .

Select the main include to enter into SE38 program .

*&---------------------------------------------------------------------* *& Module USER_COMMAND_0100 INPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE user_command_0100 INPUT. CASE sy-ucomm . WHEN 'DISP'. SELECT SINGLE * FROM mara INTO mara WHERE matnr = v_matnr . LEAVE TO SCREEN 200 . WHEN 'EXIT' . LEAVE TO SCREEN 0 . ENDCASE .

And get back to SE51 screen painter program to create second screen with screen number: 200 in order to place the fields from mara to the screen.

Click on Layout editor and click on dictionary/Program fields and in it enter the table name: Mara and click on Get from Dict. And place the fields on the screen painter. Place a Push button for moving back to main screen number: 100 .

Save and Activate it and double click on USER_COMMAND_002 and enter the code for BACK option.
*&---------------------------------------------------------------------* *& Module USER_COMMAND_0200 INPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE user_command_0200 INPUT. CASE sy-ucomm . WHEN 'BACK' . LEAVE TO SCREEN 100. encase . ENDMODULE. " USER_COMMAND_0200 INPUT

Make sure save and activate all the screen painter and SE38 program and created a Transaction code for the module pool program as we can not execute the module pool program directly. To create own transaction code go to T-code SE 93 and enter the program name and screen number to be executed first. And enter in command field the created t-code to run the program successfully.

You might also like