133798929 Module Pool Programming

Post on 08-Nov-2014

94 views 9 download

Tags:

Transcript of 133798929 Module Pool Programming

*Module Pool

Programming* BY ----Arjun

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 2

Objective

Introduction:It is a special type of programming which is used to

create custom SAP Screen as per business requirement.

SE80 is the TCODE for creating MPP programs.Every MPP program must be executed with a

transaction.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 3

Events in MPP

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 4

Events in MPP

Events in Module Pool Programming

There are four events available.PBO (Process Before Output):Triggered before MPP screen is

displayed

PAI (Process After Input): Triggered after MPP screen is displayed whenever user raises an action.

Also,Now PBO is also triggered.

POV (Process On Value Request): Triggered when User Clicks on search help or F4 Button

POH (Process On Help Request): Triggered when User Clicks on search help or F4 Button

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 5

Execution Flow of MPP prg

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 6

Execution Flow of MPP prg:

PBO is triggered

User Enters input

Screen is displayed

PAI triggered

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 7

Modularization technique in MPP program

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 8

Modularization technique in MPP program

Include prg’s:

Basically there are four include programs which are created automatically for an MPP program

• <MPP name>_TOP top include program All data declarations.

• <MPP name>_o01PBO include program All logic related to PBO event

• <MPP name>_I01PAI include program All logic related to PAI event

• <MPP name>_F01Forms include program All logic related to subroutines

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 9

Screen

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 10

Screen

SCREEN: It is a visible layout which is displayed in the output. The components of the Screen are

Components of Screen: Attributes : Properties of screen Element List : List of UI/Library elements Flow-Logic : Abap logic related to MPP Layout : Screen Designing Area

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 11

FLOW-LOGIC

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 12

FLOW-LOGIC

It will contain the logic related to screen in the form of modules

By default, 2 events will be available with their corresponding modules as below:

Just uncomment the modules and create them and write the abap logic.

PROCESS BEFORE OUTPUT. *MODULE STATUS_0100.

PROCESS AFTER INPUT. *MODULE USER_COMMAND_0100.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 13

MODULE

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 14

MODULE

MODULE: It is an sub-program which contains the ABAP code for a

screen . Flow-Logic cannot understand ABAP statements. So the

entire ABAP code is written in the form of modules Since the entire abap logic is divided in the form of

modules, that is why it is called MODULE POOL PROGRAMMING

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 15

Simple program in MPP

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 16

STEPS TO CREATE AN MPP PROGRAM

STEPS: Go to SE80 Select program from dropdown list Give a name & press enter Click on YES Click on Continue Give a name for TOP include program Press ENTER The program will be created Uncomment each include program and create them Right click on the program nameACTIVATE

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 17

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 18

STEPS TO CREATE A SCREEN

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 19

STEPS TO CREATE A SCREEN

Creating a Screen: Right click on program nameCreateScreen Give the screen number as 0100 and Press ENTER Give the description Click on Flow-Logic Uncomment the modules and create them as below

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 20

STEPS TO CREATE A SCREEN

Click on Layout Button Drag and drop text UI element onto the screen Double click on it Provide the name and texts Name T1. Text ‘This is a sample Program’. Check the below screen shot

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 21

Click on FlowLogic Double click on PBO module And write the below code

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 22

STEPS TO CREATE A SCREEN

Module Set PF-STATUS ‘MENU100’. Set Title bar ‘TITLE01’.

End module Click on Save and Back Double click on PAI module

Write the below code

Module User-command-0100 input.

If sy-ucomm = ‘BACK’.

Leave to screen 0.

Endif.

End module.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 23

STEPS TO CREATE A SCREEN

Save and activate. Right click on Program name

create.Transaction.

Give the text, program name, screen number. Select all the checkboxes at the bottom. Save it. Execute the transaction and test the program.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 24

A Real time Ex on MPP

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 25

Business Req: Create a MPP which displays material details for a given material no

Create a MPP prg in SE80 and create all include programs

Create a Screen and create PBO and PAI Modules

Goto TOP Include prg and declare the following .

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 26

Save & Activate TOP Include prg immediately

Now goto Screen 0100 layout.

Click on Dictionary/Program fields ICON

Give the name as wa_mara

and click on

Select all fields and press enter

