MESSAGE STATEMENT

HI GURUS.
       Is there anyone there who can explain how to use the MESSAGE STATEMENT and kindly give me some sample code.
thank you very much,
gerald

Hi,
Check this out -
MESSAGE
Variants:
MESSAGE xnnn.
MESSAGE ID id TYPE mtype NUMBER n.
MESSAGE xnnn(mid).
Effect
Sends a message. Messages are stored in the table T100, are processed using transaction SE91 and can be created by forward navigation.
The ABAP runtime environment handles messages according to the type declared in the MESSAGE statement and the context in which the message was sent. The following message types exist:
A - Abend
    : Transaction terminated
E - Error
    : Error message
I - Info
    : Information
S - Status
    : Status message
W - Warning
    : Correction possible
X - Exit
    : Transaction terminated with short dump
Messages are mainly used to handle user input on screens. The following table shows the behavior of each message type in each context. An explanation of the numbers used is included at the end of the table:
                            A     E     I     S     W     X
PAI Module                   1     2     3     4     5     6
PAI Module for POH            1     7     3     4     7
    6
PAI Module for POV            1     7     3     4     7
    6
AT SELECTION-SCREEN ...     1     8     3     4     9     6
AT SELECTION-SCREEN for  POH  1     7     3     4     7     6
AT SELECTION-SCREEN for  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
   1. The message appears in a dialog box and the program terminates. When the user has confirmed the message, control returns to the next- highest area. All the internal sessions are deleted from the stack.
   2. The message appears in the status line. Then PAI terminates and the system returns to the current screen. All the screen fields combined using FIELD or CHAIN are now ready for input. The user must enter new values. The system triggers the PAI event again, with the new values.
   3. The message appears in a dialog box. Once the user has confirmed the message, the program continues immediately after the MESSAGE statement.
   4. The message appears in the status line of the next screen. The program continues immediately after the message statement.
   5. The message appears in the status line. Then the system continues as in 2, except that the user can quit the message using ENTER without having to enter new values. The system continues handling the PAI event from immediately after the message statement.
   6. No message is displayed and a runtime error, MESSAGE_TYPE_X, is triggered. The short dump text contains the message identification.
   7. The program terminates with a runtime error DYNPRO_MSG_IN_HELP. While F1 and F4 are processed, the system cannot send error messages or warnings.
   8. The message appears in the status line. Then the system stops selection screen processing and returns to the selection screen itself. The screen fields specified in the additions to the AT SELECTION-SCREEN statement are now ready for input. The user must enter new values. The system then starts processing the selection screen again with the new values.
   9. The message appears in the status line. Then the system continues as in 8, except the the user can quit the message using ENTER, without having to enter new values. The system continues handling the PAI event from immediately after the message statement.
  10. The message appears in the status line and the processing block terminates. The list level is displayed as before.
  11. The message appears in the status line and the processing block terminates. The system then returns to the program call.
  12. For a demonstration of messages in different contexts, see Example Programs for Messages.
Variant 1
MESSAGE xnnn.
Extras:
... WITH f1 ... f4
... RAISING exception
... INTO f
Effect
Outputs the message nnn from the message class i with the type x. You can specify the message class i using the MESSAGE-ID addition to the REPORT statement, PROGRAM, or another introductory program statement.
Example
MESSAGE I001.
You can specify a different message class in parentheses after the error number, for example MESSAGE I001(SU).
When executing the statement, the following system variables are set:
SY-MSGID (message class)
SY-MSGTY (message type)
SY-MSGNO (message number)
Addition 1
... WITH f1 ... f4
Effect
Inserts the contents of a field fi in the message instead of in the placeholder &i. If unnumbered variables (&) are used in a message text, these are replaced consecutively by the fields f1 to f4.
To aid compilation, only numbered variables (&1 to &4) are to be used in future if several fields are involved.
If a "&" is supposed to appear in the message at runtime, you must enter &&.
In the long text of a message, the symbol &Vi& is replaced by the field contents of fi.
After WITH, you can specify 1 to 4 fields.
Note
You can output up to 50 characters per field. If the field contains more characters, these are ignored.
Example
MESSAGE E0004 WITH 'Hugo'.
Note
When executing the statement, the contents of the fields f1 to f4 are assigned to the system fields SY-MSGV1, SY-MSGV2, SY-MSGV3 and SY-MSGV4.
Addition 2
... RAISING exception
Effect
Only possible within a function module or a method (see FUNCTION, METHOD):
Triggers the exception exception.
If the program calling the function module or method handles the exception itself, control returns immediately to that program (see CALL FUNCTION and CALL METHOD). Only then are the current values passed from the procedure to the EXPORTING-, CHANGING- (und RETURNING) parameters of the function module or method, if they are specified as pass-by- reference. However, the calling program can refer to the system field values (see above).
If the calling program does not handle the exception itself, the message is output (see RAISE).
You cannot use this addition in conjunction with the ... INTO cf addition.
Example
MESSAGE E001 RAISING NOT_FOUND.
Addition 3
... INTO f
Effect
Instead of displaying the message, the system places the message text in the field f. The message type is not evaluated.
You cannot use this addition in conjunction with the ...RAISING exception addition. The system 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 for variant 1, where you can set the following message components dnyamically:
ID
    Message class
