Creating a Dropdown in SAP CRM WebUI


9.       In the constructor method, add the code shown in below image


10.   In GET_SELECTION_TABLE  method add the following code


 DATA : lt_domain_entries TYPE STANDARD TABLE OF dd07v,
         lt_sel_table TYPE bsp_wd_dropdown_table,
         ls_sel_table TYPE LINE OF bsp_wd_dropdown_table.
  FIELD-SYMBOLS : <domain> TYPE dd07v.
    EXPORTING          "Here we pass domain of the field to get possible entries
      domname        = 'BU_SEXID'
      text           = 'X'
      langu          = sy-langu
      dd07v_tab      = lt_domain_entries
      wrong_textflag = 1
      OTHERS         = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    APPEND INITIAL LINE TO lt_sel_table.
    LOOP AT lt_domain_entries ASSIGNING <domain>.
      ls_sel_table-key = <domain>-valpos.
      ls_sel_table-value = <domain>-ddtext.
      APPEND ls_sel_table TO lt_sel_table.
      CLEAR ls_sel_table.
    rt_result = lt_sel_table.

11.   Generate P_GETTER method for the field by Right clicking on the field selecting  and set the field property so that the field is displayed as a dropdown


12.   Save, Check and Activate this class as well as GET_V_SEX method in WebUI. Now execute and check output for Dropdown field along with entries in dropdown and it looks like

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image