04-13-2007 6:50 PM
END-OF-SELCTION IS OPTIONAL, SO,
WHAT IS THE USE OF END-OF-SELECTION?
04-16-2007 3:56 AM
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
04-13-2007 6:59 PM
Hi,
END-OF-SELECTION makes more sense when you are using logical database in your program.
See these links.
http://help.sap.com/saphelp_46c/helpdata/en/34/8e74266df74873e10000009b38f9b8/frameset.htm
http://help.sap.com/saphelp_46c/helpdata/en/9f/db9aca35c111d1829f0000e829fbfe/frameset.htm
Regards,
RS
04-13-2007 7:33 PM
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
04-13-2007 7:51 PM
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
04-15-2007 11:41 AM
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
04-16-2007 3:56 AM
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