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

Why does MESSAGE not work in Web Dynpro?

Hello! I'm new to Web Dynpro for ABAP.

When I add the code as below to method WDDOMODIFYVIEW without any conditions of judgment, I thought it could pop up a box just like in a report program. However nothing happens!

MESSAGE 'test' TYPE 'I'.

I want to know why this sentence of code didn't work? And what should I do to realize the same function?

Thanks a lot!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 01, 2013 at 03:25 AM

    Hi Shelwin,

    The error reporting in Web Dynpro ABAP is done using message areas. You need to insert a message area UI element into your view.

    Following link contains step by step information on how to create a message area UI element and trigger custom messages.

    http://webdynproabap.wordpress.com/2012/07/08/message-handling/

    If you need anymore specifics please let me know.

    Regards,

    Karan Ranawat

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Here is the link again : http://webdynproabap.wordpress.com/2012/07/08/message-handling/

      But still i will list down the steps:

      - Insert a message area UI element into the view

      - Wherever you want to show the error message use the following code, the message will be displayed in the message area.

      DATA: lo_api_controller TYPE REF TO if_wd_controller,

      lo_message_manager TYPE REF TO if_wd_message_manager.

      lo_api_controller ?= wd_this->wd_get_api( ).

      CALL METHOD lo_api_controller->get_message_manager

      RECEIVING

      message_manager = lo_message_manager

      .

      * Display error message in message area

      CALL METHOD lo_message_manager->report_error_message

      EXPORTING

      message_text = 'Error Message'

      .

      There are few more things to be kept in mind. You can declare only one message area in a view. If you want declare standard text elements you need you a assistance class and you can get text from that assistance class.

      Refer to following link if you need to store text elements in assistance class.

      http://scn.sap.com/thread/3176066

      Regards,

      Karan

  • Posted on Aug 31, 2013 at 08:55 PM

    Hi Shelwin,

    In Webdynpro You can use only Message Manager (IF_WD_MESSAGE_MANAGER ), which is already inbuilt and you can acces it through code wizard.

    Kindly refer links below

    http://www.an-sap-consultant.com/2012/03/web-dynpro-abap-errorsuccess-message.html

    .http://help.sap.com/saphelp_nw70ehp2/helpdata/en/4b/7106a318395a18e10000000a421937/content.htm

    http://scn.sap.com/message/7229812

    Do reward, if you find helpful.

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 01, 2013 at 05:16 AM

    Hi Shelwin,

    You cannot use the standard MESSAGE syntax in the webdynpro,

    You can use the wizard and generate the message code

    • Open the method in which you have written the MESSAGE syntax
    • Click on WEBDYNPRO WIZARD button
    • Open general tab
    • select Generate Message radio button
    • Press F4 in the field method, select 'REPORT_SUCCESS' and press OK
    • Pass the required Message text that we want to show to MESSAGE_TEXT
    • Now save and activate
    • If you test the message will be displayed at the bottom of the screen
    • If you want to display the message at a particular place then insert MESSAGE AREA screen element in the layout of the View
    • Then the message will get displayed in the inserted MESSAGE AREA
    • There are different types of messages in webdynpro

    please have a look at the following link for detailed explanation MESSAGE GENERATION IN WEBDYNPRO ABAP

    Points please if helpful

    Regards

    Subhash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 01, 2013 at 12:06 PM

    Hi,

    You can't use the ABAP message syntax in webdynpro. If you want to display the message go through the below steps,

    DATA:

    lo_api_controller TYPE REF TO if_wd_controller,

    lo_message_manager TYPE REF TO if_wd_message_manager.

    lo_api_controller ?= wd_this->wd_get_api( ).

    CALL METHOD lo_api_controller->get_message_manager .

    RECEIVING message_manager = lo_message_manager.

    * report message CALL METHOD lo_message_manager->report_error_message.

    EXPORTING message_text = 'Please enter correct address type'.

    like this we have many types of message as follows, and we can call this message using the code wizard,

    REPORT_ATTRIBUTE_ERROR_MESSAGE (Parameter PARAMS)

    REPORT_SUCCESS (Parameter PARAMS)

    REPORT_WARNING (Parameter PARAMS)

    REPORT_ERROR_MESSAGE (Parameter PARAMS)

    REPORT_FATAL_ERROR_MESSAGE (Parameter PARAMS)

    REPORT_ATTRIBUTE_EXCEPTION NO (Parameters ELEMENT, ATTRIBUTE_NAME)

    REPORT_FATAL_EXCEPTION

    REPORT_ATTRIBUTE_T100_MESSAGE (Parameters P1, P2, P3, P4)

    REPORT_T100_MESSAGE (Parameters P1, P2, P3, P4)

    For more details go through the below links,

    http://help.sap.com/saphelp_erp60_sp/helpdata/en/d8/2a934259a5cb6ae10000000a155106/content.htm

    http://scn.sap.com/message/7229812

    Regards,

    John.

    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.