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

about events

I need how the following events work with a sample program

1) LOAD OF PROGRAM

2)INITIALIZATION

3)START-OF-SELECTION

4)END-OF-SELECTION

5)TOP-OF-PAGE

I need to c how those events trigger

so plz give me a simple code

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 07:30 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 07:33 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 08:00 AM

    hi,

    load of program

    initialization

    start of selection

    top-of-page

    end-of-selection

    this i the order in which is triggered

    in initialization u r calculating loer range and then filling in the criteria and this can be done in initilisation part

    ex:

    data:date1 type sy-datum.

    date1= sy-datum -30.

    f1date = date1.

    start-of-selection.

    once all the events are triggered for selection screen,the data is retrieved from database table

    ex:

    select * from mara into table it_tab upto 0 rows

    top-of-page

    this event is triggered with first write statement or whenever new page is triggered

    ex

    top-of-page

    write:'hello'.

    end-of-page

    this event is triggered when end of page is reached

    write:sy-pagno.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 08:02 AM

    during debugging u can see the events triggering

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 08:19 AM

    Hi Krishna Kishore,

    Try debugging this program and keep watch on value of var.

    (debug right from where you execute the program, also continue debugging while pressing F8 from selection screen)

    parameters : var type i.

    LOAD-OF-PROGRAM.

    var = var + 1.

    iNITIALIZATION.

    var = var + 1.

    START-OF-SELECTION.

    var = var + 1.

    END-OF-SELECTION.

    var = var + 1.

    write : 'End of selection'.

    TOP-OF-PAGE.

    write : 'Top of Page'.

    var = var + 1.

    Note : Function of Load of program will not be very clear from above code.. Whenever program is loaded in memory it will trigger Load of Program.. While Initialization is triggered before selection screen is displayed...

    When write statement is encountered TOP OF PAGE is triggered. Please note that text will not be immediately written to list when write is encountered in END OF SELECTION event in above example.. It will trigger TOP OF PAGE and then execute write statement from END OF SELECTION event. You will observer this from output displayed on list.

    Regards,

    Mohaiyuddin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 09:00 AM

    Hi Krishna Kishore,

    I will develop a small code 4 u check it once.Actully LOAD-OF-PROGRAM automatically triggers we dont want to call explicitly..

    copy the below code and execute it ok..

    SAMPLE CODE:

    *Tables

    TABLES:vbap.

    *Internal Table

    DATA:BEGIN OF itab OCCURS 0,

    vbeln LIKE vbap-vbeln,

    posnr LIKE vbap-posnr,

    END OF itab.

    *select-options

    SELECT-OPTIONS:s_vbeln FOR vbap-vbeln.

    *Initilization

    INITIALIZATION.

    s_vbeln-sign = 'I'.

    s_vbeln-option = 'BT'.

    s_vbeln-low ='4969'.

    s_vbeln-high = '5000'.

    APPEND s_vbeln .

    *Start of selection

    START-OF-SELECTION.

    SELECT vbeln posnr FROM vbap INTO TABLE itab WHERE vbeln IN s_vbeln.

    *End of Selection

    END-OF-SELECTION.

    LOOP AT itab.

    WRITE:/ itab-vbeln, 20 itab-posnr.

    ENDLOOP.

    *Top of Page

    TOP-OF-PAGE.

    WRITE: / 'SALES ORDER REPORT'.

    ULINE.

    Award points if helpful

    Kiran Kumar.G.A

    Have a Nice Day..

    Edited by: KIRAN KUMAR on Jan 9, 2008 10:38 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 12:49 PM

    Hi,

    Initialization - Triggers every time .

    Start - of-selection - Its a default event.

    Top-of-page - Before triggering the 1st write statement in start-of-selection,the write statement in top-of-page event triggers 1st.

    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.