cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to make a field in selection criteria mandatory in SEARCH_UIBB?

tilakgupta
Discoverer
0 Kudos

I have designed a Selection Screen in WD component FPM_OVP_COMPONENT using SEARCH_UIBB. I need to make one of the fields on screen mandatory. How do I achieve that?If yes, Also, if one of the mandatory fields is not entered on screen, how to show the validation message on the WD screen?

Accepted Solutions (1)

Accepted Solutions (1)

tilakgupta
Discoverer
0 Kudos

Got the solution here..

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

In ET_FIELD_DESCRIPTION_ATTR parameter, there is one attribute namely mandatory. By using that attribute, you can make search fields mandatory.

Check the below sample code


METHOD if_fpm_guibb_search~get_definition.

  TYPES:

      BEGIN OF ty_search,

*                 include             TYPE srt_mselect_result,

                     created_by      TYPE srtm_created_by,

                     created_date    TYPE srtm_created_date,

                     created_time    TYPE srtm_created_time,

                     changed_date    TYPE srtm_changed_date,

                     changed_time    TYPE srtm_changed_time,

                     portal_id       TYPE num10,

                     only_errors     TYPE boolean,

           END OF ty_search .



  DATA : lw_field_desc    TYPE fpmgb_s_searchfield_descr.

  DATA: lt_field     TYPE TABLE OF fpmgb_s_search_operator,
        lw_field      LIKE LINE OF lt_field.

  eo_field_catalog_attr ?= cl_abap_tabledescr=>describe_by_name( 'TY_SEARCH'  ).


  lw_field-operator_id = '02'.
  lw_field-text = 'two'.
  APPEND lw_field TO lt_field.
  lw_field_desc-name = 'CREATED_DATE'.
  lw_field_desc-exclude_operators = lt_field.
  lw_field_desc-mandatory = abap_true.

  APPEND lw_field_desc TO et_field_description_attr.



  CLEAR lw_field_desc.
  lw_field_desc-name = 'ONLY_ERRORS'.

  lw_field_desc-is_of_type = 'BO'.

*  lw_field_desc-suppress_pattern_search = abap_true.

  APPEND lw_field_desc TO et_field_description_attr.


Hope this helps you.

Thanks

KH

tilakgupta
Discoverer
0 Kudos

Hi Katrice,

That only makes those parameters to show up on the top of all the other selection parameters. I can still go ahead and hit the search button to continue with the search.