TYPE
    Message type
NUMBER
    Message number
You can also use all the other additions as with the basic form.
Example
MESSAGE ID 'SU' TYPE 'E' NUMBER '004' WITH 'Hugo'.
Outputs the message with the number 004 and MESSAGE-ID SU (see above) as an E (Error) message and replaces the first variable (&) with 'Hugo'.
Example
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Constructs the message dynamically from the contents of the system fields SY-MSGID, SY-MSGTY, SY-MSGNR , SY-MSGV1 , SY-MSGV2,SY-MSGV3,and SY-MSGV4. These may, for example, be set by an exception after CALL FUNCTION or CALL TRANSACTION ... USING.
Variant 3
MESSAGE xnnn(mid).
Effect
As in variant 2.
Example
MESSAGE X004(SU) WITH 'Hugo'.
Note
Non-Catchable Exceptions:
MESSAGE_TYPE_UNKNOWN: message type unknown
MESSAGE_TYPE_X: Triggers termination with a short dump
ashish

Similar Messages

  • I updated to Firefox 4.0.1 this morning. Norton 5.5 is now disabled and the message states that it is incompatible with 4.0.1. I need the Norton features enabled. Can I go back to 4.0 until this is rersolved?

    I updated to Firefox 4.0.1 this morning. Norton 5.5 is now disabled and the message states that it is incompatible with 4.0.1. I need the Norton features enabled. Can I go back to 4.0 until this is resolved?

    Please do a Live Update to the Norton product.
    They have provided an important update to Firefox 4.0.1.

  • Message Statement Limitation in ABAP

    We have a requirement in displaying a filename which is of more than 50 characters using message statement when the program is running in the back ground when the file name gets written in the job log the file name which is after 50 characters gets truncated we want to write the whole file name in the job log.
    We tried breaking the file name in to 2 different variables and then display it bu if we do so the whole file name gets displayed but with a space in the middle our requirement is to display the whole file name using message statement with out any space in between.
    Please help me if there is any way of it.
    Note: message statement has a limitation of 50 characters after that it gets truncated.

    DATA :     target(100) TYPE c,
                   local type i,
               target2(100) TYPE c.
    target = '/Private#Items/ABC_Reports/ABCD0011ZX_SWMO5XY2090329151005'
    DO.
      SEARCH target FOR '/'.
      IF sy-subrc EQ 0.
        local1 = sy-fdpos + 1.
        MOVE target+0(local1) TO file_path.
        CONCATENATE target2 file_path INTO target2.
        target = target+local1.
      ELSE.
        EXIT.
      ENDIF.
    ENDDO.
    MESSAGE i047(z2) WITH 'FTP File Created:' target2 target.
    Message  class Z2 047 is defined as & & & &
    Note: this displays correctly in Fore ground the issue is when we run it in the back ground.
    This is  just a trial code which we have used  we are trying to Move the path in to one variable and file name in to other variabale and display as target alone has more than 50 characters and it cannot display 50 characters at once in a variable .

  • I'm trying to change my ICloud e-mail to match the one associated with the Apple ID? Can someone tell me how to do this? Seems like the phone won't accept the new one, the message states "you already have acct associated....."  (a given!!)  I need help !!

    I'm trying to change my ICloud e-mail to match the one associated with the Apple ID? Can someone tell me how to do this? Seems like the phone won't accept the new one, the message states "you already have acct associated....."  (a given!!)  I need help !!

    You made a purchase and exhausted the credit on your card before it processed. All purchases are final. Contact iTunes Store support. You need to settle up before you can purchase or download anything else.

  • Purchased apps are not in App Store anymore. Message states "You have not yet purchased any apps."

    I just did a software update today and also changed my Apple ID password at the same time.
    Now when I log in to the App Store, all of the apps that I previously purchased are gone.
    They were there when I first went in to the store and as soon as I viewed my account information and then clicked back on the purchased tag, everything was gone and the message states "You have not yet purchased any apps."
    Any suggestions?

    Thanks Carolyn... I tried that but they are still not showing up. I ended up going to their support page and filled out a form with a description of the problem. I hope that I get a response soon.
    Just in case, the link for the form is below.
    http://www.apple.com/support/mac/app-store/contact.html?form=account&topic=Mac%2 0App%20Store%20Account%20and%20Billing

  • I can't burn cd. When I try to burn a cd a message states "The attempt to burn a disc failed. An unknown error occurred. (4450) Anyone know what this means and how to repair it?

    I can't burn a cd from my ITunes playlist. When I try to burn a cd a message states "The attempt to burn a disc failed. An unknown error occurred. (4450)" How can I correct an unknown error?

    Hello rcrown01,
    The following articles can help get iTunes back to burning.
    Can't burn a CD in iTunes for Windows
    http://support.apple.com/kb/TS1436
    iTunes for Windows: Additional troubleshooting tips for burning issues
    http://support.apple.com/kb/TS1374
    Cheers,
    Allen

  • HT2497 I just purchased the 2TB TC and set it up on bridge mode to my att verse which is connected via ethernet cable.  The TC is continually blinking amber and an error message states that a wireless network cannot be found but the uverse is functioning

    I just purchased the 2TB TC and set it up on bridge mode to my att verse which is connected via ethernet cable.  The TC is continually blinking amber and an error message states that a wireless network cannot be found but the uverse is functioning great.  The network name I assigned to the TC is also not appearing among available networks.  How do I remedy this, please?

    What OS on the computer you are using to setup the TC?
    Did you turn on ipv6 for wireless to link-local... this is essential for network access now??
    Try power cycling the network.. start up in correct order.. uverse.. 2min wait.. TC.. 2min wait.. computer.
    No luck factory reset and start over. Use ethernet cable as well to the computer to help it.
    No luck I can show you manual method.

  • I am trying to load the 64 bit version of iTunes on to my PC but it continues to fail. My Pc is running Windows XP x64 edition. The rrror message states I need Window Vista 64 or later. What should I do?

    I am trying to load the 64 bit version of iTunes on to my PC but it continues to fail. My Pc is running Windows XP x64 edition. The rrror message states I need Window Vista 64 or later. What should I do?

    There is no version of iTunes that truly supports the 64-bit version of Windows XP and never will be. If you search this forum for "XP 64" or do a web search for something like "iTunes Windows XP 64",  you'll find threads describing the process some people have used to "crowbar" iTunes onto XP 64, with varying levels of success, none of them complete.  
    Regards.

  • My Iphone 4  will not let me send an email or reply to an email.  The message states it has put it in my outbox  and it is rejected by the server because it does not allow relaying???   I can't seem to find an answer to fix this.  Any help?

    My Iphone 4 will not let me send an email or reply to an email.  The message states that it has put my email in my outbox and that my server does not allow for relaying.   Can anyone help with this?    I have read some other answers and nothing has worked   Thanks

    Your email provider has blocked the standard mail port 25 for sending emails and is requiring a different port. This is to avoid mail relays that use mail clients to send spam. You need to find the port that is used by your provider for sending outgoing mail. Then change the settings in your email account on your phone to match the port. You will also have to provide some security credentials for the account.
    You can also try deleting the email account from your iphone, and the adding the email account back as this will many times set the correct port for sending emails.
    You could also do a Google search on the the settings for your device with your email provider. That will provide you with the proper settings.

  • HT1349 iTunes will not start on my PC. I get a runtime error from the Visual C== runtime library when iTunesHelper.exe is started. The message states the application attempted to load the library incorrectly. How is the problem to be resolved?

    iTunes will not start on my PC. I get a runtime error from the Visual C++ runtime library when iTunesHelper.exe is started. The message states the application attempted to load the library incorrectly. How is the problem to be resolved?

    Click here and follow the instructions.
    (99035)

  • I am unable to sync to my Ipod. Error message states "unable to sync because duplicate file name exist. Any ideas how to remedy?

    I am unable to sync to my ipod. Error message states "unable to sync because duplicate file name exist". Any ideas on how to remedy this problem?

    Were some of the songs purchased from a different itunes account?

  • Itunes document manager pro will not open a document with .cwk extension. It will catch the document then error message states that it cannot open document. Can anyone tell me what Im doing wrong?

    Itunes document manager pro will not open a document with .cwk extension. It will catch the document then error message states that it cannot open document. Can anyone tell me what Im doing wrong?

    Forgive my ignorance but I have never hear of iTunes Document Manager Pro. If you mean Document Manager Pro, i was able to find that. Back to your problem, have you tried opening one of those files in the iOS iWorks apps? Form the quick read that I did about this, .cwk files can be opened by Pages, Numbers or Keynote, depending on what type of document that it is and those files can be read by Document Manager Pro, after properly saving them. I don't see that you can go directly from the .cwk file in Document Manager Pro without converting them first.
    I took a very quick look at the app, so I may be a missing something about its capability.

  • HT5654 iTunes auto update downloaded and installed on 28/01/2014. iTunes now won't launch and error message states file MSVCR80.dll is missing. Tried uninstalling and downloading/installing again to no avail. Any clues?

    iTunes auto-update dowloaded and installed on 28/01/2014. iTunes now won't launch and error message states file MSVCR80.dll is missing. Tried unistalling and downloading/installing again to no avail.  Any clues?

    Click here and follow the instructions. You may need to completely remove and reinstall iTunes and all related components, or run the process multiple times; this won't normally affect its library, but that should be backed up anyway.
    (99269)

  • I can't download Adobe Acrobat XI Pro as a message states I am not using an up to date windows IE.

    I can't download Adobe Acrobat XI Pro as a message states I am not using an up to date windows IE. I am operating Windows 8 Pro w/IE 10 installed. I just purchased the Adobe upgrade and would like to get it installed.

    Firefox allowed me to download with no problem.  Thanks,
    In a message dated 12/1/2012 1:31:52 P.M. Eastern Standard Time, 
    [email protected] writes:
    Re: I  can't download Adobe Acrobat XI Pro as a message states I am not
    using  an up to date windows IE.
    created  by John Waller (http://forums.adobe.com/people/John+Waller)  in 
    Downloading, Installing, Setting Up - View the full  discussion
    (http://forums.adobe.com/message/4889310#4889310)

  • Doubt regarding Message statement

    Hi,
    I want to pop up a message in which I want the valye of X tp be replaced by its value.
    DATA: X(3) TYPE C VALUE 'FFF'.
    MESSAGE ID 'ERROR MESSAGE' TYPE 'E' NUMBER '000' WITH 'COMPUTED' '&X&'.
    But this does not work.
    Can someone help me out ?
    Tushar

    Tushar,
    The ID part refers to a Message Class. Here you specified 'Error Message' which is an invalid name as well as being not in customer name space (does not start with Y or Z). You can examine existing Message Classes as well as create and maintain with Txn SE91.
    A message with Number mentioned with the number part should exist in the specified Message Class. In your case the message should have at least  two '&' symbols as place holders for two variable you are going to substitute from your ABAP.
    Do not enclose a variable name with  & and  quotes in the ABAP code.
    As already mentioned in one of the replies, Error Messages by default are not dispalyed in a popup. It is a user setting.
    Also, please read the F1 help for the Message statement.
    Cheers,
    Ramki Maley.

  • Ibooks has frozen...message states cannot connect to itunes

    I went into Ibooks and it has frozen.  the message states cannot connect to itunes store.  I have updated all itunes.  what is the problem?

    You have to put iPhone into Recovery Mode and Restore. Open iTunes on your computer. Connect iPhone to computer with USB Cable. Hold both home and power buttons for about 20 seconds until iTunes recognizes iPhone in Recovery Mode. Click the Restore button of iTunes.

Maybe you are looking for