cancel
Showing results for 
Search instead for 
Did you mean: 

Why does MESSAGE not work in Web Dynpro?

Former Member
0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

former_member217916
Participant
0 Kudos

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

Former Member
0 Kudos

Thank you, Karan! But I can't open the link you listed above. Could you check what the matter is please?

former_member217916
Participant
0 Kudos

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

Answers (3)

Answers (3)

former_member184958
Active Participant
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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