on 08-29-2013 7:28 AM
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!
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shelwin,
You cannot use the standard MESSAGE syntax in the webdynpro,
You can use the wizard and generate the message code
please have a look at the following link for detailed explanation MESSAGE GENERATION IN WEBDYNPRO ABAP
Points please if helpful
Regards
Subhash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.