cancel
Showing results for 
Search instead for 
Did you mean: 

How to Change Field type : Input Field to Picklist

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Vinay,

Thankyou very much for your quick reply. I really appreciate it.

As a functional consultant and has juss begun my technical career, its bit difficult to understand things faster as technical consultants do.

I have opened Context node "Workaddress" and found Attribute "STRUCT.FUNCTION".

From here can you brief me step by step procedure.

Hope my reply didnt irritate you.

Thanks & Regards

Shiven

Former Member
0 Kudos

Did you enhance the view? I hope you have dont it by right clicking on the view and select the option ENHANCE.

Next the procedure is

1) Right click on the attribute STRUCT.FUNCTION.

2) Select the option "Generate V-GETTER".

3) The GET_V method of this attribute is generated.

4) In this method, put the code which i have given in my last post.

Regards,

Vinay

Former Member
0 Kudos

Hi Vinay,

Thank you very much for your step by step procedure, i am really learning things fast.

Vinay i understood that,

1) Select STRUCT.FUNCTION and click on "Enhance Component".

2) Right click on STRUCT.FUNCTION and click on "Generate V-GETTER". the "Get_V" method will be generated.

3) Right click on STRUCT.FUNCTION and click on "Generate P-GETTER" the "Get_P" method will be generated and i need to write the following code.

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

Vinay, now my doubt is, What about the code for "Get_V" method becuase i have seen other "Attributes" with Picklist field type. In "Get_V" method there is lot of code involved. Will this code be generated automatically, when we click on "Generate V-GETTER" ?

Do we need to write the code for this.

Thanks & Regards

Shiven

Former Member
0 Kudos

Yes, you have to write the code for the Get_V method to populate the dropdown list with values.

Regards,

Vinay

Former Member
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

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

Thanks & Regards

Shiven

Former Member
0 Kudos

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.

Former Member
0 Kudos

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