on 10-30-2008 10:37 AM
Hi all,
Is anyone know how to show the information message to the users in the screen when the mandatory field is not entered by user in the screen?
For example, when a field Title is not entered, we need to show information message/error message : "Please fill in the mandatory field."
Thanks
Hi,
You need to call the static method check_mandatory_attr_on_view of class cl_wd_dynamic_tool. This would then automatically verify if all the mandatory fields have been filled or not. It would then populate the error messages into an internal table and display them in the view. Also the mandatory fields which haven't been filled would be highlighted with a red border. You need to put the below coding into the action up on which you want to trigger the data chesks.
data: lt_msg TYPE cl_wd_dynamic_tool=>t_check_result_message_tab,
lo_view_controller TYPE REF TO if_wd_view_controller,
lo_message_manager type ref to if_wd_message_manager.
lo_view_controller ?= wd_this->wd_get_api( ).
lo_message_manager = lo_view_controller->get_message_manager( ).
cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
EXPORTING
view_controller = lo_view_controller
display_messages = abap_true
IMPORTING
messages = lt_msg ).
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
there are several forum entries handling this problem. So maybe you will find additional information there...
I'm using the following coding in my event:
data: lt_msg TYPE cl_wd_dynamic_tool=>t_check_result_message_tab.
data: lo_view_controller TYPE REF TO if_wd_view_controller.
lo_current_controller ?= wd_this->wd_get_api( ).
lo_message_manager = lo_current_controller->get_message_manager( ).
lo_view_controller = wd_this->wd_get_api( ).
cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
EXPORTING
view_controller = lo_view_controller
display_messages = abap_true
IMPORTING
messages = lt_msg ).
And I set the field as mandatory in the attributes (state = required)
Regards,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.