MODULE POOL

Embed Size (px)

DESCRIPTION

MODULE POOL

Text of MODULE POOL

AB1011-Module pool Programmingv1.0

India SAP CoE, Slide 1

Module pool programming1 2 3 4 5India SAP CoE, Slide 2

Introduction Syntax Description Demonstration Exercises HelpMe

Module Pool program.Module Pool Program (also called Online programs , dialog programs, or transactions) do not produces lists. These programs are a collection of screens, their Flow Logic, and the code within the main ABAP program.

A dialog program offers: A user-friendly user interface Format and consistency checks for the data entered by the user Easy correction of input errors Access to data by storing it in the database.

India SAP CoE, Slide 3

PurposeFor performing any kind of task in SAP R/3 system, a transaction is used. SAP provides a standard set of transactions to manipulate data in the system. But sometimes, the need to create a customer specific transaction arise due to following reasons : Standard SAP may not support that task. A particular transaction needs to be customized to suit the customer requirements . A transaction (also called module pool programs, dialog programs) is defined as a collection of screens (the actual, physical image that the users sees), their Flow Logic (code behind the screens ), and the code within the main ABAP program.

India SAP CoE, Slide 4

Creating an Online ProgramOnline program name must begin with either a Y or Z.

Program AttributesWith TOP INCL. should be checked. Go back to Repository Browser, not source code.

Title Type M Application

India SAP CoE, Slide 5

Module Pool Program ComponentsABAPTop Include

PBO Modules

PAI Modules SubroutinesIndia SAP CoE, Slide 6

Module Pool Program An online program consists not only of the screens and their Flow Logic, but also ABAP program components: Global data, PBO modules, PAI modules, and subroutines. Global data: It is declared in the Top Include program. PBO and PAI modules: It contain the main processing logic of online program and are called from within the Flow Logic of the screens. The subroutines (if necessary) are in a separate include program.

India SAP CoE, Slide 7

Executing an Online Program

F8Transaction Code

Transaction Text

Program Name

Initial Screen

requiredIndia SAP CoE, Slide 8

required

required

Module pool programming1 2 3 4 5India SAP CoE, Slide 9

Introduction Syntax description Demonstration Exercises HelpMe

Tools used:When creating an module pool program, you will use many tools within the ABAP Development Workbench: Screen Painter, ABAP Editor, Menu Painter, ABAP Dictionary, and Repository Browser. ABAP Editor (SE38) To maintain main ABAP program. Program contains data declarations and modules.IBM Global Services

Developing Online Program sScreen Painter Repository Browser ABAP Editor

M enu Painter ABAP Dictionary

Slide 2

O nline Program ing | 2.01 m

| August -2003

Copyright IBM Corporation 2003

India SAP CoE, Slide 10

Tools used:Screen Painter(SE51) used to maintain components of screen. Menu Painter(SE41) Used to design GUI. Maintain Transaction(SE93) To create transaction code for program. Object Navigator (Repository Browser)(SE80) - You should always use the object navigator for online programs because you will be able to see the hierarchy. From this hierarchy list, you will be able to branch to the Screen Painter, ABAP Editor, Menu Painter, and ABAP Dictionary. You should always use the Repository Browser to create online programs because the system will automatically maintain an online programs subobjects and you will be able to see the hierarchy list of these sub-objects. From this hierarchy list, you will be able to branch to the Screen Painter, ABAP Editor, Menu Painter, and ABAP Dictionary.

India SAP CoE, Slide 11

Creating a Program Create a program using transaction SE38. Program name as Z_MODULE_TRAINING. Program type should be Module Pool. Save and activate the program.

Use object navigator(SE80) to further develop the object.

India SAP CoE, Slide 12

Program Structure Module pool program when viewed from SE80 transaction will have structure as below,

India SAP CoE, Slide 13

Assigning transaction code Dialog program is executed using transaction code. We can not execute this like normal report using execute or pressing F8 button. Transaction is created using SE93 transaction or from object browser by right clicking on transaction, click on create. Give name and description and select the radio button Program and screen (dialog transaction)

