cancel
Showing results for 
Search instead for 
Did you mean: 

REPORT_ATTRIBUTE_ERROR_MESSAGE in table column?

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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 ?/

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi..

The value lo_el_pack_mat is initial here.

Pass the value of workarea wa_temp to the paramater ELEMENT of method REPORT_ATTRIBUTE_ERROR_MESSAGE

and check..

Thanks,

Aditya.

Former Member
0 Kudos

Hi Aditya,

I already tried by passing wa_Temp as element, here i am not getting dump, but no reoor msg is displaying.

Thanks

Venkat.

Former Member
0 Kudos

I do not see any problem in the code other than ELEMENT paramater..

It should display error message ..

Anyways..Please post the proper code again..

Thanks,

Aditya.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Basakaran,

Then which method i ahve to use to display error message on dropdown table column?

Thanks,

Venkat.

Former Member
0 Kudos

You can use this method(REPORT_ATTRIBUTE_ERROR_MESSAGE) but it will not not highlight the column with redline around it as u would expect when using attribute error messages.