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

Help needed in displaynig error message

Hi to all kind souls, i am having problem with displaying error message when a invalid field is being input.

The following is my codings:

FORM insert_data.

TABLES z112_work2.

INSERT z112_work2.

IF sy-subrc = 4.

MESSAGE 'Invalid ID.' TYPE 'E'.

ELSE.

MESSAGE 'Inserted Successfully.' TYPE 'I'.

ENDIF.

ENDFORM.

i needed help on the " IF sy-subrc = 4.

MESSAGE 'Invalid ID.' TYPE 'E'. " part as when i activated it, i tried to enter a invalid value on the 1st field it worked but i couldnt enter any value at the rest of the following fields.

Edited by: yingzi huang on Dec 22, 2008 5:44 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 04:59 AM

    Hi,

    When you give message type 'E' then when you enter the invalid value, as the message type is 'E' the rest of the fields on the selection fields gets diabled...

    Regards

    Akshay

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 22, 2008 at 04:51 AM

    hi,

    use any of these statements after your error message.

    CALL SELECTION-SCREEN 1000.
    LEAVE PROGRAM.
    
    or
    
    Leave list-processing.
    

    Add a comment
    10|10000 characters needed characters exceeded

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

    hi,

    use MESSAGE 'Invalid ID.' TYPE 'I' Display Like 'E'.

    leave list-processing.

    Use above format, then other fields will be enabled for input..

    Rgds.,

    subash

    Add a comment
    10|10000 characters needed characters exceeded

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

    Do u want to continue with the processing after the display of the message also.

    with type i that is not possible.

    after display of error message, processing will stop.

    So try like this

    Message "Ur message" type 'I' DISPLAY LIKE 'E'.

    Add a comment
    10|10000 characters needed characters exceeded

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

    Try, If Sy-Subrc ne 0.

    Error Message.

    Endif.

    Because u might get subrc value other then 4, then ur condition will fail.

    Vikas.

    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.