cancel
Showing results for 
Search instead for 
Did you mean: 

Validation and displaying error message on screen as link to that field

Former Member
0 Kudos

Hi,

I am trying to do validation checking on DropdownByIndex UI element but it is not working properly.

The scenario is , if the dropdown is left blank the error message will be displayed on screen as link and that dropdown will be marked in red and when you will click on that error message link it will take you to the drop down.

This is working fine with all inputfields other than DropdownByIndex

I can display the error message on screen but it is not coming as link and the dropdown is not marked in red.

I am using the method report_attribute_error_message of message manager,

here is the code sniplet :

CALL METHOD l_message_manager->report_attribute_error_message

EXPORTING

message_text = l_error_text

element = l_element (dropdown context element)

attribute_name = 'Attribute Name'. (context attribute name)

Please help me in this regard.

Thanks in advance,

Sonia

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Sonia,

u can try this.

1. Make the dropdown fields mandatory( by changing 'State' property.)

2. Use the "Check_mandatory_attr_on_view " method...

Just follow the code........

data:

lo_view_controller TYPE REF TO if_wd_view_controller,

msg_tab TYPE cl_wd_dynamic_tool=>t_check_result_message_tab.

lo_view_controller = wd_this->wd_get_api( ).

cl_wd_dynamic_tool=>check_mandatory_attr_on_view(

EXPORTING

view_controller = lo_view_controller

IMPORTING

messages = msg_tab ).

Hope this will solve ur purpose. Let me know...

Regards,

Aditya.

Former Member
0 Kudos

Hi Aditya,

Thanx a lot , ur code solved my problem.

Former Member
0 Kudos

Hi,

This works for me too, but exist a way do it only one time?

Or will I must put this source in each view?