on 02-27-2009 6:38 PM
Hi,
I am getting user input via ls_data_selections.
DATA lo_nd_data_selections TYPE REF TO if_wd_context_node.
DATA lo_el_data_selections TYPE REF TO if_wd_context_element.
DATA ls_data_selections TYPE wd_this->element_data_selections.
navigate from <CONTEXT> to <DATA_SELECTIONS> via lead selection
lo_nd_data_selections = wd_context->get_child_node( name = wd_this->wdctx_data_selections ).
get element via lead selection
lo_el_data_selections = lo_nd_data_selections->get_element( ).
get all declared attributes
lo_el_data_selections->get_static_attributes(
IMPORTING
static_attributes = ls_data_selections ).
SELECT * FROM proj INTO CORRESPONDING FIELDS OF TABLE it_proj
WHERE pspid = ls_data_selections.
if user enters a wrong slection this table will not have any entries .I want to add a message at selection screen saying wrong job number.
How do we do that?
rgds
Vara
Hi Vara,
First of all,You need to use UI component message area that you can place on the top of the VIEW
like any other webDynpro UI Element in design mode. Next you need to create instance of the message manager.
"get message manager
DATA: l_current_controller TYPE REF TO if_wd_controller,
l_message_manager TYPE REF TO if_wd_message_manager.
DATA: ls_msg type STRING.
l_current_controller ?= wd_this->wd_get_api( ).
CALL METHOD l_current_controller->get_message_manager
RECEIVING
message_manager = l_message_manager.
" existing code
DATA lo_nd_data_selections TYPE REF TO if_wd_context_node.
DATA lo_el_data_selections TYPE REF TO if_wd_context_element.
DATA ls_data_selections TYPE wd_this->element_data_selections.
navigate from <CONTEXT> to <DATA_SELECTIONS> via lead selection
lo_nd_data_selections = wd_context->get_child_node( name = wd_this->wdctx_data_selections ).
"get element via lead selection
lo_el_data_selections = lo_nd_data_selections->get_element( ).
"get all declared attributes
lo_el_data_selections->get_static_attributes(
IMPORTING
static_attributes = ls_data_selections ).
SELECT * FROM proj INTO CORRESPONDING FIELDS OF TABLE it_proj
WHERE pspid = ls_data_selections.
if it_proj is initial.
ls_msg = 'You entered a wrong job number'.
"report error message
CALL METHOD lo_message_manager->report_error_message
EXPORTING
message_text = ls_msg.
endif.
Greetings
Prashant
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 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.