Sei sulla pagina 1di 4

Events in an ABAP/4 Report Program Posted in December 29, 2007 3:44 pmh.

. Admin There is no mandatory event in a report program. Events are actually used to org anize the statements and control the flow of the program. If the program contain s no explicitly defined event blocks, all the statements in the program form the entire event block START-OF-SELECTION. ABAP runtime environment automatically i ntroduces a START-OF-SELECTION at the first execution line. ABAP/4 report programs are event driven programs. Following events are triggered in a report. LOAD OF PROGRAM. - If propgram is of type 1, M, F, or S; then LOAD-OF-PROGRAM is trigerred first and then INITIALIZATION. The purpose of load of program is to l oad the program into system memory so that the program can be executed. INITIALIZATION. - just once. AT SELECTION-SCREEN OUTPUT. - when there is selection-screen AT SELECTION-SCREEN. - when user interacts. START-OF-SELECTION. - when F8.This is the default event in ABAP. END-OF-SELECTION. - At the end EVENTS IN A CLASSICAL REPORT: 1. INITIALIZATION: This is triggered when the report is loaded in memory. 2. AT SELECTION-SCREEN OUTPUT: This is triggered when the selection screen is lo aded in memory before being displayed. 3. AT SELECTION-SCREEN/<field> : This event is triggered before leaving the sele ction screen. 4. START-OF-SELECTION: This is the the first and default event for displaying th e report. Data retrieval logic is written under this event. OUTPUT EVENT(5, 6): 5. TOP-OF-PAGE: This event is triggered every time a new page is started in the list. 6. END-OF-PAGE : This event is triggered every time the list data reaches the fo oter region of the page. 7. END-OF-SELECTION: This event is triggered after the START-OF-SELECTION is com pleted. This event is used when there is use of logical data base in the report. It is t riggered in type 1 programs once the logical database completes reading all data i.e. all the selection is finished and before the list processor is started. Th is statement tells the server that all the database reading is completed and no more data reading is going to take place. END-OF-SELECTION is generally used for the summary/results of reports. In an executable program without logical data b ase, there is no need to implement the event block END-OF-SELECTION. After a program is executed by the user, the database is locked when it encounte rs a START-OF-SELECTION statement and the lock is released when an END-OF-SELECT ION statement is encountered (to maintain the consistency). Data selection is do ne between START-OF-SELECTION and END-OF-SELECTION. Now if we don t write the ENDOF-SELECTION statement, the database will remain locked till the programs get te

rminated. Hence, the performance will be reduced. So it is always good practice to write END-OF-SELECTION statement after finishing the data selection from data base. EVENTS IN AN INTERACTIVE REPORT: In addition of the above, the following events are possible in case of Interacti ve Reports. 1. Top of page during line selection : top of page event for secondary list. 2. At line-selection : evey time user dbl-clicks(F2) on the list data. 3. At pF<key> : function key from F5 to F12 to perform interactive action on the list. 4. At user-command. ================================================== Finally I want to include one point: If you debug your report program from the Abap editor screen then it triggers fr om 1.Initialization, 2.At Selection-screen, 3.Start-of Selection, 4.End-of Selection, 5.Top-of-page, 6.End-of-page. But if you debug from the selection-screen then it triggers from 1.At Selection-Screen, 2.Start-of-selection, 3.Top-of-page, 4.End-of-page. ******************************************************* # 2 There are several events In Clasical Reports 1.Initialization 2.At Selection-Screen. 3.Start-Of-Selection. 4.Top-of-page. 5.End-of-page. 6.End-of-selection. In Interactive Reports 1.At Line-Selection. 2.At PF key 3.At User-Command 4.Top-of-page During Line-Selection. ********************************************************* ABAP Interview questions on ABAP reports Posted in May 3, 2009 2:43 pmh. Admin Q.1) What are SAP reports?

Ans: SAP Reports are event-driven programs using ABAP/4 programming langugage. T hese reports are used to fetch business-specific data from SAP standard database s under specified selection criteria, fetched data is processed to display resul t on output screen. User develop SAP report object on ABAP editor using the stan dard SAP transaction SE38. Q.2)What are types of reports? Ans: i.Simple report and ii.Interactive report. Q.3) What are ABAP report types? Ans: ABAP report types are of 7 types. ABAP report types are available in report s attributes screen. i.Executable program, ii.Function group (containing function modules) , iii. Include , iv. Interface pool , v. Class pool, vi. Module pool, vii. Subroutine pool. Q.4)What are the steps involved in interactive report? Ans: i. ii.Case Case 2: process Basic list is displayed. 1: User double clicks on any key figure to get more detailed data on it User presses on any customized toolbar button so that another specified is performed or corresponding event is trigerred.

Q.5)How many lists can be displayed through an interactive report? Ans: Maximum 21 lists can be displayed(1 basic list+ 20 secondary lists). Q.6)What are the events in classical and interactive reports? Ans: EVENTS IN A CLASSICAL REPORT: 1. 2. 3. 4. INITIALIZATION. AT SELECTION-SCREEN OUTPUT. AT SELECTION-SCREEN/<field>. START-OF-SELECTION.

OUTPUT EVENTS(5, 6): 5. TOP-OF-PAGE. 6. END-OF-PAGE. 7. END-OF-SELECTION. EVENTS IN AN INTERACTIVE REPORT: In addition of the above, the following events are possible in case of Interacti ve Reports. i.Top of page during line selection. ii.At line-selection. iii.At pF<key>. iv.At user-command. [P.N.: For detailed notes on events : http://www.abapguide.com/notes/events-inreport/]

Q.7)what is the event that will be triggered first in an ABAP report? Ans: Initialization event is triggered first if user executes an ABAP report. Bu t if the program is of type 1, M, F, or S; then LOAD-OF-PROGRAM is trigerred fir st and then INITIALIZATION event. ( Note: The purpose of load of program is to load the program into system memor y so that the program can be executed.) Q.8)What are the events in dialog program? Ans: i.PBO : Process Before Output ii.PAI : Process After Input iii.POH : Process on Help iv.POV : Process on Value Request Q.9)What are the differences between simple and interactive ABAP reports? Ans: A simple ABAP report allows the user to interact with the whole business-re sult data. In case of interactive reports user can interact with specific result data at a time. Q.10)Mention the steps involved in case of displaying data of an interactive rep ort? Ans: i. Execute the report ii. Click on the specific key field to display data of the secondary list. Or, click on application toolbar button or any screen button for required data d isplay.

Potrebbero piacerti anche