on 09-19-2016 12:07 PM
Hi team,
I have an issue in webdynpro select-options. I set the field obligatory in
Method WDDOINIT.
* add a new field to the selection
WD_THIS->M_HANDLER->ADD_SELECTION_FIELD( I_ID = 'ZCOUNTRY'
IT_RESULT = LT_RANGE_TABLE I_READ_ONLY = READ_ONLY
i_value_help_type = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_SEARCHHELP
i_value_help_id = 'H_T005_LAND'
i_obligatory = 'X'
).
But when I am executing on action for search button ( Event Handler ONACTIONSEARCH).Then it checking the field as mandatory. But after checking I have some code and it also executing that means if the Zcountry displaying error message and also procedding further.If any error message it should stop How to achecive this.Please any one can help.
Event Handler ONACTIONSEARCH
rt_count = wd_this->m_handler->get_range_table_of_sel_field( i_id = 'ZCOUNTRY').
ASSIGN rt_count->* TO <fs_count>.
Thanks and regards,
Umakanth
Uma,
Please use the bellow code to stop further processing and display the error message. RETURN is the key word to stop processing.
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.
If lv_abc is initial.
* report message
CALL METHOD lo_message_manager->report_message
EXPORTING
message_text = 'Abc Error'
message_type = '2'. "Error message type
RETURN.
endif.
Let me know if it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Uma,
WD ABAP works on phase model. If you throw a error message it won't stop at that method call itself. It executes the remaining code in the method on which you have raised the error message. So have a flag and control the remaining code which is after the call of the error message using the flag.
BR,
Arun.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Team,
Could any one please suggest solution for the above issue?
Thanks and Regards,
Uma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.