Académique Documents
Professionnel Documents
Culture Documents
1 Log On ᄃ
2 Join Us ᄃ
3 Getting Started ᄃ
4 Newsletters ᄃ
5 Store ᄃ
Search for:
6 Products
7 Services & Support
8 About SCN
9 Downloads ᄃ
10 Industries
11 Training & Education
12 Partnership
13 Developer Center ᄃ
14 Lines of Business
15 University Alliances ᄃ
16 Events & Webinars
17 Innovation
18 Activity ᄃ
19 Communications ᄃ
20 Actions ᄃ
21 Browse ᄃ More ᄃ
More discussions ᄃ in ABAP Development ᄃ Where is this place located?ᄃ
inShare ᄃ
EVENTS OF A REPORT ᄃ
This question is Assumed Answered.
ᄃ
PJᄃ
Jul 25, 2006 8:04 AMMAY ANY ONE OF U SUGGEST ME THE
SEQUENCIAL FLOW OF EVENTS FOR REPORTS ALONG WITH A SAMPLE
REPORT .
(0 ratings)
Re: EVENTS OF A REPORT ᄃ
ᄃ
kishan negi ᄃ Jul 25, 2006 8:12 AM (in response to P J ᄃ)refer...
http://www.sap-img.com/abap/events- related-to-reporting.htm ᄃ
1 Alert Moderator ᄃ
2
3 Like (0 ᄃ)
1.Initialization
2. at-selection-screen
3. start-of-selection
4.end-of-selection
5.top-of-page
6. end-of-page.
Regards.
Ankur Garg.
4 Alert Moderator ᄃ
5
6 Like (0 ᄃ)
Re: Events ᄃ
Sudha
7 Alert Moderator ᄃ
8
9 Like (0 ᄃ)
1) INITIALIZATION.
2) AT SELECTION-SCREEN.
3) START-OF-SELECTION.
4) END-OF-SELECTION.
5) TOP-OF-PAGE.
6) END-OF-PAGE.
<b>
Keyword Link </b>
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/ᄃ
RadioButtons
<b>o</b> Helpful Answer
<b>o</b> Very helpful Answer
<b>o</b> Problem Solved.
Click any of the above button next to the post; as per the anwers
<b>To close the thread; Click Probelm solved Radio Button next to the post , which u
feel is best possible answers</b>
10 Alert Moderator ᄃ
11
12 Like (0 ᄃ)
Sample report:
----
ᄃ
Tables Declaration *
----
----
ᄃ
Internal Tables Declaration *
----
END OF it_ekko.
END OF it_ekpo.
----
24
ᄃ
Variables Declaration *
----
DATA : v_grd_netwr LIKE ekpo-netwr, " For Grand totals of net price
v_sub_netwr LIKE ekpo-netwr, " For Sub totals of net price
fg_no_data, " NO DATA flag
v_ekorg LIKE ekko-ekorg. " For Purchase Organiztion validation
----
Selection Screen *
----
ᄃ
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
----
ᄃ
Initialization *
----
INITIALIZATION.
----
ᄃ
at selection screen *
----
AT SELECTION-SCREEN.
----
ᄃ
start of selection *
----
START-OF-SELECTION.
PERFORM retrieve_data. " Select the data from database
----
ᄃ
end of selection *
----
END-OF-SELECTION.
----
ᄃ
top of page *
----
TOP-OF-PAGE.
----
ᄃ
end of page *
----
END-OF-PAGE.
ᄃ
SUB ROUTINEES *
----
&----
ᄃ
*& Form disp_header
&----
ᄃ
text
----
ᄃ
--> p1 text
<-- p2 text
----
ᄃ
FORM disp_header.
SKIP 1.
&----
ᄃ
*& Form disp_footer
&----
ᄃ
text
----
ᄃ
--> p1 text
<-- p2 text
----
ᄃ
FORM disp_footer.
IF fg_no_data = 'X'.
EXIT.
ELSE.
SKIP 1.
ENDIF.
&----
ᄃ
*& Form initialize
&----
ᄃ
text
----
ᄃ
--> p1 text
<-- p2 text
----
ᄃ
FORM initialize.
p_ekorg = '1000'.
s_bukrs-low = '1000'.
APPEND s_bukrs.
ENDFORM. " initialize
&----
ᄃ
*& Form sel_scr_vald
&----
ᄃ
text
----
ᄃ
--> p1 text
<-- p2 text
----
ᄃ
FORM sel_scr_vald.
IF sy-subrc <> 0.
ENDIF.
IF sy-subrc <> 0.
&----
ᄃ
*& Form retrieve_data
&----
ᄃ
text
----
ᄃ
--> p1 text
<-- p2 text
----
ᄃ
FORM retrieve_data.
IF sy-subrc <> 0.
fg_no_data = 'X'.
MESSAGE i000 WITH 'No Data for this Selection Criteria'.
STOP.
ENDIF.
ENDIF.
&----
ᄃ
*& Form list_data
&----
ᄃ
text
----
ᄃ
--> p1 text
<-- p2 text
----
ᄃ
FORM list_data.
LOOP AT it_ekpo.
AT NEW ebeln.
READ TABLE it_ekko WITH KEY ebeln = it_ekpo-ebeln.
IF sy-subrc = 0.
ENDIF.
PERFORM draw_vline.
ENDAT.
PERFORM draw_vline.
AT END OF ebeln.
ULINE AT /47(35).
PERFORM draw_vline.
WRITE : /53 'Doc.Value : '(010) COLOR 3 INVERSE ON,
v_sub_netwr LEFT-JUSTIFIED COLOR 3.
CLEAR v_sub_netwr.
PERFORM draw_vline.
ULINE AT /2(104).
ENDAT.
AT LAST.
ENDAT.
ENDLOOP.
&----
ᄃ
*& Form disp_col_header
&----
ᄃ
text
----
ᄃ
--> p1 text
<-- p2 text
----
ᄃ
FORM disp_col_header.
SKIP 1.
ULINE AT /2(104).
PERFORM draw_vline.
ULINE AT /2(104).
&----
ᄃ
*& Form draw_vline
&----
ᄃ
text
----
ᄃ
--> p1 text
<-- p2 text
----
ᄃ
FORM draw_vline.
WRITE : 2 sy-vline,
14 sy-vline,
20 sy-vline,
32 sy-vline,
41 sy-vline,
46 sy-vline,
66 sy-vline,
82 sy-vline,
105 sy-vline .
Sreedhar
1 Alert Moderator ᄃ
2
3 Like (0 ᄃ)
Events in Reports::::
1)initialization:-This event will give default values in selection screen.
2)at selection screen:-This event will do the validation checks.
3)start-of-selection:This event will retrieve data from the data base table and put into
internal table.
4)end-of-selection:-This event will populate out put list.
5)top-of-page:-will maintain the header in the out put list.
6)end-of-page:- maintain the footer in the bottom of page..
1 Alert Moderator ᄃ
2
3 Like (0 ᄃ)
ᄃ
!
a.Initialization
b.At selection-screen
c.Start-of-selection
d.End-of-selection.
e.Top-of-page
f. End-of-page.
First event -
Initialization : triggered when the report is loaded in memory.
end-of-page : every time the list data reaches the footer region of the page.
top of page during line selection : top of page event for secondary list.
at pF<key> : function key from F5 to F12 to perform interactive action on the list.
at user-command
cheers,
Simha.
4 Alert Moderator ᄃ
5
6 Like (0 ᄃ)
• INITIALIZATION
• AT SELECTION-SCREEN
• GET (pay attention to the order of the nodes of the logical database. The event GET
LATE has to be used as final statement.)
• END-OF-SELECTION
• AT events
• TOP-OF-PAGE
• END-OF-PAGE
Regards,
Sumit.
7 Alert Moderator ᄃ
8
9 Like (0 ᄃ)
1) INITIALIZATION.
2) AT SELECTION-SCREEN.
3) START-OF-SELECTION.
4) END-OF-SELECTION.
5) TOP-OF-PAGE.
6) END-OF-PAGE.
10 Alert Moderator ᄃ
11
12 Like (0 ᄃ)
&----
ᄃ
*& Report ZCLASSICAL_REP *
*& *
&----
ᄃ
*& *
*& *
&----
TABLES: MARA.
************************************************************************
INITIALIZATION.
************************************************************************
SMATNR-LOW = '500'.
SMATNR-HIGH = '1200'.
SMATNR-OPTION = 'BT'.
SMATNR-SIGN = 'I'.
APPEND SMATNR.
************************************************************************
AT SELECTION-SCREEN.
************************************************************************
IF SMATNR EQ ''.
MESSAGE I001.
ENDIF.
************************************************************************
START-OF-SELECTION.
************************************************************************
WRITE:/3 MARA-MATNR.
ENDSELECT.
************************************************************************
TOP-OF-PAGE.
************************************************************************
************************************************************************
END-OF-PAGE.
************************************************************************
WRITE:/ SY-PAGNO.
************************************************************************
END-OF-SELECTION.
************************************************************************
Regards,
Harini
13 Alert Moderator ᄃ
14
15 Like (0 ᄃ)
25
Re: EVENTS OF A REPORT ᄃ
ᄃ
Seema Chand ᄃ Jul 25, 2006 8:34 AM (in response to P J ᄃ)Hi Pawan,
This is the flow-
1. Initialization
2. Selection-screen
3. at-selection-screen output
4. at-selection-screen
5. top-of-page
6. start-of-selection
7. end-of-page.
8. end-of-selection
<b>The following events occur when you run a typical executable program with a logical
database:</b>
AT SELECTION-SCREEN:
After user input on a selection screen has been processed, but while the selection screen
is still active
START-OF-SELECTION:
After the standard selection screen has been processed, before data is read from the
logical database
GET <table>: After the logical database has read an entry from the node <table>
END-OF-SELECTION:
After all data has been read by the logical database
Reward points if you find the answer helpful and close this thread.
Regards,
Tanuja.
4 Alert Moderator ᄃ
5
6 Like (0 ᄃ)
Report Events
Classical Reports
Reports which are properly formatted (header, footer, page numbers etc.,) with the help
of one or more external events like top-of-page,end-of-page etc., are called as
CLASSICAL REPORTS.
Standard list.
Output of Report program is nothing but Standard list. It consists of one continuous page
of 60,000 lines.
Initialization. Start-of-selection
At selection-screen. Top-of-page.
At selection-screen on <field>. End-of-page.
End-of-selection.
We can initialize the selection-screen with calculated default values under this event.
Initialization.
s_date-high = sy-datum.
s_date-low = sy-datum - 15.
Append s_date.
We can validate all the inputs on selection screen fields under this event.
At selection-screen.
If s_carrid-low is initial or
s_connid-low is initial or
s_date is initial.
< ... code for validation... >.
Endif.
We can validate a particular field input on selection screen under this event.
At selection-screen on s_carrid.
If s_carrid-low < > ‘LH’.
<… code for validation…>
Endif.
End-of-page.
Write:/ sy-uline(75).
Write:/ ‘This is end of page:’,sy-pagno.
Write:/ sy-uline(75).
Interactive Report
A simple report or even a classical report displays a clustered list with all the requested
output at one go.
What ever it is displayed, it is final. That means, the user can not interact with with that
list.
A simple report or even a classical report displays a clustered list with all the requested
output at one go.
What ever it is displayed, it is final. That means, the user can not interact with with that
list.
The first list is called ‘Basic list’ and all the successive lists are called ‘Secondary lists’.
Each list is again an interactive.
The Basic list is not deleted when secondary list is created.
A secondary list may either overlay the basic list or appear in an additional dialog
window on the same screen.
For basic list SY-LSIND = 0 and for secondary lists, SY-LSIND varies from 1 to 20.
Double clicking or single click and pressing F2 (function key) or single click with
‘hotspot on’.
OR
Selecting from menu bar or from application tool bar.
All the events used in classical reports can be used in Basic List.
The event ‘End-of-page’ can be used in Secondary Lists also.(the other six events can not
be used in secondary lists)
You can not place ‘select-options’ in secondary lists.
When you double click on any field in the basic list, you will be navigating to secondary
list with detailed information pertaining to clicked field.
‘Hide’ temporarily stores the content of clicked field for later use.
The default title of the out put is the text what we enter during creation of program.
You can have 8 menus ( out of which, 2 menus are reserved for ‘System’ and ‘Help’).
Each menu can have 15 menu items.
Each menu item can have 3 levels of submenus.
Example Code
REPORT zs_stockreport3
NO STANDARD PAGE HEADING
LINE-SIZE 255
MESSAGE-ID zz1.
************************************************************************
Table Declaration *
************************************************************************
TABLES: mara,
marc,
mard.
************************************************************************
Types Declaration *
************************************************************************
TYPES: BEGIN OF typ_mara,
matnr TYPE mara-matnr, "Material Number"
mbrsh TYPE mara-mbrsh, "Industrial Sector"
mtart TYPE mara-mtart, "Material Type"
meins TYPE mara-meins, "Base Unit of Measure"
END OF typ_mara.
************************************************************************
Initialization *
************************************************************************
INITIALIZATION.
***
PERFORM initial_input.
************************************************************************
At Selection-screen *
************************************************************************
AT SELECTION-SCREEN.
***
PERFORM validte_inputdata.
************************************************************************
Start of Selection *
************************************************************************
START-OF-SELECTION.
***
SELECT matnr
mbrsh
mtart
meins
INTO TABLE it_mara
FROM mara
WHERE matnr IN s_matnr and
mtart = p_mtart.
if sy-subrc = 0.
sort it_mara by matnr.
else.
MESSAGE e001 WITH 'No data Found' ' For the Given'
'Selection Criteria'(400).
endif.
ENDIF.
endif.
endif.
DATA: a TYPE i.
loop at it_mara.
a = sy-tabix MOD 2.
IF a = 1.
FORMAT COLOR 5.
ELSE.
FORMAT COLOR OFF.
ENDIF.
read table it_marc with key matnr = it_mara-matnr
binary search.
if sy-subrc = 0.
read table it_mard with key matnr = it_marc-matnr
werks = it_marc-werks
binary search.
if sy-subrc = 0.
read table it_makt with key matnr = it_mara-matnr
binary search.
if sy-subrc = 0.
WRITE:/ sy-vline.
WRITE: 2 it_mara-matnr,
18 sy-vline, it_mara-mbrsh,
38 sy-vline, it_mara-mtart,
54 sy-vline, it_mara-meins,
78 sy-vline, it_makt-maktx,
120 sy-vline, it_marc-werks,
135 sy-vline, it_mard-lgort, 155 sy-vline.
clear : it_mara.
endif.
clear : it_makt.
endif.
endif.
endloop.
WRITE: /(155) sy-uline.
************************************************************************
Top of Page *
************************************************************************
TOP-OF-PAGE.
***
FORMAT COLOR 1.
WRITE: /(155) sy-uline.
WRITE:/ sy-vline.
WRITE: 2 'Material Number',
18 sy-vline, 'Industrial Sector',
38 sy-vline, 'Material Type',
54 sy-vline, 'Base Unit of Measure',
78 sy-vline, 'Material Description',
120 sy-vline, 'Plant',
135 sy-vline, 'Storage Location',155 sy-vline.
WRITE: /(155) sy-uline.
FORMAT RESET.
************************************************************************
End of Page *
************************************************************************
&----
ᄃ
*& Form Initial_Input
&----
ᄃ
Initailization of Select Option
----
ᄃ
FORM initial_input .
CLEAR s_matnr.
REFRESH s_matnr.
s_matnr-low = '100-100'.
s_matnr-high = '111-111'.
s_matnr-sign = 'I'.
s_matnr-option = 'BT'.
APPEND s_matnr.
p_mtart = 'ROH'.
ENDFORM. " Initial_Input
&----
ᄃ
*& Form Validte_Inputdta
&----
26
ᄃ
Validation of Select Option
----
ᄃ
FORM validte_inputdata .
SELECT SINGLE * FROM mara
WHERE matnr IN s_matnr.
IF sy-subrc <> 0.
MESSAGE e001 WITH 'Material'(002) 'Type'(003) 'Does Not Exit'(400).
ENDIF.
ENDFORM. " Validte_Inputdta
************************************************************************
End of Selection *
************************************************************************
Regards
Sreeni
1 Alert Moderator ᄃ
2
3 Like (0 ᄃ)
• INITIALIZATION
• AT SELECTION-SCREEN
• AT SELECTION-SCREEN ON <field>
• START-OF-SELECTION
• TOP-OF-PAGE
• END-OF-PAGE
• END-OF-SELECTION
In this case first three events are associated with selection screen. Rest of the events are
associated with your list.
• INITIALIZATION
in many cases you need to calculate the value and then put it in selection criteria. For
example, say, you are accepting date from user and you need to fill in the default value
for lower range as sy-datum – 30 days and sy-datum for higher range. In this case you are
calculating lower range and then filling the criteria. This can be done in
INITIALIZATION event. Piece of code to do the above task would look like the
following:
Tables: Sflight.
Select-options: fldate1 for sflight-fldate.
INITIALIZATION.
Data: date1 like SY-DATUM.
Date1 = sy-datum – 30.
Fldate1-low = date1.
Fldate1-high = sy-datum.
Append fldate1.
Here appending is required because fldate1 is int’ table
This event is triggered when you execute your program for the first time i.e., before
selection screen is displayed.
• AT SELECTION-SCREEN
When user enters the values in the fields of selection screen and clicks on execute button,
this event gets triggered. This event is basically for checking the values entered by the
user for the fields of the selection screen i.e., data validity checking. This event is for
entire selection screen. For example:
You are accepting carrid, connid, fldate from user and you don’t want to proceed if user
enters no value for carrid and fldate. Using AT SELECTION-SCREEN can do this.
AT SELECTION-SCREEN.
If carrid1-low ne ‘ ’ and fldate1-low = ‘ ’.
Error message.
Endif.
In this case, if both the fields are entered blank, then the user gets error message.
Basically, this event is for many fields on selection screen. Usually, it is for the fields
which are logically related.
• AT SELECTION-SCREEN ON <field>
When you want to check for specific value of a field. For example, carrid should be in the
range of ‘LH’ and ‘SQ’. This can be done in this event. Basically, this event is for
checking individual fields. You can have many AT selection-screen events in your
program (i.e., for each field specified in the Select-Options).
• START-OF-SELECTION
This is the first event for your list. Once all the events are triggered for selection screen,
the data is retrieved from database. Data declaration, select statements are done in this
event. Consider the following example:
START-OF-SELECTION.
Data: mtype i.
Tables: sflight.
Select * from sflight where carrid = ‘LH’.
Write: / sflight-carrid,sflight-connid.
Endselect.
• TOP-OF-PAGE
This event is triggered with first WRITE statement or whenever new page is triggered.
Advantage of using this event is that, whatever you write under this event, is applicable to
all the pages. If you don’t have any write statement before TOP-OF-PAGE or in START-
OF-SELECTION, this event is not triggered at all. For example, if you want the name of
company and column headers for all the pages, it can be written in this event.
TOP-OF-PAGE
Write: / ‘INTELLIGROUP ASIA PVT. LTD.’
Write : / 10 ‘carrid’, 20 ‘connid’, 30 ‘fldate’.
• END-OF-PAGE
End-of-page.
Write : / ‘page number’, sy-pagno.
ᄃ
1.INITIALIZATION.
2.AT SELECTION-SCREEN.
3.TOP-OF-PAGE.
4.START-OF-SELECTION.
5.END-OF-SELECTION.
6.END-OF-PAGE.
-
ᄃ
even you give in different order in ABAP editor,
they will execute in the same order,try for it,
best of luck,
regards,
kcc
7 Alert Moderator ᄃ
8
9 Like (0 ᄃ)
hi,
First event -
Initialization : triggered when the report is loaded in memory.
This event keyword defines an event block whose event is triggered by the ABAP
runtime environment
when calling the executable program selection screen processing of a selection screen.
end-of-page : every time the list data reaches the footer region of the page.
top of page during line selection : top of page event for secondary list.
at pF<key> : function key from F5 to F12 to perform interactive action on the list.
at user-command
http://help.sap.com/saphelp_47x200/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/
content.htm ᄃ
Cheers,
Manju
10 Alert Moderator ᄃ
11
12 Like (0 ᄃ)
seq of event in
a)classical report
1) INITIALIZATION.
2) AT SELECTION-SCREEN.
3) START-OF-SELECTION.
4) END-OF-SELECTION.
5) TOP-OF-PAGE.
6) END-OF-PAGE.
b) in interactive report
1) INITIALIZATION.
2) AT SELECTION-SCREEN.
3) START-OF-SELECTION.
4)AT LINE-SELECTION
5) END-OF-SELECTION.
5) TOP-OF-PAGE DURING LINE-SELECTION
6) END-OF-PAGE.
7)AT PFN
8) AT USER_COMMAND.
REGARD
DEEPAK
13 Alert Moderator ᄃ
14
15 Like (0 ᄃ)
Go to original post ᄃ
AT SELECTION-SCREEN: PAI of the selection screen, processed only when there is any
user action like click of a button etc.
AT LINE SELECTION: Generally process when an event occurs on the reports output
LIST.
TOP-OF-PAGE: event that happens for evry new page of LIST OUTPUT.
END-OF-SELECTION is only useful for Logical database reports. Normal reports does
not have any affect for this event.
Regards,
Sesh
Some related to Classical reports, some to Interactive reports and some related to Module
Pool Programming(Dialog)
http://www.sap-img.com/abap/events-related-to-reporting.htm ᄃ
Regards,
Priyanka.
4 Alert Moderator ᄃ
5
6 Like (0 ᄃ)
at line-selection.
at user-command.
http://www.sap-img.com/abap/events-related-to-reporting.htm ᄃ
http://wiki.ittoolbox.com/index.php/FAQ:How_many_types_of_reports_are_there_in_AB
AP_and_what_is_the_difference_between_them%3F ᄃ
The
following graphic shows the possible selection screen events and their
chronological sequence between the
INITIALIZATION and the START-OF-SELECTION event. If user-defined selection
screens are called, the event sequence is imbedded accordingly in the current program
flow.
Selection
screen
processing
starts after
the
INITIALIZATION event with AT SELECTION SCREEN OUTPUT. The selection screen
is then sent to the screen. User actions on the selection screen result in other
events that are either used for field or possible entries help, or that trigger PAI
processing of the selection screen. During PAI processing,
error messages in the relevant event blocks allow users to return to the selection screen.
Only if the AT SELECTION-SCREEN event is exited properly, that is not through an
error message, are the other events of the executable program triggered, starting with
START-OF-SELECTION.
Choosing multiple selection calls the relevant dialog box. Similarly, events are
triggered during its PAI processing.
2. Initialization : This event keyword defines an event block whose event is triggered
by the ABAP runtime environment during the flow of an executable program, directly
after LOAD-OF-PROGRAMand before the selection screen processing of any existing
standard selection screen. This gives you the one-time opportunity to initialize the
input fields of the selection screen.
6. Top Of Page : TOP-OF-PAGE is used for page headers on the basic list only. TOP-
OF-PAGE is triggered when the system encounters a WRITE, SKIP, or ULINE
statement on the basic list. TOP-OF-PAGE occurs the moment the first line of the first
page is written to the screen. NEW-PAGE also invokes the TOP-OF-PAGE event. This
occurs when a new page is started – that is, immediately before the first line in a new
page is to be output.
7. End Of Page : The END-OF-PAGE event is used for page footers. This event is
triggered when the system encounters insufficient space on the current output page.
The LINE-COUNT statement within the REPORT statement specifies the size of the
page area. If a LINE-COUNT is not explicitly coded, the END-OF-PAGE event block
will not be processed. So the LINE-COUNT is defined like this if the page contains 50
lines and 3 lines are for the footer then it should be written as LINE-COUNT 50(3).
8 . At Line Selection : This statement defines an event block whose event is triggered
by the ABAP runtime environment during the display of a screen list – provided the
scren cursor is on a list line and you select a function using the function code PICK.
Through the definition of this event block, the standard list status is automatically
enhanced in such a way that the function code F2 and, with it, the double-click mouse
function is linked up to the function code PICK.
9. At User Command : This statement defines an event block whose event is triggered
by the ABAP runtime environment if, during the display of a screen list, a function
with a self-defined function code was chosen.
10. At PFn : This statemet defines an event block whose event is triggered by the
ABAP runtime environment during list display – provided the screen cursor is on a list
line and a function is selected using the function code PFn. Here n stands for a number
between 01 and 24. In the= standard list status, these function codes are assigned to the
function keys of the input device.