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: 

END-OF-SELECTION

Former Member
0 Kudos

END-OF-SELCTION IS OPTIONAL, SO,

WHAT IS THE USE OF END-OF-SELECTION?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Suresh,

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.

Don't forget to reward if useful

5 REPLIES 5

Former Member
0 Kudos

Former Member
0 Kudos

Hi,

End-of-Selection can be used to free variables, memory and Internal tables.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.

Hope this helps.

Thanks,

Srinivasa

Message was edited by:

Srinivasa

Former Member
0 Kudos

RS is right, we use it in conjunction with a logical database. For instance, my area often has to create reports for HR. So the main part of our report code will look something like this:

START-OF-SELECTION.

GET PERNR.

*coding here to use information from various infotype records for that pernr,

*and do assorted processing relating just to that particular pernr

END-OF-SELECTION.

*coding here to write out any totals or perform any processing for the end of the report

The START-OF-SELECTION and END-OF-SELECTION statements sort of frame the bulk of your processing. If you are using a logical database statement like GET PERNR, then when the END-OF-SELECTION statement is reached the processing loops back to GET PERNR. I hope this helps.

- April King

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 the data that the program has stored in internal tables or extracts during the various GET events.

Regards

Chilla

Former Member
0 Kudos

Suresh,

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.

Don't forget to reward if useful