on 06-30-2009 10:35 AM
hi
myself devendra , i am beginner to wdabap,i just want to know that how we can make the input field, in view, mandatory.
what r the steps for that?
hope i 'll get some replies....
thanks
Hi Devendra,
Please try to search in the forum before you post any question. This issue has been discussed many times even earlier. You would have found your solution faster had you directly searched int he forum instead of waiting for any responses to your question.
Anyways 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
in the view, for the input field, u can find the ui properties on the right side....over there, there is a property called STATE. So set it for making mandatory.
Regards
Sajid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Select your inputfield uielement and set the State property to required . Now you will see a (*) symbol next to your inputfield label.
now place the following code in the WDDOBEFOREACTION Method
DATA: l_view_controller TYPE REF TO if_wd_view_controller .
* Check all the mandatory attributes
l_view_controller = wd_this->wd_get_api( ) .
cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
EXPORTING view_controller = l_view_controller
display_messages = abap_true
) .
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good Thread! This was exactly what i was searching for.
Radhika Vadher's reply (the first reply) absolutely solved the problem for me!
I found a lot of so-called "solution" via google with lots of lines, that all had one in common - they didn't work for me. But Radhika Vadher's solution is as good as simple and works fine!
Great work and thanks a lot.
I would give you points if i could
Best regards
Philipp
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.