cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a SELECT-OPTION mandatory

antony_paul2
Active Participant
0 Kudos

Dear all,

How to make a select-option mandatory in webdynpro abap.

Regards,

Antony

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

Add a parameter i_obligatory to add selection field with value X.

lr_helper->add_selection_field( i_id = 'S_CARR_ID'

it_result = lt_range

i_obligatory = 'X' <<======

i_description = 'description' ).

And you can use this code to check if there are any mandatory fields in your view or not.

If there are mandatory fields which are empty , it throws an error message " Please fill the complete entries"

data: lt_msg TYPE cl_wd_dynamic_tool=>t_check_result_message_tab,

lo_view_controller TYPE REF TO if_wd_view_controller,

lo_message_manager type ref to if_wd_message_manager.

lo_view_controller ?= wd_this->wd_get_api( ).

lo_message_manager = lo_view_controller->get_message_manager( ).

cl_wd_dynamic_tool=>check_mandatory_attr_on_view(

EXPORTING

view_controller = lo_view_controller

display_messages = abap_true

IMPORTING

messages = lt_msg ).

I hope it helps.

Edited by: Saurav Mago on Oct 22, 2009 12:30 PM

Answers (1)

Answers (1)

antony_paul2
Active Participant
0 Kudos

Thanks Saurav