<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LEAVE SCREEN Code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660116#M1446180</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case if you returned your code exact code which is working in irrelavant events such as PBO or PAI you need to check that properly.&lt;/P&gt;&lt;P&gt;IF you are using function exit for the exit button try changing the value to 'E' instead of 'X' play with those things and it will get exited.&lt;/P&gt;&lt;P&gt;Try and change these options when using LEAVE TO SCREEN statements in Module programming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;~Sakthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Mar 2010 09:32:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-03T09:32:12Z</dc:date>
    <item>
      <title>LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660106#M1446170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In following code ,  LEAVE SCREEN statement is not working. When I check the EXIT CHKBOX, EXIT contains the "X", but it does not leave the screen. It goes back to input field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone has idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
tables :zekko.

data : EXIT(1) TYPE C
data : wa_ekko like zekko.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  INIT_SCREEN_100  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE INIT_SCREEN_100 OUTPUT.

  MOVE-CORRESPONDING WA_EKKO TO ZEKKO.
  CLEAR WA_EKKO.
*  CLEAR WA_EKKO.

ENDMODULE.                 " INIT_SCREEN_100  OUTPUT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0100  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.

  move zekko-ebeln to wa_ekko-ebeln.
  SELECT SINGLE
      EBELN BUKRS BSART LOEKZ AEDAT ERNAM LIFNR
      INTO CORRESPONDING FIELDS OF WA_EKKO
      FROM EKKO
      WHERE EBELN eq WA_EKKO-EBELN.

  IF EXIT NE SPACE.  "zekko-mark = 'X'.
    LEAVE SCREEN.
  ENDIF.

ENDMODULE.                 " USER_COMMAND_0100  INPUT
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maverick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 06:03:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660106#M1446170</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T06:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660107#M1446171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try LEAVE PROGRAM instead of leave screen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 06:07:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660107#M1446171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T06:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660108#M1446172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SET SCREEN 0.&lt;/P&gt;&lt;P&gt;      LEAVE SCREEN.&lt;/P&gt;&lt;P&gt;      CLEAR screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it is also not working means...use Pf-status..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 06:10:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660108#M1446172</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T06:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660109#M1446173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maverick, for your code to work, use the following alternatives if your intention is to leave the current screen sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Go to the attributes of screen 100, and change the 'NEXT SCREEN' attribute from 100 to 0. Activate the screen.&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;2) Instead of LEAVE SCREEN, say LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, if your intention is to exit the program, use LEAVE PROGRAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 06:12:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660109#M1446173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T06:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660110#M1446174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time to read the online help for LEAVE SCREEN also check the demo program SAPMDEMO_SCREEN_FLOW on how the screen sequences behave.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As suggested just change the LEAVE SCREEN to LEAVE TO SCREEN 0 (you can also use SET SCREEN 0. LEAVE SCREEN if you want to )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Mar 3, 2010 11:48 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 06:13:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660110#M1446174</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-03-03T06:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660111#M1446175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MODULE USER_COMMAND_0100 INPUT.
 
  move zekko-ebeln to wa_ekko-ebeln.
  SELECT SINGLE
      EBELN BUKRS BSART LOEKZ AEDAT ERNAM LIFNR
      INTO CORRESPONDING FIELDS OF WA_EKKO
      FROM EKKO
      WHERE EBELN eq WA_EKKO-EBELN.
 
Make sure the Screen field name should be EXIT then only data transfer takes place. or move explicitly

Change this and Check.
 move ZEKKO-MARK  to EXIT." This moves the value ZEKKO-MARK to EXIT.

  IF  EXIT NE SPACE 
    LEAVE SCREEN.
