on 07-19-2009 11:37 AM
Hi all,
We are using SAP ABAP Web Dynpro Component: RPLM_QIMT_NOTIF_COMP to create notification(IW21). After entering data to create notification screen and press save, we want to do some validations and trough error message to screen and stop saving notifications until errors are fixed. I am able to raise error message but not able to stop further processing. Notification is geting saved even after trowing error message. could some one give us clue or Rather sample code to stop further processing. Notification is created via portal.
Rgds,
Harish
Edited by: Harish Aginati on Jul 19, 2009 2:25 PM
hi,
You can use Report Error message. ( control wizard ).
Use below mentioned code :
get message manager
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
.
report message
CALL METHOD lo_message_manager->report_error_message
EXPORTING
message_text = ' Error messge Text'
params =
msg_user_data =
is_permanent = ABAP_FALSE
scope_permanent_msg = CO_MSG_SCOPE_CONTROLLER
view =
show_as_popup =
controller_permanent_msg =
msg_index =
cancel_navigation = ' X'
receiving
message_id =
.
Give Cancel navigation X.
I hope 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,
I tried with Cancel navigation = 'X' when raising error message, but still its not stoping to save notification. I raised error message in pre-exit ONACTIONSAVE event. Do you have any suggestion. is it possible to stop a navigation by raising error message with out binding to a attribute?
Hell Harish,
I had the same problem and used the following statement, maybe it will help you.
CALL METHOD wd_this->mr_message_manager->report_attribute_message
EXPORTING
message_text = lv_line
message_type = CO_TYPE_ERROR
element = <fs_pos>
attribute_name = 'REC_DATE'
params = params
msg_user_data = msg_user_data
is_permanent = ABAP_true
scope_permanent_msg = CO_MSG_SCOPE_CTXT_ELEMENT
msg_index = msg_index
cancel_navigation = 'X'
is_validation_independent = ABAP_FALSE
enable_message_navigation = enable_message_navigation
view = view
RECEIVING
message_id = lv_id
.
Parameter is_permanent makes sure you can not perform any action anymore. You can't even delete a row in the alv in case you have an error generated by the statement above.
Cheers and good luck!
Laurens
Hi
Use REPORT_ERROR_MESSAGE, and set IS_PERMANENT SCOPE_PERMANENT_MSG to controller
If the component is FPM managed then you can also use
CALL METHOD wd_this->mr_message_manager->report_T100_MESSAGE
EXPORTING
IV_MSGID = 'MSGID'
IV_MSGNO = 001
IO_COMPONENT = wd_this
IV_SEVERITY = if_fpm_message_manager=>GC_SEVERITY_ERROR
IV_LIFETIME = if_fpm_message_manager=>GC_LIFE_VISIBILITY_AUTOMATIC
Where the mr_message_manager is a reference to of IF_FPM_MESSAGE_MANAGER.
I hope it works
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.