Skip to Content
avatar image
Former Member

How to Change Field type : Input Field to Picklist

Hi Experts,

In Account Management, i have a field called "Function". Presently its a Input Field , I need to change its Type to : Picklist.

Component: BP_CONT

View : ContactDetails

Context Node : Workaddress

Attrubute : STRUCT.FUNCTION

Can anybody suggest me, how to change it.

Thanks & Regards

Shiven

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 10, 2008 at 09:00 PM

    Hi Shiva venkat,

    Enhance the view. For the attribute STRUCT.FUNCTION, regenerate all the Getter and Setter methods. In the GET_P method, put the following code

    CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter~fp_fieldtype.
           rv_value = cl_bsp_dlc_view_descriptor=>field_type_input.
         ENDIF.
    ENDCASE.
    

    This code sets the field type as dropdown list. For population of this field, check the GET_V method.

    Regards,

    Vinay

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Vinay,

      Is it possible to help me with the code or can you give some idea, how to go about for Get_V Method.

      Please let me know, if you need any inputs.

      Thanks & Regards

      Shiven

  • avatar image
    Former Member
    Nov 12, 2008 at 09:24 AM

    Hi Shiva,

    There step by step documentation "How-to Provide a Dropdown Box in a CRM Component"

    Go to http://service.sap.com/crm-inst

    Choose SAP Business Suite Applications->SAP CRM 2007->CRM WebClient UI->How-to Provide a Dropdown Box in a CRM Component.

    Sample code :

    method LOAD_SELECTION_TABLE.

    • Retrieves content of dropdown listbox

    • ... called in case table content comes from table

    (SOURCE_TYPE_TABLE)

    • Get content for selection table from database

    data: LV_DOMAIN_NAME type DOMNAME.

    LV_DOMAIN_NAME = IV_DOMAIN_NAME.

    data: LT_DOMAIN_ENTRIES type standard table of DD07V.

    call function 'DD_DOMVALUES_GET'

    exporting

    DOMNAME = LV_DOMAIN_NAME

    LANGU = SY-LANGU

    TEXT = 'X'

    tables

    DD07V_TAB = LT_DOMAIN_ENTRIES.

    if SY-SUBRC <> 0.

    message E009(DMCLG).

    endif.

    • Load and remember selection table

    data: LS_SELECTION_TABLE type line of

    BSP_WD_DROPDOWN_TABLE,

    LT_SELECTION_TABLE type BSP_WD_DROPDOWN_TABLE.

    field-symbols: <DOMAIN_ENTRY> type DD07V.

    loop at LT_DOMAIN_ENTRIES assigning <DOMAIN_ENTRY>.

    LS_SELECTION_TABLE-KEY = <DOMAIN_ENTRY>-VALPOS.

    LS_SELECTION_TABLE-VALUE = <DOMAIN_ENTRY>-DDTEXT.

    append LS_SELECTION_TABLE to LT_SELECTION_TABLE.

    endloop.

    GT_SELECTION_TABLE = LT_SELECTION_TABLE.

    endmethod. "SET_SELECTION_TABLE

    endclass.

    Hope its help.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Lielien / Vinay,

      Thanks for your replies.

      I have generated GET_V and GET_P methods for STRUCT.FUNCTION successfully.

      I have written code for GET_P as required and i have written the following code for GET_V method.

       method GET_V_FUNCTION.
      
      DATA:
          lt_ddlb  TYPE bsp_wd_dropdown_table,
          ls_ddlb  TYPE bsp_wd_dropdown_line,
          lr_ddlb  TYPE REF TO cl_crm_uiu_ddlb.
      
      * Initialization
        CREATE OBJECT lr_ddlb EXPORTING iv_source_type = 'T'.     "#EC NOTEXT
      
      * Get values for Function
        CALL METHOD cl_crm_uiu_bp_cust_get=>get_values_for_field
          EXPORTING
            iv_fieldname   = 'FUNCTION'
          RECEIVING
            rt_value       = lt_ddlb
          EXCEPTIONS
            error_occurred = 0
            OTHERS         = 0.
      
      * Add an empty line into the dropdown
        CLEAR ls_ddlb.
        INSERT ls_ddlb INTO TABLE lt_ddlb.
      
        lr_ddlb->set_selection_table( it_selection_table = lt_ddlb ).
      
        rv_valuehelp_descriptor = lr_ddlb.
      
      endmethod. 

      When i execute or run my WEB UI in Account management, the field has converted to picklist, but the problem is in when I click on that field it displays a message "THIS METHOD IS NOT IMPLEMENTED YET" instead of the values what i have maintained in SPRO -> CAC -> SAP BP---> BP Relationships

      -


      > Contact Person--->Define Functions.

      What and Where could be the problem? Can you please guide me.

      Hi, No clues? Is the code wrong? Need your suggestions.

      Thanks & Regards

      Shiven

  • avatar image
    Former Member
    Nov 20, 2008 at 03:02 PM

    Hi,

    However the code didnt work , i.e. picking the values by using function module , i have hardcoded the values.

    Thanks & Regards

    Shiven

    Add comment
    10|10000 characters needed characters exceeded