Skip to Content

Let me start my first blog with a useful function module that I came to know while solving one of the commonly faced issues in SAP.

ABAP Statement: MESSAGE ‘Text’ TYPE ‘E’.

On execution of this statement,processing stops,screen input field(s) gets disabled and the poor end-user has to press ENTER key to input again the screen input values. During my initial days as an ABAPer,I was not aware of the useful message_options of the MESSAGE statement (DISPLAY LIKE ‘W‘ and ‘E). So I googled without any hope to find out if there is any way that I could automate the event of user pressing the ENTER key.Wow! I got one.Made me wonder whether there is anything that ABAP doesn’t provide. ABAP is too good!!!!!

*Begin-Auto triggers ENTER command



            functioncode           = ENTER


            function_not_supported = 1

            OTHERS                    = 2.

*End-Auto triggers ENTER command

Similarly we can work around with standard function codes (viz.,SAVE,EXECUTE etc.) and custom function codes (which we add in push button,radio button,hyperlink etc.) with this wonderful FM.

K.Arun Prabhu.

“Never calculate the height of a mountain before you climb it. When you reach the top, you will realise how low it was

To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. Former Member

    @Arun: Good solution to the problem. However, I found something for avoiding the ENTER issue. Can you please help me understand what is the difference if we do thing as this way.


    1. K.Arun Prabhu Post author


           I have already mentioned in this blog about DISPLAY LIKE message_option of the MESSAGE statement 🙂 If we use this option, processing won’t stop on execution and we have to use either return/leave to screen to stop the processing.

           MESSAGE ‘Text’ TYPE ‘S’ DISPLAY LIKE ‘E’.

           return / leave to screen XXXX.

  2. Former Member

    Hey Thanks, never knew about this function module.

    Though, as you say for message statement there are other better options but this function module could be a boon in some scenarios 🙂 .



  3. Krishna Chaitanya

    Hi Arun,

    Good to know about the new FM.  Thanks for sharing 🙂

    But one quick question.  This FM can be used in our customized programs right ?

    Then why don’t we can use the message type as ‘I’ or “S” instead of “E”.

    Could you please brief little bit for me…please……..  🙁


    Krishna Chaitanya.

    1. K.Arun Prabhu Post author

      Hi Krishna.

      This FM can be used in our customized programs. Otherwise how I would have known it 🙂

      You are right that we can use other message types.

      If you can re-read the blog, I have mentioned about using DISPLAY LIKE ‘E’ or ‘W’.

      I have mentioned that I came to know about this FM before I got to know other good MESSAGE options.

      This FM can be used in various scenarios wherein you feel a PAI event needs to be triggered. When situation comes, you will understand it better.

      Hope you got it 🙂


  4. Former Member

    Dear Arun,

    Congrats on your first blog and thanks for sharing this wonderful FM.

    But I’m still intrigued as to how this FM could be useful in cases where we need to trigger an error message since triggering the error message would stop the processing and it won’t move to the next block(which is where as I understand we are expected to call this FM, right?). So the screen fields would still be not ready for input(even if you press ‘Enter’ the screen field would still be not ready for input, unless you are raising the error inside a field statement module). I don’t really get that part of your blog – as to how the user could press enter and make the fields ready for input again in case of an error message, with or without this FM.

    Could you clarify the context where you were able to make use of this FM?

    Thanks a lot



    1. K.Arun Prabhu Post author

      Hi Mahesh.

           This FM is not particularly useful for the case you had asked/(mis)understood 🙂

           For displaying an error message, the best option is

                MESSAGE ‘Text’ TYPE ‘S’ DISPLAY LIKE ‘E’.

                leave to screen sy-dynnr.

           I just meant to say I came across this FM when I was searching for some way to automate the event of user pressing ENTER key.

           One scenario I will mention here where I had used this FM:

           * In a module pool screen, I have a field for which i have given search help using POV module.

           * In that module, on user selection on some data, I have called this FM to execute with the selected data. If I had not used this FM, user has to press EXECUTE button to proceed further.


  5. Dinesh K

    Thanks for sharing like this.I hope it will helps most of the ABAPer’s who has started their carrier in SAP ABAP, off course some of the experts also 😆 .

    Keep sharing Ur knowledge..


Leave a Reply