Skip to Content
avatar image
Former Member

Hi plz help me this question ASAP

without writing start-of-selection-screen we can write end of selection screen and wise versa then what is the use.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Aug 22, 2007 at 06:45 AM

    Hi Kirankumar,

    Actually the events START-OF-SELECTION and END-OF-SELECTION is very useful when we are making use of Logical Database in our program.

    When you are retreiving data using LDB and you are processing the data, with out event END-OF-SELECTION the program will be in endless loop. Only when this event is triggered, program will execute the further code and will output the results if any.

    In normal cases, though the event is triggered, it is not of much use having them. Just for clarity of code and modularity we use those events in normal programming.

    <i>Reward points for informative answers.</i>

    Best Regards,

    Ram.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 22, 2007 at 06:45 AM

    START-OF-SELECTION

    This event keyword defines an event block for which the event is triggered by the ABAP runtime environment during the flow of an executable program and before any selection screens are processed.

    In an executable program, all statements that are not declarations and that are listed before the first explicit processing block, or 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.

    If the program is linked to a logical database, preparatory tasks can be performed at START-OF-SELECTION before the logical database imports the data. If the program is not linked to a logical database, this event block becomes a type of "main program" from which procedures or screens are called.

    END-OF-SELECTION

    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.

    In this event block, all data read by the logical data base , can be processed summarically. In an executable program without logical data base, there is no need to implement the event block END-OF-SELECTION.

    There is no syntax for start-of-selection-screen.

    SAP has provided F1 documentation for all the key-words. Press F1 whenever in doubt 😊

    Reward points if helpful.

    Cheers,

    Sandeep

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 06:56 AM

    The sequence in which the processing blocks occur in the program is irrelevant. The actual processing sequence is determined by the external events. However, to make your programs easier to understand, you should include the event blocks in your program in approximately the same order in which they will be called by the system. Subroutines should be placed at the end of the program.

    Statements that are not assigned to a processing block are never executed. An exception to this are any non-declarative statements between the REPORT or PROGRAM statement and the first processing block, which are assigned to the default event

    <b>START-OF-SELECTION</b> if a program does not contain an explicit <b>START-OF-SELECTION</b> block, these statements form the entire <b>START-OF-SELECTION</b> block. If a <b>START-OF-SELECTION</b> keyword is already included in your program, these statements are inserted at the beginning of this block. If the program does not contain any explicit event blocks, all non-declarative statements are assigned to the default processing block <b>START-OF-SELECTION.</b>

    There can be many scenarios

    <b>SCENARIO 1:</b>

    REPORT ZTEMP .

    FORM ROUTINE.

    WRITE / 'Subroutine'.

    ENDFORM.

    WRITE / 'Statement 1'.

    START-OF-SELECTION.

    WRITE / 'Statement 2'.

    PERFORM ROUTINE.

    WRITE / 'Statement 3'.

    *END-OF-SELECTION.

    This code wont give an error.

    <b>SCENARIO 2:</b>

    REPORT ZTEMP .

    FORM ROUTINE.

    WRITE / 'Subroutine'.

    ENDFORM.

    WRITE / 'Statement 1'.

    START-OF-SELECTION.

    WRITE / 'Statement 2'.

    PERFORM ROUTINE.

    WRITE / 'Statement 3'.

    END-OF-SELECTION.

    This wont give an error either, as both event blocks are present.

    <b>SCENARIO 3:</b>

    RITE / 'Statement 1'.

    FORM ROUTINE.

    WRITE / 'Subroutine'.

    ENDFORM.

    *START-OF-SELECTION.

    WRITE / 'Statement 2'.

    PERFORM ROUTINE.

    WRITE / 'Statement 3'.

    END-OF-SELECTION.

    This woul dgive an error, as start of selection is not present, and we use end of selection.

    Hope this answers your question.

    <b>Reward if helpful</b>

    Add comment
    10|10000 characters needed characters exceeded