Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

where does the control moves at first at END-OF PAGE or END-OF-SELECTION

Former Member
0 Kudos

Is END-OF PAGE triggered like TOP-OF-PAGE from the AT-SELECTON-SCREEN automatically with a write statement & where does the control moves at first

at END-OF PAGE or END-OF-SELECTION?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

The control first comes to END-OF-SELECTION and then END-OF-PAGE.

Ideally, a program should be segragated into three sections:

1. Extraction of data fromt the DB tables

2. Formatting the data extracted based on business logic

3. Displaying the data as a result of 1 and 2

Now, step 1 should be between START-OF-SELECTION and END-0F-SELECTION

and step 3 triggers TOP-OF-PAGE and END-OF-PAGE.

From this , you can get an idea that EOS is triggered before EOP.

Cheers,

Aditya

4 REPLIES 4

Former Member
0 Kudos

Hi,

The control first comes to END-OF-SELECTION and then END-OF-PAGE.

Ideally, a program should be segragated into three sections:

1. Extraction of data fromt the DB tables

2. Formatting the data extracted based on business logic

3. Displaying the data as a result of 1 and 2

Now, step 1 should be between START-OF-SELECTION and END-0F-SELECTION

and step 3 triggers TOP-OF-PAGE and END-OF-PAGE.

From this , you can get an idea that EOS is triggered before EOP.

Cheers,

Aditya

Former Member
0 Kudos

Hi Dude,

END-OF-PAGE & TOP-OF-PAGE are similar in,

when a report is written and when a new page begins,

the top-of-page event is triggered and the statements in this event block are executed.

Like-wise when the end of the page is reached,theEND-OF-PAGE event is triggered and the statements in this event block are triggered.

The END-OF-PAGE is decided by the size of the page which is determined by the LINE-COUNT addition in the REPORT statement.

I suppose these two events are not connected with the AT-SELECTION-SCREEN event.

Then,END-OF-SELECTION occurs after all the database related SELECT statements have finished their execution.

So,END-OF-SELECTION occurs before END-OF-PAGE bcoz

database fetch is completed before displaying the report.

Reward if useful.

Regards,

Lakshmanan

Former Member
0 Kudos

hi,

the control comes to end-of-selection first and then end-of-page.

the control comes to end of page depending upon line count which we give near the program name at the top

ex :zabdf no standard page heading line count 6(2)

this indicates the size of the page is 6 coloum and 2 col are reserved for end-of-page

when it comes to 5 col end of page is triggered

Former Member
0 Kudos

Hi,

1. End-of-selection:

This event is triggered after the start-of-selection. to display the contents on the report.

2.Top-of-page: Every time a new page is triggered. Mainly this is used for header of the report.

3. End-of-page : every time the list data reaches the footer region of the page.

This way first data is disaplyed then it reaches the footer..

first End-of-selection then End-of-page

These example may help u in detail...

-


Leaving Event Blocks Using STOP

If you use the STOP statement within an event block, the system stops processing the block immediately. The ABAP runtime environment triggers the next event according to the following diagram:

Before and during selection screen processing, the next event in the prescribed sequence is always called. From the AT SELECTION-SCREEN event onwards, the system always jumps from a STOP statement directly to the END-OF-SELECTION statement. Once the corresponding event block has been processed, the system displays the list.

The following program is connected to the logical database F1S.

REPORT EVENT_TEST.

NODES: SPFLI, SFLIGHT, SBOOK.

START-OF-SELECTION.

WRITE 'Test program for STOP'.

GET SBOOK.

WRITE: 'Bookid', SBOOK-BOOKID.

STOP.

END-OF-SELECTION.

WRITE: / 'End of Selection'.

This produces the following output:

Test Program for STOP

Bookid 00010001

End of Selection

As soon as the first line of SBOOK has been read, the system calls the END-OF-SELECTION event block.

Exiting Event Blocks Using EXIT

If you use the EXIT statement within an event block but not in a loop, the system stops processing the block immediately. The ABAP runtime environment triggers the next event according to the following diagram:

Before and during selection screen processing, the next event in the prescribed sequence is always called. From the START-OF-SELECTION event onwards, the system starts the list processor directly when the EXITstatement occurs, and displays the list.

If the EXIT statement occurs inside a DO, WHILE, or LOOP loop, it is the loop that terminates, not the processing block.

The following executable program is connected to the logical database F1S.

REPORT demo_program_exit_1.

NODES: spfli, sflight, sbook.

START-OF-SELECTION.

WRITE 'Test Program for EXIT'.

GET sbook.

WRITE: 'Bookid', sbook-bookid.

EXIT.

END-OF-SELECTION.

WRITE: / 'End of selection'.

This produces the following output:

Test Program for EXIT

Bookid 00010001

After the first line of SBOOK has been read, the list is displayed immediately.

The following executable program is connected to the logical database F1S.

REPORT demo_program_exit_2.

NODES: spfli, sflight, sbook.

DATA flag(1) TYPE c.

AT SELECTION-SCREEN.

IF carrid-low IS INITIAL.

flag = 'X'.

EXIT.

ENDIF.

START-OF-SELECTION.

IF flag = 'X'.

WRITE / 'No input for CARRID'.

EXIT.

ENDIF.

GET spfli.

GET sflight.

GET sbook.

END-OF-SELECTION.

WRITE / 'End of Selection'.

If the user does not enter a value for CARRID-LOW, the output appears as follows:

No selection made for CARRID

After the first EXIT statement, the next START-OF-SELECTION event is triggered. After the second EXITstatement, the output list is displayed.

Regards.