on 04-10-2014 11:12 AM
Hi Buddies,
I am new to web dynpro for ABAP and now I am doing some exercises.
In method check_input, I coded to capture an error using message manager. However, I find method FLIGHTTAB_FILL continue to run. I am wondering if there are some indicators (I find sy-subrc is still initial...any other indicators??) I could use to stop the program when an error is captured? Please advice. Thanks.
---------------------------------------------------------------
method FLIGHTTAB_FILL .
wd_this->check_input(
).
........
endmethod.
.
Kind Regards,
Clark
Hello Clark,
You have a parameter CANCEL_NAVIGATION in message manager methods, but am sure it will not stop the program code from further navigation.(I never realized that CANCEL_NAVIGATION = X works)
So always prefer to raise the message in DOBEFOREACTION. Else once you raise a message, set a flag value in an attribute and check the condition in FLIGHTTAB_FILL method.
BR,
RAM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ram,
Thanks a lot for the quick response. As you propose, I raise the message in DOBEFOREACTION and it works perfectly.
I do not set the flag value when raising the message and do not check in FLIGHTTAB_FILL method. However, the program stops to go into method FLIGHT_FILL. I guess in DOBEFOREACTION, when message manager works, the program stops to execute the action. Is this understanding correct?
Kind Regards,
Clark
Hi,
If you use is_empty method, you can identify.
ABAP_TRUE if Message List Is Empty. So in your case, if messages are populated, space will be the value of the Boolean.
** get message manager
DATA lo_api_controller TYPE REF TO if_wd_controller.
DATA lo_message_manager TYPE REF TO if_wd_message_manager.
data lv_bool type abap_bool.
data lt_messages type if_wd_message_manager=>ty_t_messages.
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
RECEIVING
message_manager = lo_message_manager
.DATA lv_message TYPE string.
DATA lv_message_type TYPE i.
lv_message_type = if_wd_message_manager=>co_type_standard.
* report message
CALL METHOD lo_message_manager->report_success
EXPORTING
message_text = 'Success'.
* report message
"ABAP_TRUE if Message List Is Empty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
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.