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

Selection Screen Problem

Hi Experts,

I have one query. My requirement is that based on selection screen input, If I don't find any data then I wanted to display an error message & come back to my selection screen.

I wrote the logic as

If ITAB[] IS NOT INITIAL.

MESSAGE E000 WITH TEXT-M01.

ENDIF.

But It is not coming back to my selection screen. Any suggestion how I can achieve the requirement?

Regards,

Poonam

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • Posted on Dec 23, 2008 at 03:38 AM

    Hi

    If you dont find any data then you need write the IF condition

    if itab[] is initial.

    message 'No data found' type 'E'.

    leave to screen 0.

    endif.

    Best Regards

    Ramchander Rao.K

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 03:56 AM

    Hi

    If you have written code in at selection screen use Leave list-processing.

    If ITAB[] IS NOT INITIAL.

    MESSAGE E000 WITH TEXT-M01.

    Leave list-processing.

    ENDIF

    Shiva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 03:57 AM

    Hi,

    Do this way...

    at selection-screen on p_file. u201Cp_file is parameter on selection-screen

    *---checking file exist or not in AS

    put you select query here.....

    If ITAB[] IS NOT INITIAL.

    MESSAGE E000 WITH TEXT-M01.

    ENDIF.

    Thanks & Regards,

    Krishna..

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 23, 2008 at 03:58 AM

    Hi,

    - in START-OF-SELECTION

    event do your data retrievals,

    select *

    from table.

    if sy-subrc <> 0.

    stop.

    endif.

    - in END-OF-SELECTION event

    If ITAB[] IS NOT INITIAL.

    MESSAGE s000 WITH TEXT-M01.

    ENDIF.

    You should display am information message since no errors were found but data entered in selection screen is valid. Its just that no valid data was retrieved from database.

    Regards,

    Dev.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 23, 2008 at 04:28 AM

    Hi,

    You need to check for data at AT SELECTION-SCREEN event. While processing START-OF-SELECTION you can never go back to your selection screen by throwing an error message.

    Regards,

    Antony

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 04:47 AM

    Hi,

    Try this...

    if itab[] is initial.

    message 'XXXXX' type 'I' as 'E'.

    leave to screen 0.

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 05:14 AM

    Hi,

    You need to write this code under the event AT SELECTION SCREEN.

    it will then return to selection screen.

    -Raj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 05:16 AM

    Hi

    You can try it like this

    if itab[] is initial.

    MESSAGE 'PLEASE CHECK THE ENTRY' TYPE 'E'.

    else.

    Message----


    .

    you wont to exit the selection screen when there is no match fir ur perticular condition hence its better if you use ita[] is initial.

    hence whenever there is no match fr the particular condition it will give u this message

    regards

    sumeet malhotra

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      U cant come back to the selection screen if u are passing the error message .

      U need to write as follow.

      If not itab[] is initial.

      Message text-001 type 'I'.

      Leave List-processing.

      endif.

      This will definately work.

      Regards,

      Naresh.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 05:21 AM

    Hi,

    try this

    at selection-screen on s_bukrs (Ur screen input).

    select single bukrs from t001 into it_t00l where bukrs in s_bukrs.( Ur selection )

    if sy-subrc <> 0.

    message E000 with text-001.

    exit.

    endif.

    it will work for requirement.

    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.