chapter 16_screen modifications and screen flow events

Upload: raul-thomas

Post on 03-Jun-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    1/15

    IBM Global Services

    2005 IBM CorporationScreen Modifications and ScreenFlow Events | 6.16

    March-2005

    Screen Modifications and Screen Flow Events

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    2/15

    IBM Global Services

    2005 IBM Corporation2 March-2005Screen Modifications and Screen Flow Events | 6.16

    Objectives

    The participants will be able to:

    Recognize Dynamic screen modification.

    Use a mirror image table work area to avoid updating a record that did not change.

    Code the PROCESS ON HELP-REQUEST Flow Logic event.

    Code the PROCESS ON VALUE-REQUEST Flow Logic event.

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    3/15

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    4/15

    IBM Global Services

    2005 IBM Corporation4 March-2005Screen Modifications and Screen Flow Events | 6.16

    Dynamic Screen Modification (2)

    PROCESS BEFORE OUTPUT.

    MODULE INITIALIZE.

    MODULE MODIFY_SCREEN.

    Screen 9001

    ** MZA11O01 - PBO Modules **

    MODULE MODIFY_SCREEN OUTPUT.

    * to change to display mode

    LOOP AT SCREEN.

    IF SCREEN-NAME = YMOVIE-

    WINNER OR

    SCREEN-NAME = YMOVIE-

    NOTES.

    SCREEN-INPUT = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDMODULE.

    You mustuse a PBO module to

    dynamically modify a screen.

    Dont forget to update the

    changes to the SCREEN

    internal table.

    Turn the input attribute

    off for display mode.

    Use the systems SCREEN

    internal table.

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    5/15

    IBM Global Services

    2005 IBM Corporation5 March-2005Screen Modifications and Screen Flow Events | 6.16

    Dynamic Screen Modification (3)

    Each field on a

    screen has a set of

    attributes that are

    fixed when you

    define the screen in

    the Screen Painter.When an ABAP

    program is running,

    a subset of the

    attributes of each

    screen field can be

    addressed using thesystem table

    SCREEN.

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    6/15

    IBM Global Services

    2005 IBM Corporation6 March-2005Screen Modifications and Screen Flow Events | 6.16

    Mirror Image

    ** MZA12TOP - Top Include **

    PROGRAM SAPMZA12 MESSAGE-ID

    ZA.

    TABLES: YMOVIE, *YMOVIE .

    Academy Awards

    YearCategory

    1994PIC

    Winner Forrest Gump

    Notes Great movie !!!

    Critic Ellen

    UpdateExit

    Enter Name

    Change / DisplayTo avoid updating a record that did not

    change, we can use a mirror image

    of the YMOVIE table work area.

    Currently, if the user clicks on the

    Update pushbutton, our program will

    update the record even if the user did

    notmake any changes to it.

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    7/15

    IBM Global Services

    2005 IBM Corporation7 March-2005Screen Modifications and Screen Flow Events | 6.16

    Mirror Image Example

    ** MZA12I01 - PAI Modules **

    MODULE SELECT_LISTING INPUT.

    IF OKCODE = EDIT.

    * code to select YMOVIE record

    IF SY-SUBRC = 0.

    MOVE YMOVIE TO *YMOVIE.

    ENDIF.

    ENDIF.

    ENDMODULE.

    ** MZA12I01 - PAI Modules **

    MODULE UPDATE INPUT.

    IF OKCODE = UPDA.

    IF YMOVIE = *YMOVIE.

    MESSAGE S005.

    ELSE.

    * code to update YMOVIE

    ENDIF.

    ENDIF.

    ENDMODULE.

    If a record is selected, it will

    be placed in the mirror image

    table work area.

    If the record has not changed,

    a message will be issued and the

    record will not be updated.

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    8/15

    IBM Global Services

    2005 IBM Corporation8 March-2005Screen Modifications and Screen Flow Events | 6.16

    PROCESS BEFORE OUTPUT.

    . . .

    PROCESS AFTER INPUT.

    . . .

    PROCESS ON HELP-REQUEST.

    FIELD YMOVIE-AAYEAR WITH 0001.

    Screen 9000

    Process on Help-Request

    Academy Awards

    Year

    Category

    1994

    PIC

    F1

    Trigger PROCESS ON HELP-REQUEST Flow Logic

    event for the particular field. This event will display

    the specified supplemental documentation (i.e., 0001).

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    9/15

    IBM Global Services

    2005 IBM Corporation9 March-2005Screen Modifications and Screen Flow Events | 6.16

    PROCESS BEFORE OUTPUT.

    . . .

    PROCESS AFTER INPUT.

    . . .

    PROCESS ON HELP-REQUEST.

    FIELD YMOVIE-AAYEAR WITH 0001.

    Screen 9000

    Process on Help-Request (Contd.)

    Academy Awards

    Year

    Category

    1994

    PIC

    F1

    Trigger PROCESS ON HELP-REQUEST Flow Logic

    event for the particular field. This event will display

    the specified supplemental documentation (i.e., 0001).

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    10/15

    IBM Global Services

    2005 IBM Corporation10 March-2005Screen Modifications and Screen Flow Events | 6.16

    F4

    Process on Value-Request

    PROCESS BEFORE OUTPUT.

    . . .

    PROCESS AFTER INPUT.

    . . .

    PROCESS ON VALUE-REQUEST.

    FIELD YMOVIE-AAYEAR

    MODULE VALUE_LIST.

    Screen 9000

    Academy Awards

    Year

    Category

    1994

    PIC

    Trigger PROCESS ON VALUE-REQUEST Flow Logic event

    for the particular field. This event will execute the specified

    module (i.e., VALUE_LIST).

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    11/15

    IBM Global Services

    2005 IBM Corporation11 March-2005Screen Modifications and Screen Flow Events | 6.16

    Process on Value-Request (Contd.)

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    12/15

    IBM Global Services

    2005 IBM Corporation12 March-2005Screen Modifications and Screen Flow Events | 6.16

    Demonstration

    Creating a module pool program and coding the Process on Help-Request andthe Process on Value-Request events in the program to display F1 and the F4

    helps.

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    13/15

    IBM Global Services

    2005 IBM Corporation13 March-2005Screen Modifications and Screen Flow Events | 6.16

    Practice

    Creating a module pool program and coding the Process on Help-Request andthe Process on Value-Request events in the program to display F1 and the F4

    helps.

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    14/15

    IBM Global Services

    2005 IBM Corporation14 March-2005Screen Modifications and Screen Flow Events | 6.16

    Summary

    You can dynamically modify a screen. More specifically, screen field attributescan be temporarily modified during the execution of an online program.

    To dynamically modify field attributes, use the SCREEN internal table

    maintained by the system for each screen.

    A mirror image is created with the ABAP statement: TABLES *. The work area created with this statement is identical in structure to theone created with the TABLES statement.

    The Process on Help-Request event is triggered when the user presses the F1

    key.

    The Process on Value-Request event is triggered when the user presses the F4

    key.

  • 8/12/2019 Chapter 16_Screen Modifications and Screen Flow Events

    15/15

    IBM Global Services

    2005 IBM Corporation15 March-2005Screen Modifications and Screen Flow Events | 6.16

    Questions

    What is the event required for displaying F1 help ?

    What is the event required for displaying F4 help ?

    What is the system internal table required to be modified for dynamic screen

    modifications ?