Place all the fields on the screen

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 27

Now Drag and drop text fields from library and place them before each input field .

Now Drag and drop a button also and provide the details as below:

Also provide FCT code as GET

Finally the screen should look as below.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 28

FCT CODE : It is a function code which is used to identify the button which is clicked

The FCTCODE is automatically stored in a system variable SY-UCOMM.

Now go to PAI module and write the below code.

Save,Activate,Test it.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 29

The output is : Enter the Material no

Click on GET button

The details should be displayed

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 30

Making Input Fields Disable

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 31

Making Input Fields Disable

Making Input Fields Disable: Double click on any input field

The properties screen is displayed

Set the property as below

Select program input not possible

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 32

Single Field Validation

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 33

Single Field Validation

It is Used to Validate a single field or particular field on MPP screen. It is similar to ‘AT SELECTION SCREEN ON FIELD’.

Syntax :-

Field <Field-name> Module <Module-Name>.

Example :-

Field V_matnr Module Validate_matnr.

Ex Prg:

Create a prg as below:

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 34

Write the below code under PAI event.

Double click and create the module .

Write the below code in the module

Save, activate and test it .

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 35

Multiple Field Validation

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 36

Multiple Field Validations

CHAIN---------ENDCHAIN is the Keyword which is used to validate multiple fields.

It is similar to AT SELECTION-SCREEN

CHAIN.

Field : <Field-Name1>,

<Field-Name2>,

<Field-Namen> .

Module <Module name>.

ENDCHAIN.

Ex Prg:

Create same prg as above:

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 37

Here I want to validate both MATNR and MTART fields.

Write the below code under PAI event.

Create the module and write the below code

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 38

Save, activate and test it .

The difference b/w single field and multiple field validation is :

Single field validation:

It is used to validate a single field.

Only that particular field which is validated is input enabled when there is an error.

The remaining fields will be input disabled.

With Multiple field validation:

It is used to validate multiple fields.

All the fields which are in between CHAIN..ENDCHAIN are input enabled when there is an error.

The remaining fields will be input disabled.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 39

USING CHECKBOX in MPP

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 40

USING CHECKBOX in MPP

Steps:- Create a program in se80.

Define the below data declarations in the Top include file.

Creating a Screen:

Create Screen 0100.

Create a PBO module and PAI module.

PROCESS BEFORE OUTPUT. MODULE STATUS_0100.

PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.

 

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 41

SCREEN LAYOUT Click on layout button.

Click on dictionary/program fields icon.

Give the field name as V_CH1.

Select radionutton as below

 

Place it on the screen. Click on dictionary/program fields icon again .

Give the field name V_TEXT  Place it on the layout

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 42

Dobule click on the check and set the below properties : NAME,TEXT,FCTCODE

Now go to PAI module and write the below code.

Save,Activate,Test it.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 43

USING RADIOBUTTON in MPP

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 44

RADIOBUTTON IN MPP

Steps:-

Create a program in se80.

Define the below data declarations in the Top include file.

DATA  : v_RB1(1) TYPE C VALUE 'X'.DATA  : V_RB2(1) TYPE C.DATA  : V_TEXT1(25) TYPE C.

Creating a Screen:

Create Screen 0100.

Create a PBO module and PAI module.

PROCESS BEFORE OUTPUT. MODULE STATUS_0100.

PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 45

SCREEN LAYOUT Click on layout button.

Click on dictionary/program fields icon.

Give the field name as *.

Select the following as below:

Place them on screen

Now Select two radiobuttonsRightclickRadiobuttonGroup Deine

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 46

Provide the properties as below or each radiobutton:

Write the below code in PAI Module.

Save activate and test

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 47

USING TABSTRIP in MPP

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 48

TABSTRIP

Tab strip’s are used to divide the main screen into sub screens to display mass amount of data.

Each sub screen is called as a TAB. Each sub screen Should be designed separately with a no. Each sub screen must have an area to display the sub screen called as Sub

screen area When you drag and drop the TABSTRIP from the library, two tabs will be

displayed by default For each tab create the sub screens and sub screen areas CONTROLS is the keyword used to declare a tab strip.

Ex: CONTROLS : TABSTR TYPE TABSTRIP. ACTIVETAB is the property to set a particular tab to be active.

