<?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: Selection Screen Disappearing on error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001668#M1164645</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of executing program from Transaction SE38 (Driver Program) I was executing Smartforms program without making TCODE for the same and that was the reason, after showing error Selection Screen was getting blank. As I was directed from ABAP IBM Team Lead to do on my own and I was ignore in this case. So please pardon me for that, and many many thanks to who so ever reply my post. Once again Sorry for posting such a silly question, and thanks for replies. - Yogesh Pathak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Jan 2009 11:39:26 GMT</pubDate>
    <dc:creator>yogesh_pathak</dc:creator>
    <dc:date>2009-01-08T11:39:26Z</dc:date>
    <item>
      <title>Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001651#M1164628</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;I am new to ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the driver program for Smartform, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step-1 Entering data at selection screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step-2 Pressing Execution Button&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An error is displaying 'Document no. not found' but the problem is, &lt;STRONG&gt;as soon as the error appears, selection screen goes blank, its not staying&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest correction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With warm regards.&lt;/P&gt;&lt;P&gt;Yogesh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  Z_MM_GPASS
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*

REPORT  Z_MM_GPASS.

tables: MSEG,ADRC,T001W,MAKT .
data: FM_NAME TYPE RS38L_FNAM.

*&amp;amp; Selection Screen
Selection-screen: begin of block b1 with frame title t1.
Parameter:   Docno   like      MSEG-MBLNR ,
             YEAR    like      MSEG-MJAHR .
selection-screen: end of block b1.

*&amp;amp; Comment on selection screen
At selection-screen output .
t1 = 'Selection-Screen' .

*&amp;amp; Data validation at selection screen
At selection-screen .
select single * from MSEG where MBLNR = docno and MJAHR = YEAR .

if sy-subrc &amp;lt;&amp;gt; 0.
message 'Document no. not found' type 'E'.
endif.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    FORMNAME                 = 'Z_MM_PASS'
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
 IMPORTING
   FM_NAME                  = FM_NAME
 EXCEPTIONS
   NO_FORM                  = 1
   NO_FUNCTION_MODULE       = 2
   OTHERS                   = 3
          .
IF SY-SUBRC &amp;lt;&amp;gt; 0.
*  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

CALL FUNCTION FM_NAME
  EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
*   CONTROL_PARAMETERS         =
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
    DOCNO                      = DOCNO
    YEAR                       = YEAR
* IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*   JOB_OUTPUT_INFO            =
*   JOB_OUTPUT_OPTIONS         =
* EXCEPTIONS
*   FORMATTING_ERROR           = 1
*   INTERNAL_ERROR             = 2
*   SEND_ERROR                 = 3
*   USER_CANCELED              = 4
*   OTHERS                     = 5
          .
IF SY-SUBRC &amp;lt;&amp;gt; 0.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formattted by: Alvaro Tejada Galindo on Jan 7, 2009 2:30 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 07:40:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001651#M1164628</guid>
      <dc:creator>yogesh_pathak</dc:creator>
      <dc:date>2009-01-07T07:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001652#M1164629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please keep a break point and check if the correct document number is passed. Looks like exception is triggered stating : 'Document Number not found'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 07:43:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001652#M1164629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T07:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001653#M1164630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are not catching the error returning from one of your function modules correctly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF SY-SUBRC 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO 
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. 
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is why you screen is returning blank.Check the return code yourself and do something like this, depending on your requirement of course:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF sy-subrc &amp;lt;&amp;gt; 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 
                INTO mtext 
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 
write:/1 mtext.
      ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Micky Oestreich on Jan 7, 2009 8:51 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 2:31 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 07:51:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001653#M1164630</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-01-07T07:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001654#M1164631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks 4 ur answer.&lt;/P&gt;&lt;P&gt;On passing valid Document Number and Year output of the smartform is coming properly, but this is not done.&lt;/P&gt;&lt;P&gt;FYKK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 07:52:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001654#M1164631</guid>
      <dc:creator>yogesh_pathak</dc:creator>
      <dc:date>2009-01-07T07:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001655#M1164632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have replaced (1) with (2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if sy-subrc &amp;lt;&amp;gt; 0.
message 'Document no. not found' type 'E'.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
INTO mtext
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
write:/1 mtext.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program syntactically correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but still I'm facing the same problem, for your kind knowledge I don't know what is return code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 2:32 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 08:08:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001655#M1164632</guid>
      <dc:creator>yogesh_pathak</dc:creator>
      <dc:date>2009-01-07T08:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001656#M1164633</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;whenever you get an error message just display your error like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4 DISPLAY LIKE 'E'.
STOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dev.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 2:33 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 08:14:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001656#M1164633</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2009-01-07T08:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001657#M1164634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*I have replaced&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if sy-subrc &amp;lt;&amp;gt; 0.
message 'Document no. not found' type 'E'.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;with&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
INTO mtext
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
write:/1 mtext.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Program sintactically correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*but still I'm facing the same problem, for your kind knowledge I don't know what is return code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Yogesh Pathak on Jan 7, 2009 9:45 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Messege posted more than one time due to "SERVER ERROR" while posting., sorry for inconvenience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 2:34 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 08:15:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001657#M1164634</guid>
      <dc:creator>yogesh_pathak</dc:creator>
      <dc:date>2009-01-07T08:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001658#M1164635</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;The program terminates when type E error ocurs..hence in your case try to use Type 'I'..information&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vasavi Kotha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 08:31:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001658#M1164635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T08:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001659#M1164636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your understanding, the return code = SY-SUBRC.&lt;/P&gt;&lt;P&gt;If SY-SUBRC &amp;lt;&amp;gt; 0 (in case of function modules), this normally means something went 'wrong', in this case the document was not found.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 08:37:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001659#M1164636</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-01-07T08:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001660#M1164637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First I want to apoligize for the fact that my first reply was not correct, since I was looking at the wrong return code. Your problem is not caused by the function modules (return codes from that) but by the first return code after the select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recreated your report, but I don't seem to have this problem. Is this all the coding your are using, or has something changed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 08:51:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001660#M1164637</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-01-07T08:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001661#M1164638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;same result&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 08:54:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001661#M1164638</guid>
      <dc:creator>yogesh_pathak</dc:creator>
      <dc:date>2009-01-07T08:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001662#M1164639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please dont apoligize and thanks for your reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after this driver program Smartform remains.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 08:57:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001662#M1164639</guid>
      <dc:creator>yogesh_pathak</dc:creator>
      <dc:date>2009-01-07T08:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001663#M1164640</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;Thanks for your reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried with &lt;STRONG&gt;'I'&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the result is same&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 09:01:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001663#M1164640</guid>
      <dc:creator>yogesh_pathak</dc:creator>
      <dc:date>2009-01-07T09:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001664#M1164641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yogesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Welcome to SDN &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp; Data validation at selection screen
At selection-screen .
select single * from MSEG where MBLNR = docno and MJAHR = YEAR .

if sy-subrc 0.
message 'Document no. not found' type 'E'.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change this to:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp; Data validation at selection screen
At selection-screen .
select single * from MSEG where MBLNR = docno and MJAHR = YEAR .

if sy-subrc 0.
* message 'Document no. not found' type 'E'.
message 'Document no. not found' type 'I'.
LEAVE LIST-PROCESSING.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will solve the problem. You will get an information msg &amp;amp; will be directed back to the selectn-screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;SUhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 09:01:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001664#M1164641</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-01-07T09:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001665#M1164642</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;after your validation please put the START-OF-SELECTION block before calling the smartform,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp; Data validation at selection screen
AT SELECTION-SCREEN .
  SELECT SINGLE * FROM mseg WHERE mblnr = docno AND mjahr = year .

  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE 'Document no. not found' TYPE 'E'.
  ENDIF.


START-OF-SELECTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 2:35 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 09:10:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001665#M1164642</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2009-01-07T09:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001666#M1164643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi yogesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when never you are using events like at selection-screen output, at selection-screen you must be carefull.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     I think you are not used the event 'START-OF-SELECTION'  at the begining of the FM 'SSF_FUNCTION_MODULE_NAME'. use that event your problem will be solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 09:15:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001666#M1164643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T09:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001667#M1164644</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;Thanks for your reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done the same, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Information messages came, output of the form came on screen, with document no entered on selection screen, which was wrong document number.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 09:41:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001667#M1164644</guid>
      <dc:creator>yogesh_pathak</dc:creator>
      <dc:date>2009-01-07T09:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Disappearing on error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001668#M1164645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of executing program from Transaction SE38 (Driver Program) I was executing Smartforms program without making TCODE for the same and that was the reason, after showing error Selection Screen was getting blank. As I was directed from ABAP IBM Team Lead to do on my own and I was ignore in this case. So please pardon me for that, and many many thanks to who so ever reply my post. Once again Sorry for posting such a silly question, and thanks for replies. - Yogesh Pathak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2009 11:39:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-disappearing-on-error/m-p/5001668#M1164645</guid>
      <dc:creator>yogesh_pathak</dc:creator>
      <dc:date>2009-01-08T11:39:26Z</dc:date>
    </item>
  </channel>
</rss>

