on 07-23-2014 9:26 AM
Dear all,
I have a requirement in WEB DynPro, Our ESS system using WEB DynPro.
In ESS leave system need to display error message.ie
once leave approved, employees are not allowed to change the leave.
Any idea to write code to display error message.
Thanks.
Shruthi.
Error messages can be displayed in two ways:
1. In the message area
2. As a popup
Below are the code snippets for it.
1.
* get message manager
DATA lo_api_controller TYPE REF TO if_wd_controller.
DATA 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.
CALL METHOD lo_message_manager->report_error_message
EXPORTING
message_text = 'Error message'.
2.
"Display Popup
DATA: l_popup TYPE REF TO if_wd_window,
l_text TYPE string_table.
APPEND `Error Message` TO l_text.
l_popup = wd_comp_controller->wd_get_api( )->get_window_manager( )->create_popup_to_confirm(
text = l_text
close_button = abap_false
button_kind = if_wd_window=>co_buttons_ok
message_type = if_wd_window=>co_msg_type_error
window_title = 'Error'
window_position = if_wd_window=>co_center ).
l_popup->open( ).
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The code should be implemented in one of the controller methods of your Webdynpro component.
Each controller contains a local interface which can be accessed in the controller.
The controller attribute WD_THIS is a reference to this local interface. Depending on the controller, a reference variable is of the following type:
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.