Skip to Content
avatar image
Former Member

How to get layout name of ALV in Webdynpro

Hi experts,

Here's the problem I'm facing.

In webdynpro ALV setting, user create a personal layout and save it. When changing the layout from 'Standard view' to the new layout. The column (dropdown list of ALV table ) display as the key, acturally it was displayed as description originally. Could you help to solve this problem.

Or could you tell me what the method of class to get the layout variant. Then I'll add logic in the 'WDDOMODIFYVIEW' of view.

Thanks a lot advance.

Best Regards,

Wang

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 17, 2011 at 09:46 AM

    Are you saying that after changing the layout and saving it with new name your dropdown column is changing to fixed text view.

    Add comment
    10|10000 characters needed characters exceeded

    • HI

      if you are making any change in the layout and saving it it changes to key .

      is it happening like that.

      if yes i guess soemthing is wrong in the logic for creating dropdown cell editor.

      here is the code that i am writing for uding dropdown and no matter what i do it always displays descriptions instead of key

      can you paste yours

      DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
      lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_alv( ).
      
        DATA lo_value TYPE ref to cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
        ).
      lo_value->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( ABAP_FALSE ).
      data col type ref to cl_salv_wd_column.
      data celedi type ref to IF_SALV_WD_TABLE_CELL_EDITOR.
      
      data dropdown type ref to CL_SALV_WD_UIE_DROPDOWN_BY_KEY.
      create object dropdown
      exporting
        SELECTED_KEY_FIELDNAME = 'NAME'
        .
      col =  lo_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'NAME' ).
      celedi ?= dropdown.
      col->set_cell_editor( celedi ).
      
      DATA lo_nd_filter_values TYPE REF TO if_wd_context_node.
        DATA ls_filter_values TYPE REF TO if_wd_context_element.
      
      
        lo_nd_filter_values = wd_context->get_child_node( name = wd_this->wdctx_filter_values ).
      
        ls_filter_values = lo_nd_filter_values->create_element( ).
        ls_filter_values->set_attribute(
          name = `FIELDNAME`
          value = `NAME`    "Attribute name that you want to set filter.
        ).
        DATA l_wdy_key_value_table TYPE TABLE OF wdy_key_value.
        DATA l_wdy_key_value TYPE wdy_key_value.
      *Followings are filter values.
        l_wdy_key_value-key = `0`.
        l_wdy_key_value-value = ``.
        APPEND l_wdy_key_value TO l_wdy_key_value_table.
      
        l_wdy_key_value-key = `1`.
        l_wdy_key_value-value = `AAAA`.
        APPEND l_wdy_key_value TO l_wdy_key_value_table.
      
        l_wdy_key_value-key = `2`.
        l_wdy_key_value-value = `BBBB`.
        APPEND l_wdy_key_value TO l_wdy_key_value_table.
      
        l_wdy_key_value-key = `3`.
        l_wdy_key_value-value = `CCCC`.
        APPEND l_wdy_key_value TO l_wdy_key_value_table.
      
        ls_filter_values->set_attribute(
          name = `T_DROPDOWN_VALUES`
          value = l_wdy_key_value_table
        ).
      
      DATA NFINF TYPE REF TO IF_WD_CONTEXT_NODE_INFO.
      DATA ND1 TYPE REF TO IF_WD_CONTEXT_NODE.
      ND1 = WD_CONTEXT->GET_CHILD_NODE( 'ZDEALER' ).
      NFINF = ND1->GET_NODE_INFO( ).
      NFINF->SET_ATTRIBUTE_VALUE_SET(
      NAME = 'NAME'
      VALUE_SET = l_wdy_key_value_table
      
       ).

      thanks

      sarbjeet singh

  • avatar image
    Former Member
    Feb 17, 2011 at 10:30 AM

    The issue has been fixed.

    Thanks a lot

    Add comment
    10|10000 characters needed characters exceeded