on 04-09-2011 6:39 AM
Hi all,
I want to use REPORT_ATTRIBUTE_ERROR_MESSAGE on table column, how can we use this?? or any other way..
and one more doubt.. i am displaying some message when no element is select on table, it is displaying error message,
but lead selection is removing? i dont want to remove lead selection . how can we achieve this?
thanks,
Venkat.
HI Venkat ,
Use lo_el = lo_nd_nodename->get_element( NODE_ELEMENT = ur req attribute name).
then put the ref lo_el into the message.
regards
Kuldeep
Edited by: Kuldeep85 on Apr 11, 2011 7:50 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat ,
You can use thecode below and modify it according to your field.
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_attribute_error_message
EXPORTING
message_text = 'hiiia '
element = lo_el_context
attribute_name = 'FIELD2'
receiving
message_id = msgid .
There is no relation to the lead selection with this , but still if you face any problem regarding lead selection ,
You can use SET_LEAS_SELECTIOn method of context at specified index .
hope this will solve your issue.
regards
Kuldeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Venkat, you can use the REPORT_ATTRIBUTE_ERROR_MESSAGE for table column by passing the message object, context_element which has the error column and the attribute name.
see example in demo_messages,WDR_TEST_MSG_MANAGER_00 components.
i am displaying some message when no element is select on table
i do not understand how lead select get affected when no element is selected. when there is no element selected how come lead selection ?/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Baskaran,
My code is like this...
if lv_pack_material is initial.
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_ATTRIBUTE_ERROR_MESSAGE
EXPORTING
MESSAGE_TEXT = 'Please Select Packing Material...'
ELEMENT = lo_el_pack_mat
ATTRIBUTE_NAME = 'PACK_MATERIAL' .
endif.
But it is giving error... Null Object reference at ...CALL METHOD lo_message_manager->REPORT_ATTRIBUTE_ERROR_MESSAGE
here.. Pack_material is one column in table .. used as drop down, when ever i not select any value i want to display error msg,
but it is giving error.
2. when i use REPORT_ERROR_MESSAGE...
if i select one row in table, suppose drop down value is not select it is giving error, but lead selection is removing in this table
and above this another table is there, that lead selection also removing.. why?
Thanks,
Venkat.
HI Venkat,
I guess the element that you are passing to the method REPORT_ATTRIBUTE_ERROR_MESSAGE is initial.
Put a breakpoint and check the value at runtime.
Somehow you will have to get the element to which you want to raise the error message and pass the refrence to the method.
Thanks,
Aditya.
Hi Aditya,
Except pack-material value all values in that table are field na, so why lo_el_pack_mat contains null values???
Check my omplete code..
navigate from <CONTEXT> to <PACK_MAT> via lead selection
lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).
CALL METHOD lo_nd_pack_mat->get_selected_elements
RECEIVING
set = lt_temp.
LOOP AT lt_temp INTO wa_temp.
CALL METHOD wa_temp->get_static_attributes
IMPORTING
static_attributes = ls_pack_mat. // This contains all values except pack-material
lv_pack_material = ls_pack_mat-pack_material.
if lv_pack_material is initial.
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_ATTRIBUTE_ERROR_MESSAGE
EXPORTING
MESSAGE_TEXT = 'Please Select Packing Material...'
ELEMENT = lo_el_pack_mat
ATTRIBUTE_NAME = 'PACK_MATERIAL' .
Thanks,
Venkat.
Hi,
Please check this...
DATA lo_nd_pack_mat TYPE REF TO if_wd_context_node.
DATA lo_el_pack_mat TYPE REF TO if_wd_context_element.
DATA ls_pack_mat TYPE wd_this->Element_pack_mat.
DATA lt_pack_mat TYPE wd_this->Elements_pack_mat.
DATA lv_pack_material TYPE wd_this->Element_pack_mat-pack_material.
DATA: wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set.
navigate from <CONTEXT> to <PACK_MAT> via lead selection
lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).
CALL METHOD lo_nd_pack_mat->get_selected_elements
RECEIVING
set = lt_temp.
LOOP AT lt_temp INTO wa_temp.
CALL METHOD wa_temp->get_static_attributes
IMPORTING
static_attributes = ls_pack_mat.
lv_pack_material = ls_pack_mat-pack_material.
if lv_pack_material is initial.
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_ATTRIBUTE_ERROR_MESSAGE
EXPORTING
MESSAGE_TEXT = 'Please Select Packing Material...'
ELEMENT = wa_temp
ATTRIBUTE_NAME = 'PACK_MATERIAL' .
exit.
endif.
append ls_pack_mat to lt_pack_mat.
CLEAR ls_pack_mat.
ENDLOOP.
lo_nd_pack_mat->bind_table( new_items = LT_PACK_MAT
SET_INITIAL_ELEMENTS = abap_false ).
Thanks,
Venkat.
Pass the receiving paramater also..
Somthin like this..
DATA msg_id TYPE string.
CALL METHOD lo_message_manager->report_attribute_error_message
EXPORTING
message_text = 'hi'
element = lo_el_main
attribute_name = 'EMLID'
* params =
* msg_user_data =
* is_permanent = ABAP_FALSE
* scope_permanent_msg = CO_MSG_SCOPE_CTXT_ELEMENT
* msg_index =
* cancel_navigation =
* is_validation_independent = ABAP_FALSE
* enable_message_navigation =
* view =
receiving
message_id = msg_id
.
Thanks,
Aditya.
Hi,
With drop down UI element in table and using attribute_error_message wont work.
2. when i use REPORT_ERROR_MESSAGE...
if i select one row in table, suppose drop down value is not select it is giving error, but lead selection is removing in this table
and above this another table is there, that lead selection also removing.. why?
With out seeing your both table how they are connected , it is difficult to say why both tables are empty. Much more information is needed than what you have described so far.
Edited by: Baskaran Senthivel on Apr 11, 2011 9:12 AM
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.