Lecture10 abap on line
Upcoming SlideShare
Loading in...5
×
 

Lecture10 abap on line

on

  • 1,635 views

 

Statistics

Views

Total Views
1,635
Views on SlideShare
1,635
Embed Views
0

Actions

Likes
2
Downloads
103
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • The window statement You can display a secondary list in a window instead of the full screen by using the window statement. The above WINDOW statement causes the secondary list to be displayed in a modal dialog box ( window ) . You specify the window coordinates (top left and bottom right corners) using STARTING AT and ENDING AT . The sequence is column specification before line specification. The window frame is created automatically. The ENDING parameter is optional . The output (by write) following the WINDOW statement appears in the window. Since a window is nothing but a secondary list within a frame, the system supports all list processing functions (scrolling, hiding field contents [HIDE], line selection).
  • The window statement Explain above example – refer to on-line example
  • Using a GUI Status This program uses a status called “ TEST ” This status has been set up with 2 buttons on the Application Toolbar . When a button is pressed, the text “ Test List 1 ” or “ Test List 2 ” is written on a secondary list . What would happen if you pressed TST1 3 times and TST2 3 times . Could you go back to the original screen containing “Basic List”? >>> Yes By pressing BACK 6 times
  • Defining a Status To define the status (GUI status) of a user interface you use the MENU PAINTER . The Menu Painter is one of the tools of the ABAP Development Workbench. The status name can be up to 20 characters . Status name must be CAPITALS . Defining and then setting a GUI status allows the user to use the functions (toolbar buttons, function keys, menu items) defined in the status. The status type describes the technical attributes of the status. Choose Normal Screen status if you want use the status with a screen in fullscreen mode , and dialog box , if you are going to use it with a window. Context menus are special menus that you can attach to the right-hand mouse button. When you create or change a status, you must ACTIVATE it before the changes become visible.
  • SET PF-STATUS SPACE will reset the status to SAP’s standard settings, that is, delete any buttons etc. set by a previous pf-status.
  • When you create and set a new status, the STANDARD toolbar is disabled and you may not be able to get BACK to previous screen. SOLUTIONS Enter transaction code SE38 to exit current screen and go to the ABAP Editor. Set the FUNCTION CODES into the STANDARD toolbar in the MENU PAINTER (expand Function Keys option in Menu Painter to see STANDARD toolbar) Use FUNCTION CODE OR In the MENU PAINTER you can add a default STANDARD toolbar by using pull-down menus: Extras  Adjust Template  Select “List Status” option .
  • Applying a Status The currently active status is stored in the system variable SY-PFKEY . You can control the output of page headers in the TOP-OF-PAGE DURING LINE-SELECTION processing block using SY-PFKEY .
  • Defining Titles for Interactive Reports By default the system uses the program title as the title of list The title, once set, is active for all list until another is set using SET TITLEBAR.
  • Defining Titles for Interactive Reports What would happen if the user clicks on “Click again” >> Title would change to ‘Title for Secondary List 2’ A problem may occur where you define a title but it does not appear when the program executes. Normally one should activate the title. In SAPPHIRE (4.6b) there was an “activate” button in the window where you define the title. This does not occur with Enterprise (see above screen). There are two ways I have found to overcome the problem. 1. There is a button on the title definition window labelled “All title”. Click this, then click on the title in the next screen and press the activate button on the application toolbar. 2. Use the Object Navigator. List the program objects, expand the GUI Title folder, click on the title name, right-click and select activate.

