cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a select options as mandatory

Former Member
0 Kudos

Dear Experts ,

I'm trying to make select options as mandatory in webdynpro. i write code like following

   CALL METHOD wd_this->m_handler->add_selection_field
  EXPORTING
    i_id                         = 'ZTSDATE'

    i_description                = 'Please Select Date range'
*    i_is_auto_description        = ABAP_TRUE
    it_result                    = LT_RANGE_TABLE
    i_obligatory                 = 'X'
    .
On output select options appearing as manadatory means '*' mark is appearing but when i trigger action without giving any value on select options it is going to give an runtime error. can u Explain me how to resolvw it?

Thanking You in adv,

Rajesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rajesh ,

in Webdynpro if you set obligatory parameters for any UI like inputfiel ,text edit or select option that does'n mean that system will check for mandatory fields . setting of obligatory parameters will jsut display the red asterisk symbol in from of the UI. you have to call the class for checking the mandatory check using method

cl_wd_dynamic_tool=>check_mandatory_attr_on_view

Regards

Chinnaiya Pandian

Former Member
0 Kudos

Hi Chinnaiya Pandian ,

  I wrote that logic under wdbeforemodify() but its not working. Did i miss any flow in program?

Former Member
0 Kudos

Rajesh .

The class i mentioned is  will not work for the select option .

write the below piece of code where u want to check the mandatory fields are entered .

dont write it in do modify

data : lv_error type i.

wd_this->M_HANDLER->check_all_selection_fields( IMPORTING

   E_NUM_ERROR_MSGS = lv_error ).

M_HANDLERis type ref to  IF_WD_SELECT_OPTIONS , this should be declared in attribute tab.

just i checked it working .

Regards

Chinnaiya Pandian

Former Member
0 Kudos

Hello All,

  I wrote select options to capture range of dates from user.

Former Member
0 Kudos

Not Active ContributorHi 

Former Member
0 Kudos

Rajesh ,

I replicated the same senario but i am not getting any dumps . pls check the data type and you code why its going  for dump .

Regards

Chinnaiya Pandian

Former Member
0 Kudos

Hi Chinnaiya ,

  Thank you . I resolved my issue. Its working fine. And i want to know whether can i use a View with Select options can be embedded into another view?

former_member222068
Active Participant
0 Kudos

Hi Rajesh,

  View with Select Options can be embedded into  anther view. Create a View Container UI element and embed the view to the view container. It works fine

Regards,

Sankar Gelivi

Answers (0)