Skip to Content
author's profile photo Former Member
Former Member

End-of-selection

Hi All

What is the purpose of end-of-selection.

When is end-of-selection is triggered.

In which condition the end-of-selection is used.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 05:56 AM

    Hiiii..

    when the STOP statement is triggerd in between the programming ...

    END OF SELECTION gets triggerd...

    reagrds

    chandu reddy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 05:56 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 05:56 AM

    Hi,

    Refer

    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.

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

    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/end_of_s.htm

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 05:59 AM

    Hi Vasudevan,

    START-OF-SELECTION.

    LOOP AT IT_KNA1 INTO WA_KNA1.

    IF WA_KNA1-KUNNR = 1000.

    STOP.

    ENDIF.

    ENDLOOP.

    END-OF-SELECTION.

    WRITE: / '1000th customer is encountered'.

    If you could have been used STOP statement in a loop and end loop, that STOP statement searches for END-OF-SELECTION event and triggers it immediately. If END-OF-SELECTION is not found, then the output will be displayed.

    STOP statement in END-OF-SELECTION will not reflects as a recursion.

    thanks & regards

    Kishore Kumar Maram

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 05:59 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 06:00 AM

    Hi,

    End-Of-Selection is the one time event in the report programming and will be triggered when STOP statement is used and also triggered after the retrieval of data from the logical database. Mostly end-of-selection is used for output purpose.

    Effect

    This statement defines an event block, whose event is raised by the ABAP-runtime environment during the calling of an executable program , if the logical database, with which the program is linked, has completely finished its work.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 06:01 AM

    Hi,

    I hope this helps.

    ==============

    end_of_selection 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 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.

    =======

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 06:03 AM

    Hi,

    Please refer the piece of code and put a break point and debug the program you will come to know which event will trigger and etc.

    
    initialization.
    
    write : 'At initialization'.
    
    Top-of-page.
    write : 'At Top Of Page'.
    
    start-of-selection.
    write : 'At Start of selection'.
    
    end-of-selection.
    write : 'At end of selection'.
    
    "Generally end-of-selection is used to display the output.
    

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.