" LEAVE TO SCREEN 0.
" LEAVE PROGRAM.
" LEAVE TO TRANSACTION etc
  ENDIF.
 
ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheerz&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 06:18:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660111#M1446175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T06:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660112#M1446176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hv set the NEXT SCREEN 0 of screen atributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and tired LEAVE SCREEN and SET SCREEN 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the prob is hen i press ENTER it leaves the screen even without  checking the EXIT chkbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maverick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 08:49:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660112#M1446176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T08:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660113#M1446177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Maverik44,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you should check the value of "EXIT" variable using debugger.&lt;/P&gt;&lt;P&gt;I would suggest you to apply a "break point" on the line&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF  EXIT NE SPACE &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and check the value of "EXIT" by double clicking the variable in the debugger (it will automatically open, once you execute)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is a probably that the value of "EXIT" being not equal to SPACE and hece the code gets executed automatically.&lt;/P&gt;&lt;P&gt; also, I suggest you to use the code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  IF  EXIT NE SPACE 
 LEAVE TO SCREEN 0.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ByTheWay.................&lt;/P&gt;&lt;P&gt;is the the actual code of our MODULE or the trimmed version??&lt;/P&gt;&lt;P&gt;because I cannot see any CASE STATEMENT or OK_CODE code correspondence of the button .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shravan Parepalli.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 09:10:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660113#M1446177</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T09:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660114#M1446178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shravan&lt;/P&gt;&lt;P&gt;Thanks for ur reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hv not used any button. I hv used a CHKBOX instead. and checking the vale of same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And as u suggested, i used break-point, and found EXIT is equal to SPACE. But still the prob is same. Program is exiting unexpedtly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And u can  refer the full code in my post. (question).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maverick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 09:18:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660114#M1446178</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T09:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660115#M1446179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;Hi, 
