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

Error Message

Hi. I'm using E398(00) with 'ErrorMessage' in my program.

The problem is the following:

When the error message is fired, if i press any key or any button, the program finishes and i return to the initial screen 'Sap easy access'.

How can i solve that??

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    Posted on Sep 18, 2007 at 11:44 AM

    Hi,

    Instaed of error message give information message...

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 11:46 AM

    hi Jose,

    is that msg stmt in END-OF-SELECTION event..?

    use Leave list processing after the msg stmt..

    <b>Reward points if useful</b>

    Chandra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 11:46 AM

    Hi

    for a error message it happens like that only. try to give out a I or W (informative or a waring message) message or if that code is in PAI, try to put it in chain-endchain block.

    if u still have any queries, post the code.

    see here how the messages work :

    MESSAGE

    Variants:

    1. MESSAGE xnnn.

    2. MESSAGE ID id TYPE mtype NUMBER n.

    3. MESSAGE xnnn(mid).

    Effect

    Sends a message. Messages are stored in table T100, and can be maintained using Transaction SE91. They are fully integrated in the forward navigation of the ABAP Workbench.

    The ABAP runtime environment handles messages according to the message type specified in the MESSAGE statement and the context in which the message is sent. There are six kinds of message type:

    A (Abend)

    Termination

    E (Error)

    Error

    I (Info)

    Information

    S (Status)

    Status message

    W (Warning)

    Warning

    X (Exit)

    Termination with short dump

    Messages are used primarily to handle user input on screens. The following table shows how each message type behaves in different contexts. The numbers are explained at the end of the table.

    A E I S W X

    -


    PAI module 1 2 3 4 5 6

    PAI module at POH 1 7 3 4 7 6

    PAI module at POV 1 7 3 4 7 6

    -


    AT SELECTION-SCREEN ... 1 8 3 4 9 6

    AT SELECTION-SCREEN at POH 1 7 3 4 7 6

    AT SELECTION-SCREEN at POV 1 7 3 4 7 6

    AT SELECTION-SCREEN ON EXIT 1 7 3 4 7 6

    -


    AT LINE-SELECTION 1 10 3 4 10 6

    AT PFn 1 10 3 4 10 6

    AT USER-COMMAND 1 10 3 4 10 6

    -


    INITIALIZATION 1 11 3 4 11 6

    START-OF-SELECTION 1 11 3 4 11 6

    GET 1 11 3 4 11 6

    END-OF-SELECTION 1 11 3 4 11 6

    -


    TOP-OF-PAGE 1 11 3 4 11 6

    END-OF-PAGE 1 11 3 4 11 6

    TOP-OF-PAGE DURING ... 1 10 3 4 10 6

    -


    LOAD-OF-PROGRAM 1 1 4 4 4 6

    -


    PBO module 1 1 4 4 4 6

    AT SELECTION-SCREEN OUTPUT 1 1 4 4 4 6

    -


    Procedure see Messages

    -


    Displays the message in a dialog box. The program then terminates, and control returns to the next-highest area menu. All internal sessions are deleted from the stack.

    Displays the message in the status bar. The PAI processing is then terminated and the system returns to the current screen. All fields listed in a FIELD or CHAIN statement in the screen flow logic are ready for input, and the use must enter new (correct) values. The system restarts the PAI processing with the new values.

    Displays the message in a dialog box. The program continues normally after the MESSAGE statement.

    Displays the message in the status bar of the next screen. The program continues normally after the MESSAGE statement.

    Displays the message in the status bar. Processing then carries on as in 2, but the user can acknowledge the message by pressing ENTER without having to enter new values. The system then resumes PAI processing directly after the MESSAGE statement.

    The message is not displayed. Instead, the statement triggers the runtime error MESSAGE_TYPE_X. The text of the short dump contains the message ID.

    Termination with runtime error DYNPRO_MSG_IN_HELP. You cannot send error messages during F1 or F4 help.

    Displays the message in the status bar. The selection screen processing terminates, and the system returns to the selection screen. The fields specified in the additions to the AT SELECTION-SCREEN statement are ready for input, and the user must enter new values. The system then reprocesses the selection screen with the new values.

    Displays the message in the status bar. Processing then carries on as in 8, but the user can acknowledge the message by pressing ENTER without having to enter new values. The system then resumes PAI processing directly after the MESSAGE statement.

    Displays the message in the status bar. The processing block is then terminated. The previous list level remains displayed.

    Displays the message in the status bar. The program then terminates, and control returns to the point from which the program was called.

    There is an Example program for messages that displays how messages behave in various contexts.

    Variant 1

    MESSAGE xnnn.

    Additions:

    1. ... WITH f1 ... f4

    2. ... RAISING exception

    3. ... INTO f

    Effect

    Sends the message nnn from message class i with type x. You can specify the message class i in the MESSAGE-ID addition to the REPORT, PROGRAM or other introductory statement.

    Example

    MESSAGE I001.

    If you want to use a different message class, you can specify one in parentheses after the message number: MESSAGE I001(SU).

    When the statement is executed, the following system variables are set:

    • SY-MSGID (Message class)

    • SY-MSGTY (Message type)

    • SY-MSGNO (Message number)

    Addition 1

    ... WITH f1 ... f4

    Effect

    The contents of the fields fi are inserted into the message text to replace the placeholders &i. If you used unnumbered placeholders in your message text (&), they are replaced successively with the contents of the fields f1 to f4.

    To make messages easier to translate, ensure that you use numbered placeholders ( &1 to &4) if you need to insert more than one variable in a message text.

    If you want to use the ampersand character itself in a message text, enter &&.

    In the long text of a message, the symbol &Vi& is replaced with the field contents of fi at runtime.

    You can specify between one and four fields after WITH.

    Note

    Only the first 50 characters of any field will be displayed.

    Example

    MESSAGE E004 WITH 'Hugo'.

    Note

    When the statement is executed, the system fields SY-MSGV1, SY-MSGV2, SY-MSGV3, and SY-MSGV4 are filled with the contents of f1 to f4.

    Addition 2

    ... RAISING exception

    Effect

    Only within a function module or method ( FUNCTION, METHOD):

    Triggers the exception exception.

    If the caller of the function module or method handles the exception itself, control returns directly to the caller (see CALL FUNCTION and CALL METHOD). The EXPORTING, CHANGING, (and RETURNING) parameters of the function module or method only contain the current value from the procedure if they are defined to be passed by reference. They are not filled if they are passed by value.

    The caller can, however, use the values from the system fields that are filled when the message is sent (see above).

    If the caller does not handle the exception itself, the message is displayed (see RAISE).

    You cannot use this addition in conjunction with the ... INTO cf addition.

    Note

    If, during a Remote Function Call, an error occurs in the target system, details of the error message are passed bac to the calling system in the following system fields: SY-MSGNO, SY-MSGID, SY-MSGTY, SY-MSGV1, SY-MSGV2, SY-MSGV3, and SY-MSGV4. These fields are initialized before every RFC. If a short dump or a type X message occurs, the short text of the dump is transferred to the caller, and the contents of SY-MSGID, SY-MSGTY, SY-MSGNO, and SY-MSGV1 assigned by the system.

    In RFC-enabled function modules, no ABAP statements are allowed that would end the RFC connection (for example, LEAVE, SUBMIT or the AND RETURN addition).

    Example

    MESSAGE E001 RAISING NOT_FOUND.

    Addition 3

    ... INTO f

    Effect

    The message is not displayed, but the formatted message text is placed in the field f. The message type is irrelvant.

    Note

    You cannot use this addition in conjunction with the ...RAISING exception addition. The addition sets the following system variables: SY-MSGID (message class), SY-MSGTY (message type), SY-MSGNO (message number), and SY-MSGV1, SY-MSGV2, SY-MSGV3, SY-MSGV4 (parameters).

    Example

    DATA msgtext(72).

    ...

    MESSAGE E004 WITH 'Hugo' INTO msgtext.

    Variant 2

    MESSAGE ID id TYPE mtype NUMBER n.

    Effect

    As in variant 1, but you can set the

    ID

    message class

    TYPE

    message type

    NUMBER

    message number

    dynamically. You can use any other additions that are valid for the basic form of the statement.

    Example

    MESSAGE ID 'SU' TYPE 'E' NUMBER '004' WITH 'Hugo'.

    The example displays message 004 from message class SU (see above) as an error message, and its first placeholder is replaced with 'Hugo'.

    Example

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    The message is constructed dynamically from the system fields SY-MSGID, SY-MSGTY, SY-MSGNR, SY-MSGV1, SY-MSGV2, SY-MSGV3, and SY-MSGV4. This applies to situations where the system fields have been set by an exception following CALL FUNCTION or CALL TRANSACTION ... USING

    Variant 3

    MESSAGE xnnn(mid).

    Effect

    Like variant 2

    Example

    MESSAGE X004(SU) WITH 'Hugo'.

    Note

    Runtime errors:

    MESSAGE_TYPE_UNKNOWN: Message type unknown

    MESSAGE_TYPE_X: Deliberate program termination with short dump

    Regards,

    Prasant

    *reward if helpful

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 11:48 AM

    Use Warning message type instead of error.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 11:48 AM

    Hello Jose..

    Please do the following to stay in the same screen...

    if condition not met.

    I398(00) . "Replace 'E' error with 'I' information

    Exit.

    Endif.

    Please Check and revert

    Regards

    Byju

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 11:48 AM

    We cannot insert error or warning message in start-of-selection or end-of-selection. We can only use success, abend, exit or information message. So give i398(00) instead of e398(00)and also leave list-processing statement.

    Regards,

    mallick

    Message was edited by:

    DEBOPRIYO MALLICK

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 11:50 AM

    hi,

    u can have different options

    1. use warning message instead of error message

    2. use LEAVE TO LIST-PROCESSING after error message or after when u click on any button like dat.

    3. use LEAVE PROGRAM OR LEAVE TO SCREEN 0 if u are using module programming.

    after error message.

    if helpful reward some points.

    with regards,

    Suresh Aluri.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 11:55 AM

    Hi Jose,

    In place or Error message try giving a Warning or Information message.

    In place of E398(00) try using W398(00) or I398(00). This will help you to remain in the program process, even if the message is triggered.

    Hope this resolves your query.

    Reward all the helpful answers.

    Regards,

    Nagaraj

    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.