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

Screen

Hi ,

Pls tell me the diff bet leave screen/leave to screen and call screen

Nitin

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2008 at 08:32 AM

    Hi,

    Calling Screens Internally from the Same ABAP Program

    In any ABAP program that can have its own screens (type 1, M, or F), you can use the

    CALL SCREEN <dynnr>.

    statement to call a screen and its subsequent sequence within that program. The flow logic of each screen calls dialog modules in the program that called the screen.

    When the screen sequence ends, control returns to the statement after the original CALL SCREEN statement.

    Leaving a Screen Sequence

    A screen sequence terminates when a screen ends and the defined next screen has the number 0.

    You can leave a single screen within a sequence using the

    LEAVE SCREEN.

    or

    LEAVE TO SCREEN <dynnr>.

    statement. These statements exit the current screen and call the defined next screen. If the next screen is screen 0, the entire screen sequence concludes.

    CALL SCREEN xxx- It will go to a new screen. If u press back it will come back to the screen from where u have called the new screen.

    LEAVE TO SCREEN xxx - It will go to a new screen. If u press back it will NOT go back to the screen from where u have called the new screen instead it will exit.

    Regards,

    Priyanka.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2008 at 08:54 AM

    Hi,

    Leave Screen:-

    The LEAVE SCREEN statement ends the current screen and calls the subsequent screen.

    When the system encounters the “SET SCREEN <screen #>” ABAP statement, it temporarily overrides the “Next Screen” attribute with this <screen #> and the PAI processing continues. After all PAI modules are executed, the system goes to the PBO event of

    <screen #>.

    LEAVE TO SCREEN:-

    “LEAVE TO SCREEN <screen #>” ABAP statement, terminates the screen’s PAI event and immediately goes to the PBO of <screen #>.

    The “LEAVE TO SCREEN <screen #> statement performs the functionality of two statements: “SET SCREEN <screen #>“ and “LEAVE SCREEN”.

    “CALL SCREEN

    “CALL SCREEN <screen #>” ABAP statement, temporarily suspends the current screen’s PAI processing and immediately goes to the PBO event of <screen #>. When control returns back to the “calling” screen, its PAI processing will resume.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2008 at 08:55 AM

    Hi Nitin,

    Differences

    1. Leave Screen - Leaves the current screen on which it is lying.

    2. Leave to Screen - the Screen which need to be called .

    module PAI.

    case sy-ucomm.

    when 'CALL'.

    leave screen .

    call screen 100.

    endcase.

    -


    is same as

    -


    is module PAI.

    case sy-ucomm.

    when 'CALL'.

    leave to screen 100.

    endcase.

    Rewards,

    Madhavi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 19, 2008 at 04:35 PM

    ==> Determining the Next Screen

    The next screen is entered statically in the screen attributes.

    At runtime, you can temporarily override the static next screen using the SET SCREEN statement.

    1. --> Static Screen Sequences

    You can establish a static sequence of screens by entering a value in the Next

    screen field of the screen attributes.

    If you enter 0 or no value as the next screen, the system resumes processing

    from the point at which the screen was initiated, once it has finished processing

    the screen itself.

    2. --> Setting the Next Screen Dynamically

    The SET SCREEN statement temporarily overwrites the Next screen attribute.

    The screen must belong to the same program. The next screen is processed either when the current screen processing ends, or when you terminate it using the LEAVE SCREEN statement.

    To specify the next screen and leave the current screen in a single step, use the

    LEAVE TO SCREEN statement.

    3. --> Inserting Screen Sequences

    You can insert a screen sequence. This adds another layer to a stack.

    You insert a screen sequence using the CALL SCREEN statement.

    To interrupt processing of the current screen and branch to a new screen or

    sequence of screens, use the CALL SCREEN statement. The screen must belong

    to the same program.

    In the program, the system constructs a stack.

    To return to the statement following the CALL SCREEN statement, you can use

    either SET SCREEN 0. LEAVE SCREEN. or LEAVE TO SCREEN 0. The screen

    that called the other screen is then processed further.

    If you use the above statements outside a call chain, the program terminates, and

    control returns to the point from which it was called. You can also terminate a

    program using the ABAP statement LEAVE PROGRAM.

    Points !!

    Abhijith.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 24, 2008 at 12:08 PM

    hi

    CALL SCREEN <sno>

    CALL SCREEN is used to insert a set of screen sequences dynamically. Processing will return to the current screen.

    LEAVE SCREEN

    LEAVE SCREEN will leave the processing of the current screen immediately and leave to the processing of the next screen which is defined either statically or dynamically. Processing will not return to the current screen.

    LEAVE TO SCREEN <sno>

    LEAVE TO SCREEN behaves like set screen + leave screen together.

    Thanks and regards

    palak behal

    reward if helpful

    Edited by: palak behal on Mar 24, 2008 1:11 PM

    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.