EX: TABSTR-ACTIVETAB = ‘TAB1’ .

TABSTR-ACTIVETAB = ‘TAB2’ .

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 49

Finally use the below syntax under the PBO event to assign each sub screen no to its corresponding sub screen area

Syntax :-

Call subscreen <subscreen area >including <program name> <sub screen>.

Ex:-

Call subscreen SUBAREA1 including sy-repid 0200.

Call subscreen SUBAREA2 including sy-repid 0300.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 50

Syntax to declare tabstrip:-

CONTROLS<tabstrip mane >type tabstrip.

Ex :- controls TBSTR type tabstrip.

Active tab:- It is an option in the tab strip to activate the corresponding TAB.

Syntax:-

<tabstrip name >-active tab=‘TABNAME’.

Ex :- TBSTR-active tab =‘tab1’.

TBSTR-active tab =‘tab2’.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 51

Real Time Ex on TABSTRIP

BR: Develop a MPP prg which display material details and description details in 2 separate tabs.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 52

• STEPS:

• Create an MPP Prog

• Create a MAIN screen by no 1000

• Goto top include prg and declare a TBASTRIP and other data declarations as below

• Save activate immediately

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 53

Designing Screen

Goto screen 1000layout

Click on Dictionary/program fields icon

Give the fieldname as V_MATNR and click on GET FROM PROGRAM button

Place the field on layout

Provide the text lable for the field.

The screen should look as below.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 54

Drag and Drop tabstrip onto layout.

Double click on tabstrip (exactly at center) and set the name as TBSTR(name given in top include prog)

By default 2 tabs will be created.

Double click on TAB1, give the text as ‘GEN.DATA’,give the FCT code as TAB1.

Similarly, Double click on TAB2, give the text as ‘DESC.DATA’, give the FCT code as TAB2.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 55

Click on TAB1,Drag and drop a subscreen under TAB1

This is because each TAB should have a subscreen area to display subscreen

give the name as SUB1.

Similarly click on TAB2,Drag and drop a subscreen under TAB2 , give the name as SUB2.

Click on FLOW-LOGIC

Write the below code under PBO event. This is because we need to assign each sub screen no to its corresponding sub screen area

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 56

Write the below code under PAI event.

Create the GET_DATA module and write the below code

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 57

CREATING sub screens

Now create 2 sub screens by the numbers 0100 and 0200

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 58

Goto subscreen 0100

Click on layout button

Click on Dictionary/program fields icon

Give the fieldname as WA_MARA and click on GET FROM PROGRAM button

Select and Place all the fields on layout

Provide the text lable for all fields.

The screen should look as below.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 59

Now Goto subscreen 0200

Click on layout button

Click on Dictionary/program fields icon

Give the fieldname as WA_MAKT and click on GET FROM PROGRAM button

Select and Place all the fields on layout

Provide the text lable for all fields.

The screen should look as below.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 60

Finally write the below code to activate the tabs in PAI module.

SaveactivateTest it

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 61

GIVE MATERIAL NO AND PRESS ENTER

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 62

CLICK ON 2ND TAB.

CHECK THE DESCRIPTION DETAILS ALSO

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 63

Steps for tabstrip:-

STEPS: Create an mpp program. Declare TABSTRIP in top include program. Drag and drop tab strip on to the screen. By default, 2 tabs will be available Create subscreen areas for each TAB. Cerate subscreen for each TAB. Assign each subscreen to subscreen area under PBO event. Write code in PAI to activate tabs based on user action.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 64

USING TABLE CONTROL in MPP

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 65

TABLE CONTROL

o TABLE CONTROL : It is an element which is used to display the data in the form of a table format is called TABLE CONTROL.

There are 3 important points to be followed, when working with table control.

1. Table control declaration.

2. Loop at ITAB into WA with control <table control name>(IN PBO).

1. Endloop

3. Loop at ITAB (IN PAI).

1. Endloop.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 66

TABLE CONTROL

Table control declaration

Syntax :-

Controls : <table control> name type table view using screen <screen no>.

Loop at PBO

The loop at ITAB into WA…………end loop must be used in PBO event to read each record from ITAB internal table into work area and then work area to table control columns

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 67

TABLE CONTROL

Loop at PAI

The loop at ITAB into WA…………end loop must be used in PAI event to read each record from table control columns into internal table

