Monday, December 20, 2010
Tool
Screen Painter – SE51
Screen Painter Modes
  • Graphical mode: Provides a user-friendly environment for designing screens.
  • Alphanumeric mode: Provides a user-friendly environment for designing screens on all platforms.
Screen Components
  1. Screen Attributes (program, screen no, screen type, next screen, screen group etc.
  2. Screen Elements (Text fields, I/O fields, dropdown, check box, radio, pushbutton, box, sub screen, table controls, tabstrip controls, custom control)
  3. Screen Fields
  4. Screen Flow Logic(events: PBO, PAI, POV, POH)
Screen Types
It has 4 types

  • Normal
  • Subscreen
  • Model dialog box
  • Selection-screen

Screen flow Logic
It has 4 event blocks

  • PBO (Process Before Output): It is triggered after the PAI processing of the previous screen and before the current screen is displayed.
  • PAI (Process After Input): It is triggered when the user chooses a function on the screen.
  • POV (Process On Value-request): It is triggered when the user requests possible values (F4) help.
  • POH (Process On Help-request): It is triggered when the user requests field help (F1).

FIELD statement
Data is passed from screen fields to ABAP fields with the same names once in each dialog step.
FIELD <f>.
Data is not transported from screen field <f> into ABAP field <f> until the FIELD statement is processed.
CHAIN-ENDCHAIN Statement
CHAIN.
   Field : <f1>, <f2>, <f3>.
   Module <mod1>.
   Field : <g1>, <g2>, <g3>.
   Module <mod2>.
 ENDCHAIN.
All of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again.

PAI Modules for Type E functions
When the user chooses a function with type E, the screen flow logic jumps directly to the following statement:
MODULE <mod> AT EXIT-COMMAND.
Regardless of where it occurs in the screen flow logic, this statement is executed immediately, and before the automatic checks for the field contents on the screen.

You should therefore program it to contain an appropriate variant of the LEAVE statement, to leave the current screen, the call chain, or the entire program, as appropriate
Why OK_CODE in module pool program?
We should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this:
  1. The ABAP program has full control over fields declared within it.
  2. We should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:

 In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, We must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.

In your application programs, the first step in PAI processing should be to save the function code in an auxiliary variable and then initialize the OK_CODE field. You can then read the function code from the auxiliary variable (for example, using a CASE structure), and control the program flow from there.
TABLE CONTROL handling in Dialog programming
  1. Define the table control area.
  2. Define the table control elements.
  3. Add a title (optional).
  4. Declare the table control in module pool.
      CONTROLS <tab_ctrl> TYPE TABLEVIEW USING SCREEN <scr_no>.
  1. Write LOOP statement in screen flow logic.
      PBO
      LOOP AT itab WITH CONTROL <tab_ctrl>.
      ENDLOOP.
            PAI
            LOOP AT itab.
             MODULE read_table_control.
            ENDLOOP.
Subscreens in Dialog programming
  • Define the subscreen area(s) on a screen
  • Define suitable subscreen screens
  • Include the subscreen screen in the subscreen area.
In PBO
      CALL SUBSCREEN <area> INCLUDING <prog> <dynp>.
      In PAI
      CALL SUBSCREEN <area>.
Tabstrips in Dialog programming
  • Define the tab area on a screen and the tab titles.
  • Assign a subscreen area to each tab title.
  • Program the screen flow logic.
PROCESS BEFORE OUTPUT.
  CALL SUBSCREEN:
                   <area1> INCLUDING [<prog 1>] <dynp 1>,
                  <area2> INCLUDING [<prog 2>] <dynp 2>,
                  <area3> INCLUDING [<prog 3>] <dynp 3>.
PROCESS AFTER INPUT.
  CALL SUBSCREEN:
                                      <area1>,
                                      <area2>,
                                      <area3>.
  • Program the ABAP processing logic.
      CONTROLS MYTABSTRIP TYPE TABSTRIP.

  •  
F4 Help in Dialog modules
  • Use event PROCESS ON VALUE-REQUEST.
  • Call module to write F4 logic.
  • Use function module F4IF_INT_TABLE_VALUE_REQUEST.
F1 Help on screen field.
  • Use event PROCESS ON HELP-REQUEST.
  • Call module to write F1 logic.
  • Use function module HELP_OJECT_SHOW.
Dropdown boxes for field
  • To make an input/output field into a list box, you must set the value L or LISTBOX in the Dropdown attribute in the Screen Painter.
  • Set function code for the field, if you want to trigger PAI event when value is selected.
  • Use function VRM_SET_VALUES to pass values to the list box or dropdown box.



0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.