cancel
Showing results for 
Search instead for 
Did you mean: 

End-of-selection

former_member549415
Participant
0 Kudos

Hi all,

what exactly use of END-OF-SELECTIO in the report...?

is it optional or mandetory..?

please guide..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

END-OF-SELECTION : TO FREE THE MEMORY , NO NEED OF USING THIS SPECIALLY

The END-OF-SELECTION event is triggered in type 1 programs once the logical database has finished reading all data and before the list processor is started.

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi,

This is the last of the events called by the runtime environment to occur.

It is triggered after all of the data has been read from the logical database,

and before the list processor is started. You can use the corresponding event

block to process and format all data that the program has stored in sequential

datasets, such as internal tables or extracts, during the various GET events.

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

REPORT demo_program_end_of_selection.

NODES spfli.

DATA: spfli_tab TYPE SORTED TABLE OF spfli

WITH UNIQUE KEY cityfrom cityto carrid connid,

spfli_line TYPE spfli.

START-OF-SELECTION.

WRITE 'Demo program for END-OF-SELECTION'.

SKIP.

GET spfli FIELDS carrid connid cityfrom cityto.

MOVE-CORRESPONDING spfli TO spfli_line.

INSERT spfli_line INTO TABLE spfli_tab.

END-OF-SELECTION.

LOOP AT spfli_tab INTO spfli_line.

WRITE: / spfli_line-cityfrom,

spfli_line-cityto,

spfli_line-carrid,

spfli_line-connid.

ENDLOOP.

with regards,

sowjanyagosala

Former Member
0 Kudos

Hi,

Please go Through this

Hope this is Enough

Reward Points, Dont Forget

Fareeda

END-OF-SELECTION: This event is triggered after the START-OF-SELECTION is completed.

This event is used when there is use of logical data base in the report. It is triggered 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. This 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 base, 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 encounters a START-OF-SELECTION statement and the lock is released when an END-OF-SELECTION statement is encountered (to maintain the consistency). Data selection is done between START-OF-SELECTION and END-OF-SELECTION. Now if we don’t write the END-OF-SELECTION statement, the database will remain locked till the programs get terminated. Hence, the performance will be reduced. So it is always good practice to write END-OF-SELECTION statement after finishing the data selection from database.

Former Member
0 Kudos

Hi

The purpose of the END-OF -SELECTION is to write anything

at the end of the list.

syntax:

END-OF-SELECTION.

write:/ ' end '.

END-OF-SELECTION is an optional event.

Former Member
0 Kudos

END-OF-SELECTION is Optional.

After all the data has been selected END-OF-SELECTION event writes the data to the screen

The END-OF-SELECTION event is triggered in executable programs once the logical database has finished reading all data and before the list processor is started.

Try to go thro this link.

http://help.sap.com/saphelp_46c/helpdata/en/9f/db9a1435c111d1829f0000e829fbfe/frameset.htm

Mostly end-of-selection is used in logical data base. It is not mandatory.

Ex:

If you use a logical database in your report then this event is mandatory because when all the data selection from the database is finished this events get triggers.

For example if you are populating a internal table using a logical data base event 'GET' then you need this event because if you don't use this you get display again and again for each selection.

START-OF-SELECTION.

GET PERNR.

itab-pernr = pernr-pernr.

append itab.

*this get triggers after all selection from database.

END-OF-SELECTION.

loop at itab.

write:/ itab-pernr.

endloop.

CHeck this for more.

http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db9aca35c111d1829f0000e829fbfe/frameset.htm

Former Member
0 Kudos

Hi,

It is used after the end of all data fetching and modifying and to free the internal table memory finally

for more information

http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9aca35c111d1829f0000e829fbfe/content.htm

Regards

Shiva

Former Member
0 Kudos

hI

After all data has been read by the logical database

Data which is selected and has been processed is printed to the screen in this block.

List Processing happens in this block

This is the last of the events called by the runtime environment to occur. It is triggered after all of the data has been read from the logical database, and before the list processor is started. You can use the corresponding event block to process and format all data that the program has stored in sequential datasets, such as internal tables or extracts, during the various GET events.

REPORT EVENT_DEMO.

NODES SPFLI.

DATA: SPFLI_TAB TYPE SORTED TABLE OF SPFLI

WITH UNIQUE KEY CITYFROM CITYTO CARRID CONNID,

SPFLI_LINE TYPE SPFLI.

START-OF-SELECTION.

WRITE 'Demo program for END-OF-SELECTION'.

SKIP.

GET SPFLI FIELDS CARRID CONNID CITYFROM CITYTO.

MOVE-CORRESPONDING SPFLI TO SPFLI_LINE.

INSERT SPFLI_LINE INTO TABLE SPFLI_TAB.

END-OF-SELECTION.

LOOP AT SPFLI_TAB INTO SPFLI_LINE.

WRITE: / SPFLI_LINE-CITYFROM,

SPFLI_LINE-CITYTO,

SPFLI_LINE-CARRID,

SPFLI_LINE-CONNID.

ENDLOOP.

Former Member
0 Kudos

Hi

it is optional .

Actually it is taken care by the ABAP runtime envr.

Like

if the program does not contain any explicit processing blocks, then all functional statements of the program, are assigned to an implicit event block START-OF-SELECTION, which is inserted before any START-OF-SELECTION event blocks.

similarly end-of-selection is also inserted automatically by the system

for more info u can just write endofselection key word inthe se38 screen and press f1 .

Reward if helpful

Thanks

Krushna