Friday, January 31, 2014

Events in ABAP program

There are following types of programs :


  • Executable program: These are the I program represented with the keyword REPORT. created through transaction SE38. an executable program can be called in other program using two ways - using SUBMIT keyword, using call transaction.

    These are mainly event driven program:triggered when an ABAP program loads in the memory.

  1. Load of program: this is the first to execute before any of the ABAP code is actually processed. Ideally this event trigger before the program loaded in the memory for execution. this can be used for the functions like we have to send mail every time a program is load in the memory.
  2.  Initialization: this is the first event which triggered in the ABAP program, before the selection screen loaded. this is executed after all the selection screen events are processed (i.e. parameters , select options) but not actually displayed.  so we can use this block to initialize values to selection screen elements whenever required.
  3. At selection screen output: This is the block which executed just before selection screen displayed, here we can manage the display properties of selection screen elements. like we can loop the whole selection screen and assign values for them.
  4. At selection screen: This is the first event triggers when user do any action in the selection screen. we can use this event for the selection screen validations. also in report programming we can use this to provide F1 and F4 functions to the any selection screen fields.
  5. Start of selection: This event is trigger when we press execute button in the selection screen, if no other event exist in the program this event is automatically called on F8. generally we define all our data selections inside this block.
  6. End of selection: Generally used in logical database, but in normal report programming triggers after start of selection and its last event triggered before displaying the report.
  7. Top of Page: Triggered every time a list is generated. Triggered when first write statement is executed (also ULINE, SKIP, VLINE).Top of page triggered whenever control found a write statement in the program it go to top-of-page and then come back and executes this write statement.

  •  Module pool program: These are the M type program represented with the keyword PROGRAM. there must be a transaction code with an initial screen to execute these programs. following are the four components of a module pool program.
  1.  Screens
  2. transaction codes
  3. GUI status
  4. ABAP Programs
   Module pool program also support following four events :
  1. PBO
  2. PAI
  3. POV
  4. POH

No comments:

Post a Comment