Quantcast
Channel: SCN : All Content - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 4552

Dependent dropdown list does not work as expected

$
0
0

Hello Sap CRM gurus,

 

I have a developping issue within the WebUi. I hope that this question will be not silly, since I am not a developper.

Anyway, I am building a dependent dropdown list between two attributes of a Z component created via AET.

So when the user select a value of the dropdown Y like '1' he should get in the second field X just the values 01 , 02 and 03. If the selection from Y is upon '2', he should get in the second field X the values 04, 05 and 06.

 

In order to do that I have just implemented my logic within the GET_V of the attribute X.

But unfortunately not only the filter does not work, but the first blank line of the dropdown of the attribute X has disappeared, so that I get always by default the first value '01'.

 

Below you find my code within the GET_V of the attribute X. Probably the last part of my code is wrong. I do not know how to delete the entries from

wa_domain_entries internal table in order to display them within the dropdown. I have already created a design layer for the attribute X, with a customizing activity.

 

  DATA: current TYPE REF TO if_bol_bo_property_access.

  DATA: dref    TYPE REF TO data,

LV_PRODUCT TYPE ZDTEL00004W,

LT_DOMAIN_ENTRIES type standard table of DD07V,

wa_domain_entries type DD07V.

  DATA :    lr_ddlb TYPE REF TO cl_crm_uiu_ddlb,

               it_ddlb TYPE bsp_wd_dropdown_table,

               wa_ddlb TYPE bsp_wd_dropdown_line.

  current = collection_wrapper->get_current( ).

  Current->get_property_as_value( EXPORTING iv_attr_name = ' ZZFLD00001J ' IMPORTING ev_result = LV_PRODUCT ).

*  CASE LV_PRODUCT.

*

*    WHEN  '01'.

IF LV_PRODUCT = '1'.

*lr_ddlb ?= rv_valuehelp_descriptor.

      CALL FUNCTION 'DD_DOMVALUES_GET'

        EXPORTING

          DOMNAME   = 'ZDTEL00002T'

          TEXT      = 'X'

          LANGU     = sy-langu

        TABLES

          DD07V_TAB = lt_domain_entries.

      IF SY-SUBRC <> 0.
* Implement suitable error handling here
      ENDIF.

*      READ TABLE lt_domain_entries INTO wa_domain_entries WITH KEY domvalue_l = '01'.

*      READ TABLE lt_domain_entries INTO wa_domain_entries WITH KEY domvalue_l = '02'.

*      READ TABLE lt_domain_entries INTO wa_domain_entries WITH KEY domvalue_l = '03'.

*      READ TABLE lt_domain_entries INTO wa_domain_entries WITH KEY domvalue_l = '04'.

*      READ TABLE lt_domain_entries INTO wa_domain_entries WITH KEY domvalue_l = '05'.

*      READ TABLE lt_domain_entries INTO wa_domain_entries WITH KEY domvalue_l = '08'.

      READ TABLE lt_domain_entries INTO wa_domain_entries WITH KEY domvalue_l = '09'.

      DELETE TABLE lt_domain_entries FROM wa_domain_entries.

      APPEND INITIAL LINE TO it_ddlb.

      LOOP AT lt_domain_entries INTO wa_domain_entries.
        wa_ddlb-key = wa_domain_entries-valpos.
        wa_ddlb-value = wa_domain_entries-ddtext.
        APPEND wa_ddlb TO it_ddlb.
        CLEAR wa_ddlb.
      ENDLOOP.

*    WHEN '02'.
*
*
*    WHEN '03'.
*
*
*    WHEN OTHERS.

      CREATE OBJECT lr_ddlb
  EXPORTING
          iv_source_type = 'T'.

      CALL METHOD lr_ddlb->set_selection_table
        EXPORTING
          it_selection_table = it_ddlb.

ENDIF.

*  ENDCASE.
  rv_valuehelp_descriptor ?= lr_ddlb.

 

Any help from you is really welcome for me.

 

Best Regards.

 

Andrea Canella


Viewing all articles
Browse latest Browse all 4552

Trending Articles



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