Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Lecture 10 Reporting – Interactive (B) BCO5647 Applications Programming Techniques (ABAP)
Readings & Objectives <ul><li>Readings </li></ul><ul><li>Keller & Keller   Chapter 7 Section 7.3.6 & 7.3.7    </li></ul><u...
The Window Statement <ul><ul><li>You can display a secondary list in a window  (modal dialog box)  instead of the full scr...
The Windows Statement <ul><li>Example </li></ul><ul><li>report ylec700. </li></ul><ul><li>start-of-selection. </li></ul><u...
User Interfaces <ul><li>A user interface consists of the following: </li></ul><ul><ul><ul><li>A  title bar  containing the...
Using a GUI Status <ul><ul><li>You can define a GUI Status to add menu entries, toolbar buttons and/or function key settin...
Using A GUI Status <ul><li>Simple Example: report lec701. start-of-selection.   set pf-status ‘TEST’.    write: / ‘Basic L...
Defining a Status <ul><ul><li>To define the status (GUI status) of a user interface you use the  MENU PAINTER . The Menu P...
Defining a Status <ul><li>report lec701. s tart-of-selection. set pf-status ‘TEST’.  write: / ‘Basic List’. at user-comman...
Defining a Status  – Menu Painter <ul><ul><ul><li>Define the function code  TST1  as a pushbutton labeled “Test1”. </li></...
Defining a Status <ul><ul><li>After  ACTIVATING  and saving the status then executing the program, the basic list appears ...
Applying  a Status <ul><ul><li>Using  SET PF-STATUS , you can display different user interfaces for different list levels ...
Applying  a Status <ul><li>Sample Program </li></ul><ul><li>report ylec702. </li></ul><ul><li>end-of-selection. </li></ul>...
Defining Titles for Interactive Reports <ul><ul><li>To set a title for  basic or secondary lists , use : SET TITLEBAR <tit...
Defining Titles for Interactive Reports <ul><li>You can specify up to 9  placeholders &1…&9  in  a  title.  </li></ul><ul>...
Upcoming SlideShare
Loading in …5
×

Lecture10 abap on line

1,609 views

Published on

Published in: Technology
  • Be the first to comment

Lecture10 abap on line

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

×