Lecture10 abap on line Lecture10 abap on line Presentation Transcript

  • Lecture 10 Reporting – Interactive (B) BCO5647 Applications Programming Techniques (ABAP)
  • Readings & Objectives
    • Readings
    • Keller & Keller Chapter 7 Section 7.3.6 & 7.3.7
    • Objectives This lecture will
    • Introduce the WINDOW Statement and its application in interactive reporting
    • Introduce the concept of user interfaces and their customisation
    • Examine the GUI status and how it is defined using the MENU PAINTER in the ABAP Development Workbench
    • Introduce the AT USER COMMAND and examine how it is used in interactive reports
    • Examine how titles are defined for interactive reports
  • The Window Statement
      • You can display a secondary list in a window (modal dialog box) instead of the full screen by using the window statement.
  • The Windows Statement
    • Example
    • report ylec700.
    • start-of-selection.
    • write ‘Double-click line for
    • demonstration of windows’.
    • at line-selection.
    • if sy-lsind = 1.
    • window starting at 5 3
    • ending at 40 10.
    • write ‘Double-click line for a second window’.
    • elseif sy-lsind = 2.
    • window starting at 45 10
    • ending at 60 12.
    • write ‘Second window’.
    • endif.
  • User Interfaces
    • A user interface consists of the following:
        • A title bar containing the title of the screen.
        • A menu bar with drop-down menus.
        • A standard toolbar containing icons for those functions most often used.
        • A application toolbar containing icons and pushbuttons for functions used on the current screen.
        • Function key settings , which can be displayed by clicking your right mouse button.
    • These objects can be customised in ABAP by using:
        • SET TITLEBAR <n> to set a title
        • SET PF-STATUS <n> to customise the menu bar, toolbars and/or function key settings
  • Using a GUI Status
      • You can define a GUI Status to add menu entries, toolbar buttons and/or function key settings.
      • Each menu function, push button, or function key has an associated function code.
      • When you create a status, you can define menu entries, toolbar buttons and/or function key settings and then LINK them to FUNCTION CODES you define.
      • When the user presses a function key, menu item or toolbar button, the event AT USER COMMAND occurs and the associated function code is stored in the system variable SY-UCOMM.
  • Using A GUI Status
    • Simple Example: report lec701. start-of-selection. set pf-status ‘TEST’. write: / ‘Basic List’. at user-command. case sy-ucomm.
    • when ‘TST1’.
    • write ‘Test List 1’.
    • when ‘TST2’.
    • write ‘Test List 2’.
    • endcase.
  • Defining a Status
      • To define the status (GUI status) of a user interface you use the MENU PAINTER . The Menu Painter is one of the tools of the ABAP Development Workbench.
      • There are three ways to create a status:
        • from the object list in the Object Navigator;
        • From the Menu Painter; or
        • by forward navigation from the ABAP Editor . (recommended)
  • Defining a Status
    • report lec701. s tart-of-selection. set pf-status ‘TEST’. write: / ‘Basic List’. at user-command. case sy-ucomm.
    • when ‘TST1’.
    • write ‘Test List 1’.
    • when ‘TST2’.
    • write ‘Test List 2’.
    • endcase.
      • For the above program, define a status TEST in the Menu Painter and:
        • Define the function code TST1 as a pushbutton labeled “Test1”.
        • Assign function code TST1 to function key F5
        • Define the function code TST2 as a pushbutton labeled “Test2”.
        • Assign function code TST2 to function key F6
  • Defining a Status – Menu Painter
        • Define the function code TST1 as a pushbutton labeled “Test1”.
        • Define the function code TST2 as a pushbutton labeled “Test2”.
        • Assign function code TST1 to function key F5
        • Assign function code TST2 to function key F6
  • Defining a Status
      • After ACTIVATING and saving the status then executing the program, the basic list appears as:
      • The user can trigger the AT USER-COMMAND event either by:
        • Pressing Function keys F5 or F6.
        • Clicking the “Test 1” or “Test 2” pushbuttons.
  • Applying a Status
      • Using SET PF-STATUS , you can display different user interfaces for different list levels to provide the user with different functions.
    CARR BOOK FLIG STATUS: CARRIER STATUS: BOOKING STATUS: FLIGHT STATUS: BOOKING2 STATUS: FLIGHT2
  • Applying a Status
    • Sample Program
    • report ylec702.
    • end-of-selection.
    • set pf-status ‘BASE’.
    • at user-command.
    • case sy-ucomm.
    • when ‘BOOK’.
    • set pf-status ‘BOOKING’.
    • when ‘FLI2’.
    • set pf-status ‘FLIGHT2’.
    • endcase.
    • top-of-page during line-selection.
    • case sy-pfkey.
    • when ‘BOOKING’.
  • Defining Titles for Interactive Reports
      • To set a title for basic or secondary lists , use : SET TITLEBAR <title> [WITH g1…g9]
      • There are three ways to create a Title:
        • from the object list in the Objet Navigator;
        • from the Menu Painter; or
        • by forward navigation from the ABAP Editor. (recommended)
  • Defining Titles for Interactive Reports
    • You can specify up to 9 placeholders &1…&9 in a title.
    • The placeholders are replaced at runtime by the field names after the WITH option.
    • Example:
    • report ylec703.
    • start-of-selection.
    • write ‘Click me!’ hotspot color 5 inverse on.
    • at line-selection.
    • set titlebar ‘TST’ with sy-lsind.
    • write ‘Click again’ hotspot color 5 inverse on.
    • This program sets a new title for each secondary list.