Skip to Content
author's profile photo
Former Member

Error Msg in Select Statement

Hi,

Can you declare an error message under select statement?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Posted on Aug 22, 2007 at 06:31 AM

    Hi..

    You can use the Message statement for this..

    PARAMETERS: P_MATNR TYPE MARA-MATNR.

    AT SELECTION-SCREEN ON P_MATNR.

    SELECT SINGLE * FROM MARA WHERE MATNR = P_MATNR.

    IF SY-SUBRC NE 0.

    <b> MESSAGE E100(ZCLASS).</b>

    ENDIF.

    <b>Reward if Helpful</b>

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 22, 2007 at 06:34 AM

    Hi

    AT SELECTION-SCREEN ON P_MATNR.

    SELECT SINGLE * FROM MARA WHERE MATNR = P_MATNR.

    IF SY-SUBRC NE 0.

    MESSAGE E000(Z00) WITH 'NO MATNR EXISTS'.

    CLOSE ALL U R THREADS.

    KIRAN.M

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 22, 2007 at 06:38 AM

    Hi,

    That depends on the event where u have used the error message.

    In selection screen events u can use error message as control stops in selection screen it self. Where as if u used in selection events program execution is terminated by displaying an empty screen. So it is better not to use error message in start of selection events.

    Regards,

    Sankar

    Add comment
    10|10000 characters needed characters exceeded