Wdr:select_options and highlight Error Message with a Link to Inputfield

Hi,
I have created a InputField on a View using WDR_SELECT_OPTIONS. I want to validate this Input Field and give
Error Message, when User fill it with wrong Values. How can we achieve this and important is to mark it on Screen WITH a RED STAR. ( e.g. highlighted )
Thanks!
Best Regards
Beserithan Malabakan

I've not tried it with select options before, but you might wan to have a look at setting the REPORT_ATTRIBUTE_ERROR_MESSAGE method of the message object.  This way the message gets attached to any UI element bound to the context attribute you issue the message for. But as I type this and think about it some more; I see where the problem lies.  The Select Options component doesn't follow an approach of cross component context binding.  It dynamically generates its own context.
If I had a little more time I would test this out; but it might be worth your while to research.  When you initialize the Select-Options, you normally get access to the interface controller:
data: l_ref_cmp_usage type ref to if_wd_component_usage.
  l_ref_cmp_usage =   wd_this->wd_cpuse_select_options( ).
  if l_ref_cmp_usage->has_active_component( ) is initial.
    l_ref_cmp_usage->create_component( ).
  endif.
* get a pointer to the interface controller of the select options
*component
  wd_this->lv_wd_select_options =
       wd_this->wd_cpifc_select_options( ).
* init the select screen
  wd_this->lv_sel_handler =
       wd_this->lv_wd_select_options->init_selection_screen( ).
This interface controller (LV_WD_SELECT_OPTIONS in my case). Has a GET_API method that returns the component controller.  In turn you might be able to access the context of the Select-Options directly. Its a crazy idea, but worth a try.

Similar Messages

Maybe you are looking for