PBO event

ITAB --------------WA----------------Table control.

Loop at ITAB into WA with control <table control name>

Endloop

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 68

TABLE CONTROL

PBO EVENT

PAI EVENT

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 69

TABLE CONTROL

PAI Event

Table Control ---------Internal Table ------------- Work area.

Loop at ITAB .

Endloop.

Vertical scrollbar : In Table control by default, we don’t get vertical scroll bar.

To display it, use the below syntax

<TABLECONTROLNAME>-LINES = <NO>

Horizontal & Vertical Lines : In Table control by default, we don’t get vertical and

Horizontal lines.

To display them, Set the below property.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 70

Ex on Table control

Busniess Req : Develop a MPP program which displays list of the material for a material type.

Steps:- Create a program in se80.

Define the below data declarations in the Top include file. 

Save & activate.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 71

SCREEN Create Screen 0100.

Write the below statement under the PBO event.

SCREEN LAYOUT Click on layout button.

Click on dictionary/program fields icon.

Give the field name as v_mtart.

Place it on the screen.

Provide a text(MATERIAL TYPE ) for the input field.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 72

Drag and drop a button & define the properties.

Name: GET

Text : GET DATA

Fctcode: GET

The screen should look as above

Drag and drop table control UI element on the screen.

Double click on it, set the properties as below.

Name = TBCL (same as top include file name)

Separators:-  

Vertical

Horizontal 

Click on the dictionary / program fields icon.

Give the field name as wa_mara.

Click on continue.

Place them on the table control UI element.

Each field will be displayed as column.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 73

Provide the column headings by drag & drop using text label. Click on text field, place it on the first column.

Give the name as T1, text as matnr. Repeat for all fields

Textfield1 Textfield2 Textfield3 Textfield4

Name :T1 Name :T2 Name :T3 Name :T4

TEXT: Matnr TEXT: mtart TEXT: mbrsh TEXT: meins

Click on the flow logic.

Double click on the PAI module, write the below code.

Save & activate.

Create a transaction & test it.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 74

TESTING

Execute the TCODE.

The output is as below:

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 75

Table Control With Modification

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 76

Table Control With Modification.

Create same program as below. Do the below changes

Declare a new Workarea and internal table as below:

Go to the screen layout, add a button by

name = save,

text = save data,

Fct code = save.

write the below logic under PAI Event

 

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 77

Double click on the module get_modified_recs.

Write the code as here

Double click on the PAI module & write the below code.

  IF SY-UCOMM = 'SAVE'.    MODIFY MARA FROM TABLE I_MARA2. "UPDATE DATABASE     IF SY-SUBRC = 0.      MESSAGE : 'THE DATA IS SUCCESSFULLY MODIFIED' TYPE 'I'.    ENDIF.

*********Move THE MODIFIED DATA BACK TO ORIGINAL ITAB(I_MARA)*********    REFRESH I_MARA.    LOOP AT I_MARA2 INTO WA_MARA2.      MOVE-CORRESPONDING WA_MARA2 TO WA_MARA.      APPEND WA_MARA TO I_MARA.    ENDLOOP.  ENDIF.

save , activate & test it.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 78

CALL SCREEN AND SET SCREEN

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 79

Navigation between Screens

o Whenever we want to move from one screen to another screen we use below two statements.

CALL SCREEN.SET SCREEN.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 80

CALL SCREEN

CALL SCREEN

This statement is used to call the new screen by suspending the current screen

Once the new screen processing is finished it will come back or resume back to the old screen and continuous its processing.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 81

SET SCREEN

SET SCREEN This statement will not call any new screen, but it will

set a new screen as a next screen Once the current screen is finished totally, then it will

call new screen Once the new screen is processed it will not come

back automatically to the previous screen If we want to came back, use the statement LEAVE TO SCREEN <SCREEN NO>.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 82

POV and POH EVENTS

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 83

USING POV,POH EVENTS

PROCESS ON VALUE REQUEST :

This event is triggered whenever the user clicks on search help button for an input field.

Syntax :-

PROCESS ON VALUE REQUEST.

FIELD <FIELD NAME> MODULE <MODULE NAME> .

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 84

PROCESS ON HELP REQUEST

PROCESS ON HELP REQUEST :

