Skip to Content
avatar image
Former Member

Select Option's Context Element for the REPORT_ATTRIBUTE_ERROR_MESSAGE

Hi,

We're on 7.0 ehp1.

I found a thread on same subject u201Cwdr:select_options and highlight Error Message with a Link to Inputfield u201C, Jul-23-2008, in which Thomas Jung gave an explanation of how to get the context element of the Select Options on a view.

I tried to follow it, but Iu2019m still not getting it. Please show how to get the context element of a Select Option for the u201CREPORT_ATTRIBUTE_ERROR_MESSAGEu201D .

wd_comp_controller->go_message_manager->report_attribute_error_message(

exporting

message_text = ls_messaga_text

element = ?????

attribute_name = ls_option_id

).

Thomas' explanation:

"...

I gave you the code that gets you to the interface controller. From there you call the GET_API to get the component controller. After you have the component controller it is normal context coding to read the context of the Select-Options context. Run the debugger and use the Web Dynpro view to see what your context looks like at runtime. When I test this with one of my applications, the names of the context nodes that were dynamically generated was really straight forward - as it uses the names of the select-option itself. Nothing special once you reach this point - just normal context coding...."

Kind regards,

Huntr

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 28, 2010 at 09:43 AM

    Hi ,

    Use the below approach to achieve this,

    data:

    lr_context_node type ref to if_wd_context_node,

    lr_element type ref to if_wd_context_element,

    message_text type string.

    • get the node and leadSelection of that field

    lr_context_node = get_node_of_sel_field( <field>-m_id ).

    lr_element = lr_context_node->get_lead_selection( ).

    case <field>-m_type.

    • For Select option field

    when if_wd_select_options=>mc_sscreen_item_type_field.

    m_message_manager->report_attribute_error_message(

    element = lr_element

    attribute_name = 'LOW'

    message_text = message_text ).

    • "For Parameter field

    when if_wd_select_options=>mc_sscreen_item_type_parameter.

    m_message_manager->report_attribute_error_message(

    element = lr_element

    attribute_name = 'VALUE'

    message_text = message_text ).

    when others.

    endcase.

    Add comment
    10|10000 characters needed characters exceeded