on 03-07-2007 11:51 AM
Hi All.
I am a newbie. Just started WD4A last week.
I have to give an error message just like in ABAP wherein the flow just stops there and no further statement is executed unless that error is corrected.
I am using the code wizard in WD4A to generate the message handler and then the message. The message does come up, but the flow does not stop there, i.e., further statements are still executed.
I have to manually check everywhere that if error had come, do not proceed.
Is there no automatic way to stop the flow when there is an error?
Thanks in adv.
Hi Aishi,
AS mentioned
cl_wd_dynamic_tool=>check_mandatory_attr_on_view (needs a recent sp)
is useful.
BUT also recall the difference between
MESSAGE_ERROR and MESSAGE_ERROR_WITH_ATTRIBUTE
Straight error continues and error on specific attribute does not navigate away.
This was a deliberate design decision in the framework.
If you consider all the navigation issues, it makes some sense
to have them behave differently. So old MESSAGE Exxx programmers
need to learn new approach. But it is not hard to follow.
Also as pointed out, if you dont wish to execute another line of code..
return statements are useful.
also the rather dramatic RAISE_FATAL... approach has been discontinued.
regards
Phil.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've already checked it and i only found the following attributes:
MESSAGE_TEXT
ELEMENT
ATTRIBUTE_NAME
PARAMS
MSG_USER_DATA
IS_PERMANENT
SCOPE_PERMANENT_MSG
MSG_INDEX
int the REPORT_ATTRIBUTE_ERROR_MESSAGE method.
Any idea?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Rainer. I was looking for the cancel_navigation attribute in the IF_WD_MESSAGE_MANAGER but i couldn't find it.
It could be a problem with the web dynpro version. couldn't it?
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aishi,
the methods of the message manager to report errors have a parameter CANCEL_NAVIGATION, which is by default abap_false (and commented in case you use the wizard). Just set it to abap_true and there will be no navigation.
Regards,
Rainer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can write a statement around the rest of the flow
data lv_error type abap_bool.
lv_error = lo_message_manager->is_empty( ).
if lv_error eq abap_true.
continue, no messages found
endif.
grtz
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Koen. But that's what I am doing now. But this is not automatic.
I mean, I have to check every place that the message manager is empty or not.
No other way like something for mandatory fields in ABAP i.e. user cannot continue without filling the mandatory field? No other coding is reqd in ABAP in that case?
Thanks again.
Hi Aishi,
As I have already asked you to use this code
data l_view_controller type ref to if_wd_view_controller.
l_view_controller = wd_this->wd_get_api( ).
cl_wd_dynamic_tool=>check_mandatory_attr_on_view( view_controller = l_view_controller ).
It will automatically check and stops the user and it also mark the mandatry field with Red and focuses the same.... just try and let us know.
~Bhawanidutt.
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.