This event is triggered whenever the user clicks on F1(Help Button).

Syntax : -

PROCESS ON HELP REQUEST.

FIELD <FIELD NAME> MODULE <MODULE NAME> .

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 85

Ex on POV Event:

→ create a MPP programe

→ create a screen 0100.

→ Declare a below STMT in top include file.

Data : v_file type RLGRAP-filename.

→ save , active.

→ Go to screen 0100 layout.

→ Place an input field & text field on screen as below.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 86

→ click on flow logic.

→ Write the below code.

PROCESS ON VALUE-REQUEST . FIELD V_FILE MODULE GET_F4 .

Create the module and write the below code:

MODULE GET_F4 INPUT.CALL FUNCTION 'KD_GET_FILENAME_ON_F4' EXPORTING   PROGRAM_NAME        = SYST-REPID   DYNPRO_NUMBER       = SYST-DYNNR   FIELD_NAME          = 'V_FILE'  CHANGING    FILE_NAME           = V_FILE .ENDMODULE.                 " GET_F4  INPUT

→ Save , Active & Text it.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 87

The output is :

Click on F4 button and below is the screen

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 88

Ex on POV Event:

Same prg as above…but just write the below event in screen 100

Flowlogic

Process on Help-Request

Field V_File module GET_F1.

→ create the module and write the below code in the module.

Module GET_F1 INPUT.

Message ‘please select file name’ type ‘I’.

Endmodule.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 89

MANDATORY FIELDS ON MPP SCREEN

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 90

MANDATORY FIELDS ON MPP SCREEN

Mandatory fields steps:

→ Double click on the field where you want to set mandatory parameter.

→ Go to the ‘program’ tab,

set as Input = Required.

→ Save , Active & Test it.

Note: If we don’t enter any value on mandatory field and click on the back button system will throw an error message

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 91

Ignoring the Mandatory fields:-

o If we want to ignore or exit an MPP screen without entering the mandatory fields, then please follow the below steps.

→ Create or Activate ‘EXIT’ button in the ‘ SET PF-STATUS’

with fctcode as EXIT

→ Double click on the Exit button set the function type = ‘E’

Where E stands for Exit command.

→Then we need to create a separate module in the PAI event for this ‘ EXIT’ command

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 92

Syntax:- Module xxx at Exit Command.

→ Click on the flow logic & write the below code.

PROCESS AFTER INPUT.Module module_EXIT AT EXIT-Command.

→ Create the module and write the below code.

Module module_EXIT Input.

Case sy-ucomm.

When ‘EXIT’.

Leave program.

Endcase

Endmodule.

→ Save, Active & Text it.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 93

ASSIGNING SEARCH HELP’S FOR INPUT FIELD

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 94

ASSIGNING SEARCH HELP’S FOR INPUT FIELD

If we want to assign a search help to an input field, double click on it.

1. Goto dictionary tab.

2. Set the property Search help = ‘xxxx’.

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 95

TYPES OF SCREENS

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 96

TYPES OF SCREENS

There are basically Three types of screensNORMAL SCREEN : A main screen with minimize,

maximize and close buttons is called a NORMAL SCREEN

SUBSCREEN : A part of screen with in a main screen is called a SUBSCREEN.

Generally subscreens are used in TABSTRIPS.

MODEL DIALOG BOX : A screen with only close button is called MODEL DIALOG BOX.

Generally this screen is used to display POP-UP’s

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 97

INTERVIEW QUESTIONS

What are the various events available in MPP, explain with example?

What are the various include programs in MPP? What do you write in the Flow-Logic ? What is a MODULE? How do you create a transaction? What is the system variable where FCT code is stored? How do you disable an input field? How do you validate a single field? How do you validate a multiple fields? What is the exact diff b/w single field& multiple fields

validation?

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 98

INTERVIEW QUESTIONS

What is the use of sub-screen area? What is a table control? What is the use of loop at itab into PBO and PAI? Tell me about table control with modifications? How do you vertical scroll bar in table control? What is the difference between call screen and set screen? How do you create mandatory fields? How do you exit an MPP screen without entering the

mandatory fields? How do you assign a search help? What are the various types of screens and explain each?

SAP AG 2001, Smart Forms - the Form Printing Solution,Claudia Binder / Jens Stumpe 99

.THANK YOU