cancel
Showing results for 
Search instead for 
Did you mean: 

Validation of Select Options

former_member645692
Participant
0 Kudos

hi all,

I have captured the values entered in select options in field symbols.

Can anyone tell me how to validate those values?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

After you get the values, have you bound them to context node attribtues that you are using for select-options.

If you have any button, in that handler you can validate them by getting the context node/select-options field values and use the message manager to throw the error.

Regards,

Lekha.

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I assume your problem is that the field symbol is generically typed?

You call this to get the values:

data: sel_fields type if_wd_select_options=>tt_selection_screen_item.
  wd_this->lv_sel_handler->get_selection_fields( importing et_fields = sel_fields ).

You can then loop through all the select-options and put each into a generic internal table. You can then loop through all rows in the generic internal table and cast each of the fields into a field symbol.

field-symbols: <wa_fields> like line of sel_fields,
                 <wa_generic> type table.
field-symbols:   <wa>          type any,
                         <option>      type char2,
                         <sign>        type char1,
                         <high>        type any,
                         <low>         type any.

* Build the field symbols for each Range table
  loop at sel_fields assigning <wa_fields>.
    assign <wa_fields>-mt_range_table->* to <wa_generic>.
    loop at <Wa_generic> assigning <wa>.
      assign component 'OPTION' of structure <wa> to <option>.
      assign component 'HIGH' of structure <wa> to <high>.
      assign component 'LOW' of structure <wa> to <low>.
      assign component 'SIGN' of structure <wa> to <sign>.
  endloop.
  endloop.