Quantcast
Channel: SCN: Message List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 7775

Re: populating the dropdown fields based on other dropdown fields

$
0
0

Hi Shivaprasad,

 

create one instance attribute in impl class weather that is static or instance as per your requirement. here i have created static attribute.

 

lable.JPG

every dorp down there is an in event eh_firstfield so to capture the selected value into that event.

DATA : lr_col TYPE REF TO if_bol_bo_col,

          lr_entity TYPE REF TO if_bol_bo_property_access.

 

 

   lr_entity ?= me->typed_context->btadminh->collection_wrapper->get_current( ).

CHECK lr_entity is BOUND.

 

lr_entity->get_property_as_string( EXPORTING iv_attr_name      = 'dropdownfield'  RECEIVING  rv_result  = gv_value ).


here gv_value your holding the first dropdown selected value based on this you have to populate 2nd drop down value so go to second drop down field.

get the instance of the attribute which you have declared earlier.


lv_value = zl_bt120h_c_details_impl=>gv_value.


i have copied the above example here..


Now in the get_v method of region attributes write the below code:

DATA:

       lt_sel_table     TYPE          bsp_wd_dropdown_table,

       lt_state           TYPE TABLE OF zregion,

       l_ref_ddlb_type  TYPE REF TO   cl_crm_uiu_ddlb,

       ls_sel_table     TYPE LINE OF  bsp_wd_dropdown_table,

       ls_state         TYPE          zregion.          "zregion is a database table

 

**** zregion table has region id, region name and country id which refers to the zcounty table

 

IF l_ref_ddlb_type IS NOT BOUND.

     CREATE OBJECT l_ref_ddlb_type

       EXPORTING

         iv_source_type = cl_crm_uiu_ddlb=>if_bsp_wd_valuehelp_pldescr~source_type_table.

   ENDIF.

 

here exactly you have to use your selected value..

 

SELECT * FROM zregion INTO TABLE lt_state WHERE countryid = lv_value.

**** In this query use your static variable that is created in view impl class which stores the current **** selected country id.


APPEND INITIAL LINE TO lt_sel_table.

LOOP AT lt_stateINTO ls_state.

     ls_sel_table-key   = ls_state-region_id.

     ls_sel_table-value = ls_state-region_name.

     APPEND ls_sel_table TO lt_sel_table.

     CLEAR: ls_sel_table, ls_state.

   ENDLOOP.

 

   l_ref_ddlb_type->set_selection_table( it_selection_table = lt_sel_table ).

   rv_valuehelp_descriptor = l_ref_ddlb_type.


hope this will helpful to you...


Thanks & Regards,

Srinvias.


Viewing all articles
Browse latest Browse all 7775

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>