1 / 54

Creating Dialog (ABAP Dynpro ) Programs

Creating Dialog (ABAP Dynpro ) Programs. Types of ABAP Programs (1). A program’s technical attributes and capabilities are determined by its type Type 1 programs are executable programs They do not need to be controlled by screens Type 1 programs are often called reports

seven
Download Presentation

Creating Dialog (ABAP Dynpro ) Programs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Creating Dialog (ABAP Dynpro) Programs

  2. Types of ABAP Programs (1) • A program’s technical attributes and capabilities are determined by its type • Type1 programs are executable programs • They do not need to be controlled by screens • Type 1 programs are often called reports • You have been creating these so far • Type M programs are controlled through screen flow logic and must be started from a transaction code (called a dialog program or Dynpro)

  3. What is a Dialog (M) Program (1) • They form the basis for transactions (transaction codes) • Dialog programs implement a UOW

  4. What is a Dialog (Type M) Program (2) • They consist of a single screen or multiple screens connected together • Code blocks (event handlers) execute as users navigate from screen to screen • Screens are created with the screen painter • Code is still created with the ABAP Editor but the Object Navigator does a bit of work • We will use the Object Navigator in this section

  5. Transaction Internals • Dialog steps in an application program is executed by a work process • User interaction is controlled by screens (screen processor) • The processing logic is executed by the ABAP processor • The ABAP processor, in turn communicates with the database interface

  6. Work Process (Illustration)

  7. Work Processes (Details) • Dialog processes work with users to execute dialog steps • A screen in a dialog is considered a dialog step • Update processes execute database update requests • Part of an SAP LUW to bundle database operations • Background processes execute without user interaction • Enqueue process administer a shared database lock table • More about locks later

  8. Work Processes (Details)

  9. The SAP LUW • It takes several database LUWs and group them into a logical SAP LUW through a process called bundling • You use explicit COMMIT WORK and ROLLBACK WORK statements • You can bundle using function modules (CALL FUNCTION IN UPDATE TASK) • The function module then gets committed

  10. Parts of a Dialog Program • Transaction code • ABAP program • PAI / PBO / Includes • Screen(s) • UI status • Screen flow logic • GUI Title

  11. Transaction Code (Part 1) • We think of a transaction as a sequence of actions that ‘logically’ belong together • Ad a material • We are back to the notion of the logical unit of work • It’s the “Dynpro” application mentioned earlier • So far, you have created simpler ‘reports’ • A transaction code is bound to an ABAP dialog program and CAN appear on the Easy Access menu

  12. An SAP Transaction • Access through the Object Navigator

  13. An SAP Transaction • A transaction has an associated program and screen number • Trans TZ40 • Prog SAPMTZ40 • Screen 100

  14. The ABAP Dialog Program (Part 2) • Think of it as a very well-structured .net project • Each screen and GUI status belongs to an ABAP program • There are different ways to call an ABAP program • By default, it’s the dialog module (MODULE POOL)

  15. ABAP Dialog Program (Characteristics) • The program has a type (M) – Module Pool • It typically contains 3-4 includes • Global Data • PBO modules • PAI modules

  16. ABAP Dialog Program (Top Level Program) • Global program includes the top / PBO / and PAI modules (Includes and separate files are not required but a way of doing things)

  17. ABAP Dialog Program (Top Include) • Declare global data • (PROGRAM) statement appears

  18. ABAP Dialog Program (PBO Module) • PBO event triggers (fires) before the screen is displayed • Before SAP outputs the screen to the user • Initialize screen values here • PBO modules are declared inside of a MODULE block designated as OUTPUT • It’s really just a procedure / event handler • Called by screen logic in PROCESS BEFORE OUTPUT

  19. ABAP Dialog Program (PBO Module) • MODULE OUTOUT (PBO) – Setup for program run

  20. ABAP Dialog Program (PBO Module) • The command SET PF-STATUS sets the program function status • More in a moment when we cover GUI status • The command SET TITLEBAR sets the titlebar screen

  21. ABAP Dialog Program (PAI Module) • PAI triggers after user interaction • Declare using a MODULE block as INPUT • Here we do the real work

  22. The ABAP Dialog Program Screens (Part 3) • Screens form an application’s visual interface • A program might have many screens • Screen flow logic controls the navigation path between screens. As the user moves from screen to screen, those PAO and PAI events fire

  23. The SAP LUW Big Picture

  24. Program Screen (Contents) • A program screen has a number to uniquely identify it • Flow logic to call our PAI and PAO modules • Attributes that describe the type of screen • Elements containing the visible screen controls

  25. Program Screen (Flow Logic) • The flow logic of a screen calls the various PAO and PAI modules created earlier • We handle the PROCESS BEFORE OUTPUT and PROCESS AFTER INPUT EVENTS using the MODULE statement to call the appropriate module (function)

  26. Program Screen (Flow Logic) • PBO and PAI events call the modules we created in the program

  27. Program Screen (Attributes) • Audit trail info • The screen type and configuration settings • We will work with normal screens here • Subscreens are screens within screens • Selection screens are what you have been working with • Modal dialog boxes are custom popups • The next screen in the screen sequence • Size (lines and columns)

  28. Program Screen (Attributes) • Attributes screen

  29. Program Screen (Elements) • Think of them as VB controls • They bind to our underlying tables • They have a type • They have a position • They have formatting • They have I/O characteristics

  30. Program Screen (Element Types) • Elementary types: • Text     Text field (field text) • I/O      Input/output field (template) • Graphical field element types • Push     Pushbutton • dHelp    Pushbutton for dialog help • RadioRadiobutton • CheckCheckbox • BoxBox • SubscSubscreen (area for an include screen) • TableTablecontrol • ACtrl    ABAP control • FdCtr    Field control

  31. Program Screen (Elements) • Illustration

  32. Program Screen (Elements) • Element list / Texts I/O templates contain prompts and edit masks

  33. Program Screen (Layout Editor) • The Layout Editor is similar to the Windows Forms Designer • It just a visual interface into the screen editor

  34. Program Screen (Layout Editor)

  35. The ABAP Dialog GUI Status (Part 4) • It is here that we control the behavior of • The menu bar • Application toolbar • Function keys • Each GUI status function has a code • When the user chooses the function, the PAI event fires • It’s assigned to the OK_CODE field AND SY-UCOMM

  36. The ABAP Dialog GUI Status (Illustration)

  37. The ABAP Dialog GUI Status (Types) • There are three types of GUI statuses

  38. The ABAP Dialog (Connecting the Dialog Status to a Screen) • We se the dialog status in the PBO module of a screen • This is how we wire the screen to the menu system • Use the SET PF-STATUS statement

  39. The ABAP Dialog (Connecting the Dialog Status to a Screen)

  40. The ABAP Dialog GUI Status (Menu Painter) • It is here we create the menu for the program • The code maps to a function that is called • This is the status field in the previous dialog box

  41. The ABAP Dialog GUI Status (Application Toolbar) • Associate a function and icon to the toolbar

  42. The ABAP Dialog GUI Status (Function Keys)

  43. Database LUW • An inseparable sequence of database operations that ends with a database commit • The LUW is fully executed or not at all • The database will always be in a consistent state • If the LUW fails, all changes are rolled back • LUWs can be committed implicitly or explicitly

  44. Database LUW (Illustration)

  45. Database LUW (Implicit Commit) • Happens when • A dialog step is completed and control passes from the Update work process to the GUI • When control is passed from one work process to another (function call) • A work process can only execute one LUW

  46. Database LUW (Explicit Commit) • Call the function module DB_COMMIT • Use the ABAP statement COMMIT WORK

  47. Database LUW (Implicit Rollback) • Cause by a runtime error in an application • Divide by 0 for example • ABAP termination message • MESSASE with message type A or X

  48. Database LUW (Explicit Rollback) • Call ROLLBACK WORK

  49. The SAP Lock Concept (Introduction) • The problem • Two of us try to book a flight at the same time • When I’m recording my transaction, you cannot record yours • The number of seats available, therefore, remains accurate • The problem is solved via “locks”

More Related