&amp;lt;li&amp;gt; I think that you are using only one screen. You have one check box and checking and pressing ENTER i believe. I don't know where do you want to leave by writing 'LEAVE SCREEN'. 
&amp;lt;li&amp;gt;If you want to leave the program by checking the check box , write below code . 
  &lt;PRE&gt;&lt;CODE&gt;IF EXIT NE SPACE.  "zekko-mark = 'X'.
    LEAVE PROGRAM. "It comes out of the program . 
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;


Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 09:19:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660115#M1446179</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2010-03-03T09:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660116#M1446180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case if you returned your code exact code which is working in irrelavant events such as PBO or PAI you need to check that properly.&lt;/P&gt;&lt;P&gt;IF you are using function exit for the exit button try changing the value to 'E' instead of 'X' play with those things and it will get exited.&lt;/P&gt;&lt;P&gt;Try and change these options when using LEAVE TO SCREEN statements in Module programming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;~Sakthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 09:32:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660116#M1446180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T09:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660117#M1446181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Maverick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     See your PAI will trigger only after any user action.&lt;/P&gt;&lt;P&gt;If you press enter then your PAI will trigger and your code executes and its exiting.&lt;/P&gt;&lt;P&gt;control with usercommand (sy-ucomm). create an function code in menu painter for enter key and in your PAI check the condition as &lt;/P&gt;&lt;P&gt;IF SY_UCOMM = 'ENTER'.&lt;/P&gt;&lt;P&gt;if CH_BOX = 'X'.&lt;/P&gt;&lt;P&gt;leave to screen 0. or whatelse u need.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;If not please explain me the requirement clearly i will give u the solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 09:32:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660117#M1446181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T09:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660118#M1446182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot for ur guidence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The prob was I had set the NEXT SCREEN 0 ( as suggested) and using the leave screen statement.&lt;/P&gt;&lt;P&gt;I supposed to set the NEXT SCREEN 0100 and  use LEAVE PROGRAM statement ( as i m using single screen only).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now its working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot once again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maverick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 09:46:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660118#M1446182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T09:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660119#M1446183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maverick,&lt;/P&gt;&lt;P&gt;please don't forget the forum rules about how to say thank you to those people who helped you significantly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I see that you finally used LEAVE PROGRAM, which is not really a good practice for leaving a screen, I try to explain how it works, I hope that you'll change your mind &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1) You display the first screen by using CALL SCREEN dynpro_number. It starts what is called a screen sequence.&lt;/P&gt;&lt;P&gt;2) The PBO logic is executed, then the screen is displayed&lt;/P&gt;&lt;P&gt;3) After you pressed a key, the PAI logic is executed&lt;/P&gt;&lt;P&gt;4) After the last PAI module has been executed, SAP displays the next dynpro number defined in the dynpro definition.&lt;/P&gt;&lt;P&gt;5) Dynpro number 0 has a special meaning, it means that the current screen sequence (initiated by CALL SCREEN) has to terminate, i.e. the CALL SCREEN terminates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may use these statements to change the logic:&lt;/P&gt;&lt;P&gt;- [SET SCREEN dynpro_number|http://sandraros.free.fr/abap_docu.htm?url=ABAPSET_SCREEN.htm]: it overrides the next dynpro number defined statically in the dynpro. Note: it is taken into account only when the PAI logic is left.&lt;/P&gt;&lt;P&gt;- [LEAVE SCREEN|http://sandraros.free.fr/abap_docu.htm?url=ABAPSET_SCREEN.htm]: jumps immediately to the end of the last PAI module&lt;/P&gt;&lt;P&gt;- LEAVE TO SCREEN dynpro_number = exactly SET SCREEN dynpro_number followed by LEAVE SCREEN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information, see [Screen Sequences|http://sandraros.free.fr/abap_docu.htm?url=ABENDYNPRO_FLOW_ABEXA.htm]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 12:39:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660119#M1446183</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2010-03-03T12:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660120#M1446184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sandra Rossi    	 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot for ur explanation for LEAVE PROGRAM and LEAVE SCREEN statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"please don't forget the forum rules about how to say thank you to those people who helped you significantly."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think from the above statement u  mean I should give points to relevant answer. &lt;/P&gt;&lt;P&gt;I do take care for this but none of answers were rite.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let  me explain.&lt;/P&gt;&lt;P&gt;I m using only one scree.&lt;/P&gt;&lt;P&gt;I hv 5 button on screen and one I/O field..&lt;/P&gt;&lt;P&gt;When I press any button its get displayed in I/O field. AND when I press EXIT BUTTON (the 5th one) It should exit the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what was happening, If I set the NEXT SCREEN 0 and write LEAVE SCREEN statement, it just leave the program even I press any button except EXIT. Its doe not wait to display the result in I/O fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND when i set the NEXT SCREEN 100 and use LEAVE PROGRAM it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont hv much idea about screen programming. I just learning by my own with the help of experts like u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot once again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maverick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Mar 2010 06:08:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660120#M1446184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-05T06:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: LEAVE SCREEN Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660121#M1446185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; But what was happening, If I set the NEXT SCREEN 0 and write LEAVE SCREEN statement, it just leave the program even I press any button except EXIT. Its doe not wait to display the result in I/O fields.&lt;/P&gt;&lt;P&gt;I guess the &lt;STRONG&gt;EXIT button was defined as type E&lt;/STRONG&gt;, which means that screen values are not transferred to the variables. So, change the button type to space.&lt;/P&gt;&lt;P&gt;If you define dynpro attribute "next screen" as being 0, it means that the screen will always close except if you use SET SCREEN &amp;lt;your dynpro number&amp;gt;. I advise you to let "next screen" attribute equal to the dynpro number, and use SET SCREEN 0 when the exit field is X.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; AND when i set the NEXT SCREEN 100 and use LEAVE PROGRAM it works fine.&lt;/P&gt;&lt;P&gt;you don't need to set the next screen if you use LEAVE PROGRAM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Mar 2010 10:27:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/leave-screen-code/m-p/6660121#M1446185</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2010-03-05T10:27:45Z</dc:date>
    </item>
  </channel>
</rss>

