Anda di halaman 1dari 16

Module Programming Overview

Introduction
Collection of ABAP language entities that drive a transaction. Allows user interaction

Define Module Pool Program


Creating a module pool program
Enter the Module Pool name in the Program name and Click Create This is similar to creating an ordinary report except that the program type should be M ( Module Pool )

Define Module Pool

Define Module Pool

Components of program
Processing logic Screens Flow logic

Creating the screens


Screens have to be created in the screen painter (Workbench Tool ) TCODE : SE51 (Screen Painter)

A module pool program can have more than One screen attached to it. The type of screens are Normal, Sub screen, Dialog box ( flow logic )

Creating Screens

Flow logic
Flow Logic Events Flow logic describes how the program reacts to the user interactions Process before output (PBO) Process after input (PAI) Process on value request (POV) Process on help request (POH) Flow logic of a screen drives the processing sequence for that particular screen

Process Before Output (PBO)


Generally used to initialize screen fields

Flow logic PROCESS BEFORE OUTPUT. MODULE init_request. Processing logic MODULE init_request OUTPUT. SET PF-STATUS STA. ENDMODULE.

Menu Painter
PF-STATUS ( Menu Painter ) TCODE: SE 41 The GUI Status of the screen can be set by the command SET PF-STATUS <name of the status> Different GUI statuses can refer to common components A program can have many GUI statuses and titles

Adding menu
The code is stored in the sy-ucomm (system field) of AT USER-COMMAND event

Process After Input (PAI)


Processed after User interactions either function, a pushbutton or a function key

Flow logic PROCESS AFTER INPUT. MODULE user_command. Processing logic MODULE user_command INPUT. CASE ok_code. WHEN BACK. LEAVE TO SCREEN 0. .. ENDCASE ENDMODULE

Ok_code
Type C of length 4 (declared in the processing logic) The name should be specified in the field list of the screen (OK) Stores the function code of the button selected in the screen during the runtime of the program (The function code is specified in the attributes of the buttons while creating a screen)

Thank You

Anda mungkin juga menyukai