cancel
Showing results for 
Search instead for 
Did you mean: 

How to Convert Valuehelp to Dropdown

Former Member
0 Kudos

Hi Gurus,

I am new to Crm. my requirement is In BP Overview Payment assignment block in that Payment card type  is value help but i want to convert to dropdown list with same values  how to achieve this  issue please help on the same .

regards,

karthik.

Accepted Solutions (1)

Accepted Solutions (1)

former_member205429
Contributor
0 Kudos

KarthikReddy,

Go to Get_V method and right now you will have a class inside this : CL_CRM_UIU_DDLB

u need to convert that into cl_bsp_wd_valuehelp_f4descr

u r done !!

Former Member
0 Kudos

Hi Santhosh,

Thanks for ur reply .

please provide some code to use convert valuehelp already values are there for that and we have to convert the same into dropdown.

Regards

Karthik.

former_member205429
Contributor
0 Kudos

Karthik Reddy,

as you are saying right now you have F4 help for that field right..

can u pls paste the code in the GET_V method of that attribute..

I will tell you how to convert that to Drop down ..

Former Member
0 Kudos

Hi santhosh,

In the GET_V method for Payment Card I have the Code.

DATA:

     lv_fieldname            TYPE name_komp,

     lt_fieldname_additional TYPE crmt_attr_name_tab.

   lv_fieldname = 'CARD_TYPE_TEXT'.                         

   INSERT lv_fieldname INTO TABLE lt_fieldname_additional.

   CALL METHOD cl_crm_uiu_bp_cust_get=>get_vhelp_for_field

     EXPORTING

       iv_fieldname            = 'CARD_TYPE'              

       iv_index                = iv_index

       it_fieldname_additional = lt_fieldname_additional

     RECEIVING

       rv_valuehelp_descriptor = rv_valuehelp_descriptor

     EXCEPTIONS

       OTHERS                  = 99.

where card_type_text is for Payment card Description attribute field.

former_member205429
Contributor
0 Kudos

DATA:lt_ddlb TYPE bsp_wd_dropdown_table,
      ls_ddlb type BSP_WD_DROPDOWN_LINE,
      lr_ddlb type REF TO CL_CRM_UIU_DDLB.

   IF lr_ddlb IS NOT BOUND.
     CREATE OBJECT lr_ddlb
       EXPORTING
iv_source_type = if_bsp_wd_valuehelp_pldescr=>source_type_table.

*   Get values for Card Type
     CALL METHOD cl_crm_uiu_bp_cust_get=>get_values_for_field
       EXPORTING
iv_fieldname   = 'CARD_TYPE'
       RECEIVING
rt_value       = lt_ddlb
       EXCEPTIONS
error_occurred = 1
OTHERS         = 2.
     APPEND INITIAL LINE TO lt_ddlb.
     IF sy-subrc = 0.
       loop at lt_ddlb into ls_ddlb.
         ls_ddlb-value = ls_ddlb-key" if you want show only the id
*       if you want to show id and its description
*       concatenate ls_ddlb-key '-' ls_ddlb-value into ls_ddlb-value separated by space.
         modify lt_ddlb from ls_ddlb transporting value.
       endloop.
       lr_ddlb->set_selection_table( it_selection_table = lt_ddlb ).
     ENDIF.
   ENDIF.

   rv_valuehelp_descriptor = lr_ddlb.

Use the above code and let me know in case of any issues !!

Former Member
0 Kudos

Hi  Santhosh,

I am also facing same issue but i issue still not yet solved because card no doesn't  exist error occurring. please help on this issue

i used below code for this

DATA:lt_ddlb TYPE bsp_wd_dropdown_table,
       ls_ddlb type BSP_WD_DROPDOWN_LINE,
       lr_ddlb type REF TO CL_CRM_UIU_DDLB.

    IF lr_ddlb IS NOT BOUND.
      CREATE OBJECT lr_ddlb
        EXPORTING
    iv_source_type = if_bsp_wd_valuehelp_pldescr=>source_type_table.