India SAP CoE, Slide 14

Use of Screen Screen is a interface between user and SAP. Using screen user can provide input to program and in turn program will display result on screen. Screen is made up of screen elements such as text box, input/output field, check box, radio button etc. One of the strength is that screen elements are combined with the ABAP dictionary to allow check the consistency of the data that user has entered.

India SAP CoE, Slide 15

Screen Painter To start the Screen Painter, choose the corresponding pushbutton on the initial screen of the ABAP Workbench or enter Transaction SE51. Best practice is to go to transaction SE80, enter program name and you can perform one of the below, 1. Create new screens. 2. Test an existing screen. 3. Create new components for an existing screen. Screen is always created for an existing program.

India SAP CoE, Slide 16

Overview of Screen PainterScreen PainterScreen Attributes

Screen Layout

Flow Logic

Field Attributes

India SAP CoE, Slide 17

Developing Screen From Object navigator (SE80) we can create the screen as shown, Click on Screen, right click and select create option. Now enter screen number.

India SAP CoE, Slide 18

Developing ScreenScreen numbers can be up to 4 characters long, all of which must be digits. The number 1000 is reserved for table screens and report selection screen. Screen numbers from 9000 are reserved for customer-specific screens. The use of screen numbers is namespace-dependent. For screens in programs in the SAP namespace, numbers less than 9000 are reserved for SAP screens, numbers between 9000 and 9500 are reserved for SAP partners, and numbers greater than 9500 are for customers.

India SAP CoE, Slide 19

Developing Screen For screens in programs in the Customize namespace, any four digit number can be used as screen number except 1000 as mentioned above. Usual practice is to have screen numbers for customize module pool program, starting with 100 then continue as 200, 300 etc. Enter screen number and click on create.

India SAP CoE, Slide 20

Developing ScreenEnter description and save. Check the screen and activate it.

India SAP CoE, Slide 21

Screen Attributes Short description Describes screen purpose Original language Default logon language Package Identifies the package with which screen is saved Last changed on/by Date & time screen is last changed Last generation Date & time screen is last generated.

India SAP CoE, Slide 22

Screen AttributesScreen Type Normal Default setting Subscreen To indicate the screen as a subscreen Modal dialog box used to display details in a dialog box. Used for data input, confirmation/error/help messages. Selection screen Identifies selection screen. The system sets this attribute automatically.

Settings Hold data On checking this, system can hold entries made on the screen at runtime. System automatically displays this data if the user calls the particular screen again.

India SAP CoE, Slide 23

Screen AttributesSettings Switch off runtime compress On setting this option, the screen is not compressed at runtime. Template non executable This attribute is primarily for internal use by SAP. Hold scroll position On setting the attribute, the scroll position is retained when the user returns to the screen after processing another screen. Without application tool bar To suppress the display of the application toolbar belonging to the current program status.

Other Attributes Next Screen Next screen number to be displayed.

India SAP CoE, Slide 24

Screen AttributesOther Attributes Cursor position Identifies the screen element that contains the cursor when a screen is first displayed. If you leave this field blank, the system uses the first screen field that can accept input. Screen group Specifies a four-character identifier of a group of associated screens. Line/Columns Occupied Specifies the size of the screen area currently occupied with screen elements Maintained Size of the screen in rows/columns. Context menu It will hold a routine name required to set up the context menu in the program. This routine connects the screen (elements) from the Screen Painter to the context menu of the program.

India SAP CoE, Slide 25

Screen Layout ModeThe Screen Painter has a layout editor that you use to design your screen layout. It works in two modes: Graphical mode Drag and drop interface is used, similar to a drawing tool. Alphanumeric mode Keyboard and menus are used for designing.

Both modes offer the same functions but use different interfaces. Graphical mode of screen designing is commonly used.

India SAP CoE, Slide 26

Screen Designing We have learnt about creating a screen. To start screen design, click on layout button on Graphical Screen painter will start loading. screen.

India SAP CoE, Slide 27

Components of Layout Editor Element palette Used for creating screen elements. These can be drag & dropped on