*   Get values for Card Type
      CALL METHOD cl_crm_uiu_bp_cust_get=>get_values_for_field
        EXPORTING
  iv_fieldname   = 'CARD_TYPE'
        RECEIVING
  rt_value       = lt_ddlb
        EXCEPTIONS
error_occurred = 1
OTHERS         = 2.

      clear lt_ddlb.
      APPEND INITIAL LINE TO lt_ddlb.
      IF sy-subrc = 0.

    ls_ddlb-key = 'DC'.

ls_ddlb-value = 'DC CARD'.

APPEND ls_ddlb TO lt_ddlb.

CLEAR ls_ddlb.

ls_ddlb-key = 'VISA'.

ls_ddlb-value = 'VISA CARD'.

APPEND ls_ddlb TO lt_ddlb.

CLEAR ls_ddlb.

ls_ddlb-key = 'AMEX'.

ls_ddlb-value = 'AMEX CARD'.

APPEND ls_ddlb TO lt_ddlb.

CLEAR ls_ddlb.



LOOP AT lt_ddlb into ls_ddlb.

ls_ddlb-key = ls_ddlb-key.

ls_ddlb-value = ls_ddlb-value.
  modify lt_ddlb from ls_ddlb transporting value.
*modify lt_ddlb from ls_ddlb.
*INSERT ls_ddlb_options INTO TABLE cs_result-ddlb_options.

ENDLOOP.

regards,

vishwanatha.

former_member205429
Contributor
0 Kudos

Viswanath,

Can u pls let me  know the issue you are facing ?

put a break point after this

*   Get values for Card Type
      CALL METHOD cl_crm_uiu_bp_cust_get=>get_values_for_field
        EXPORTING
  iv_fieldname   = 'CARD_TYPE'
        RECEIVING
  rt_value       = lt_ddlb
        EXCEPTIONS
error_occurred = 1
OTHERS         = 2.

and check whether lt_ddlb is getting filled or not ..

and lastly are you doing the below steps in your code

       lr_ddlb->set_selection_table( it_selection_table = lt_ddlb ).

   rv_valuehelp_descriptor = lr_ddlb.


Former Member
0 Kudos

Hi Santhosh,

i got answer in different way using below code...

METHOD get_v_card_type.
CALL METHOD SUPER->GET_V_CARD_TYPE
*  EXPORTING
*    iv_mode                 = IF_BSP_WD_MODEL_SETTER_GETTER=>RUNTIME_MODE
*    iv_index                =
   RECEIVING
     RV_VALUEHELP_DESCRIPTOR RV_VALUEHELP_DESCRIPTOR
     .

rv_valuehelp_descriptor = cl_crm_uiu_md_valuehelp=>v_getter(
                           is_tabname    = 'TB033'
                           is_fieldname  = 'CCINS').

Thank u for the response.

regards,

vishwanatha.

former_member205429
Contributor
0 Kudos

Viswanath,

thats what i am saying you.

Unless you fill the parameter rv_valuehelp_descriptor, GET_V doesnt work ..

And this is what i have mentioned in my previous thread.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

This is done in the GET_V-method. You can check other examples.

They normally look like this:

data: GR_DDLB_COMM_TYPE type ref to CL_CRM_UIU_DDLB.

data: lt_ddlb TYPE bsp_wd_dropdown_table.

    CREATE OBJECT gr_ddlb_comm_type
      EXPORTING

        iv_source_type = 'T'.

      gr_ddlb_comm_type->set_selection_table( it_selection_table = lt_ddlb ).

  rv_valuehelp_descriptor = gr_ddlb_comm_type.

Best regards,

Thomas Wagner

Former Member
0 Kudos

Hi Thomas,

Thanks for the response, I tried like that but nothing was coming in the Dropdown, actually for valuhelp values already are there for same values i need to convert to dropdown.  can u please help me in that..

Regards

Karthik