ALV: table settings - type hierarchy

Hi all,
I use this code:
table_node->set_lead_selection_index( index = lv_counter ).
to set needed row to selected. It works fine with no problems with regular ALV settings.
However, when I use hierarchichal table:
lr_table_settings->set_display_type( if_salv_wd_c_table_settings=>display_type_hierarchy ).
lead selection stops working. Is there a special way to handle this?
Thanks,
Georgy

Hi Georgy,
Lead selection works the same way for a hierarchical ALV as it works for the normal ALV display,  the only difference is that Lead Selection Index works on the lower level nodes only and not on the parent nodes in the hierarchy column. What I mean is: Suppose you have 4 nodes in your hierarchy column(top level nodes) and each of these has 4 sub rows in them, now if you set the lead selection to 5, the fifth row among the lower level rows will be selected. I checked this and it works fine in my case. Below is a sample code I use:
l_value->if_salv_wd_table_settings~set_display_type( if_salv_wd_c_table_settings=>display_type_hierarchy ).
  lv_index = 5.
  CALL METHOD lo_node_data->set_lead_selection_index
    EXPORTING
      index = lv_index.
I hope this helps you.
Thanks and Best Regards,
Viqar Ali.

Similar Messages

  • How to set title/text for ALV table column header in WD ABAP

    Hello,
    I am working in WDA using SALV_WD_Table to display data in table. I need to change the column header text, the obvious way is to get the column header and call the method SET_TEXT to set new text / title. However, this method does NOT work, it does not change the column header text. I also tried the SET_TOOLTIP, this one works, but SET_TEXT does not work. Anyone has idea why this not working and do you find any go-around solution?
    My version is NW 7.0
    Thank
    Jayson

    Hi jason ,
    For setting Heder text for your ALV table
    ip_confing type ref to CL_SALV_WD_CONFIG_TABLE.
    "set alv table header
      ip_config->if_salv_wd_table_settings~r_header->set_text( 'Test ALV Header functionality' ).
    first you have to hide the DDIC text and then try to set your own text .
    "modify columns
      LOOP AT lt_columns INTO ls_column.
        lr_column = ls_column-r_column.
        CASE ls_column-id.
          WHEN 'MANDT'.
            "hide this field
            lr_column->set_visible( cl_wd_abstr_table_column=>e_visible-none ).
           WHEN 'SEQNR'.
            "set header to different string
            lr_column->r_header->set_ddic_binding_field( if_salv_wd_c_column_settings=>ddic_bind_none )." use this line to hide ddic text
            lr_column->r_header->set_text( 'Position' ).     
        endcase.
      endloop.
    Regards
    Chinnaiya P

  • How to unhide the column in Alv table

    Hi Experts,
        Initially i have created webdynpro Alv table with 8 columns ,later i have added one more attribute/column to the node to display extra column
    but in the output ,alv table not displaying the 9th column,Instead the column is getting hidden which i came to know clicking on settings in alv table output.If i make changes in Alv table settings it getting displaying,can anyone tell me how to unhide this field.
    Regards
    Sandesh

    Hi Sandesh,
         It is possible that the user you are loggin in with, might have a layout saved.
    You can try logging in with different user and see if its still hidden.
    The explicit code to hide and unhide a column :
    lo_alv_column->set_visible( if_wdl_core=>visibility_none ).
    may be  you can use the above code and make column visibility true(cahnge parameter).
    Regards,
    Tashi

  • How to Email POWL Reports / Apply Web Dynpro ALV Table Layout Settings

    Hi all,
    we want to be able to automatically extract POWL reports and email them to users in a batch job.
    We can refresh a POWL report using FM POWL_QUERY_REFRESH, and access the raw report data using method CL_POWL_QUERY_ACCESSOR=>GET_CACHED_RESULTS.
    However this merely gives us a table of raw data.  No view layout (ie. Web Dynpro ALV table layout) settings have been applied, so there is no hiding or arranging of columns, row sorting, calculations or filters.
    Ideally we would like to be able to specify a query and view layout.  The batch job would then refresh and extract the data, and format the data according to the view layout before sending it on as an attachment in an email.
    Does anyone know how to determine and apply Web Dynpro ALV table layout settings to format table data outside of the Web Dynpro environment ?
    Thanks & regards,
    Grogan

    Hi Grogan,
    Did you find out how this works..i also have the same issue.
    Thanks
    Jdsouza

  • ALV Table - inhibit 'View' dropdown, filter button and settings button

    Can someone tell me what methods need to be used to modify an ALV table to inhibit the showing of the functioniality in the header?  I want to introduce this functionality to the users at a later date, but for now it should look like a standard table.

    Hi Bob.
    Hide / add function buttons in your ALV
    You can hide all function buttons of the ALV with one of these methods.
    Set toolbar visibility to false.
    data: lr_function_settings type ref to if_salv_wd_function_settings.
    lr_function_settings ?= wd_this->r_table. lr_function_settings->set_visible( CL_WD_UIELEMENT=>E_VISIBLE-NONE ).
    set default ALV Functions off
    data: lr_standard_functions type ref to if_salv_wd_std_functions.
    lr_standard_functions ?= wd_this->r_table.
    lr_standard_functions->set_sort_headerclick_allowed( ABAP_false ).
    lr_standard_functions->set_filter_filterline_allowed( ABAP_false ).
    lr_standard_functions->set_filter_complex_allowed( ABAP_false ).
    lr_standard_functions->set_sort_complex_allowed( ABAP_false ).
    You can set individual functions with these methods:
    CALL METHOD cl_salv_wd_config_table=>if_salv_wd_standard_functions~set_<x>_allowed
    EXPORTING
    Value = ABAP_true.
    Where <x> is to be replaced with the property of your choice.

  • ABAP WD: TreeByKeyTableColumn in ALV table (SALV_WD_TABLE)

    Hello,
    is is possible to add a TreeByKeyTableColumn object to a ALV table created
    using the SALV_WD_TABLE interface?
    I know that this question has already been posted several times - but the general answer ("use hierarchy columns and set_display_type( ..)") is not satisfying, since I have got the following:
    The context node of cardinality 0..n which corresponds to the "column tree" to be displayed has got
    - one KEY attribute
    - one PARENT_KEY attribute
    - one NODE_TEXT attribute
    - several attributes which correspond to the table lines (respectively tree lines)
    Example:
    The context of cardinality 0..n has got six attributes:
    KEY, PARENT_KEY, NODE_TEXT, col1 col2 col3.
    During runtime, there are five "lines" in this node:
    KEY    PARENT_KEY    NODE_TEXT   col1 col2 col3
    1         (none)                 "node1"             a      a     a
    2         1                        "node2"             b      b     b
    3         2                        "node3"             c      c     c
    4         1                        "node4"             d      d     d
    5         (none)                 "node5"             e      e     e
    The result should be in this case as if I'd have
    - a table with the columns col1, col2, col3 and
    - a TreeByKeyTableColumn with
         -- ROW_KEY      bound to KEY
         -- PARENT_KEY bound to PARENT_KEY
         -- containing a TextView with TEXT bound to NODE_TEXT
    Result in Display:
    -> node1             a   a   a                 <= Top level node
        ---> node2        b   b   b                 <= child of node with text "node1"
    > node3   c   c   c                 <= child of node with text "node2"
        ---> node4        d   d   d                 <= child of node with text "node1"
    -> node5            e   e   e                 <= Top level node
    Can this be established with the built in hierarchy functionality of the SALV_WD_TABLE interface, too?
    When playing around with the hierarchy columns functionality of SALV_WD_TABLE, I always got extra lines for the tree nodes with empty cells to the right (which I definitly don't want), and I was not able to use the parent_key<->key information already contained in the context node attributes.
    But perhaps I have overlooked something?
    Or is it possible to get somehow, by wild navigation through the available objects/classes/interfaces of the SALV_WD_TABLE interface, a reference to the corresponding table UI element to be able to dynamically add a TreeByKeyTableColumn with the wanted bindings?
    Regards & thanks for your help
    --Ute

    Once you have created a boolean attribute 'DAYS_READONLY' in the node bound to the DATA node of ALV, you need to set this attribute to false (for that row)  if you want DAYS field to be editable when the user creates another row. In the method where you have populated the data which is being displayed make this attribute as true for those rows.
    After this where you have made the ALV config settings write the following code.
      DATA: lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
      lr_column = lr_column_settings->get_column( 'DAYS' ).
      CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'DAYS'.
      lr_column->set_cell_editor( lr_input_field ).
      lr_input_field->set_read_only_fieldname( value = 'DAYS_READONLY' ).
      CALL METHOD lr_column_settings->delete_column
        EXPORTING
          id     = 'DAYS_READONLY'
    In this code you are creating input field as a cell editor and assigning it to DAYS column. After this you are setting the readonly property of the column DAYS to the value of the column 'DAYS_READONLY'. Since this column can have different values for each row, the column DAYS will be made readonly/editable accordingly. Finally you are deleting the column DAYS_READONLY from ALV output as we do not want to display its value to the user.
    For more info you can refer to thread: [ALV  List  in the same Column for the row  CELL  i need button or value;
    Edited by: Pooja Patodia on Mar 16, 2011 9:54 AM

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

  • How to display different icon within WDA alv table base on row data ?

    Hi,
    is that possible to display different icon for every row within ALV table depending on the row data ?
    for instance if the status 'S' display ~Icon/SuccessMessage and 'E' display ~Icon/ErrorMessage ?
    because base on this code below i only can set 1 icon for the whole row data.
    LOOP AT lt_columns ASSIGNING <fs_column>.
        CASE <fs_column>-id.
          WHEN 'ICO'.
            CREATE OBJECT lr_caption.
               lr_caption->set_image_source( value = '~Icon/SuccessMessage').
               <fs_column>-r_column->set_cell_editor( lr_caption ).
        ENDCASE.
      ENDLOOP.
    Thank you in advance.
    Fernand

    Hello,
    Yes it is possible to display different images based on data.
    For that what you can do is create one attribute 'STATUS' of type string in context node which you are mapping to ALV.
    And fill that attribute with the path to image based on your requirement like for status 'S' set the attribute to ~Icon/SuccessMessage and if status is 'E', set it to ~Icon/ErrorMessage at runtime.
    Now in the settings for ALV use the following code:
    * Display icon in column seatsocc
      DATA: lr_column TYPE REF TO cl_salv_wd_column,
            lr_image TYPE REF TO cl_salv_wd_uie_image,
            lv_icon TYPE string.
      lr_column = lv_model->if_salv_wd_column_settings~get_column( 'SEATSOCC' ).
      CREATE OBJECT lr_image.
      lr_image->SET_SOURCE_FIELDNAME( 'STATUS' ).
      lr_column->set_cell_editor( lr_image ).
    in the above code, column 'SEATSOCC' will be displayed as an icon.
    Sample code to fill the attribute 'STATUS'
    LOOP AT lt_flights INTO ls_flight.
        lv_seatsfree = ls_flight-seatsmax - ls_flight-seatsocc.
        IF lv_seatsfree = 0.
          ls_flight-status = 'ICON_RED_LIGHT'.
        ELSEIF lv_seatsfree <= 50.
          ls_flight-status = 'ICON_YELLOW_LIGHT'.
        ELSE.
          ls_flight-status = 'ICON_GREEN_LIGHT'.
        ENDIF.
        MODIFY lt_flights FROM ls_flight.
      ENDLOOP.
    Hope this helps!
    Regards,
    Srilatha
    Edited by: Srilatha M on Jun 25, 2010 12:02 PM

  • ALV table - cell editor??

    Hi,
      I am facing a strange issue, that my alv table is opening as editable format even i havnt write editable coding in doinit() method. i have written my coding in domodify().
    coding as follows:
    WHEN 'PRIORITY'.
    DATA: lr_column_settings_PRIORITY TYPE REF TO if_salv_wd_column_settings,
            lr_column_PRIORITY    TYPE REF TO cl_salv_wd_column,
            lr_input_field_PRIORITY TYPE REF TO CL_SALV_WD_UIE_DROPDOWN_BY_KEY.
    lr_column_settings_PRIORITY ?= lo_value.
    lr_column_PRIORITY = lr_column_settings_PRIORITY->get_column( 'PRIORITY').
    if MODIFY_PARAM eq ABAP_TRUE.
    *Getting the columns settings.
    CREATE OBJECT lr_input_field_PRIORITY EXPORTING SELECTED_KEY_FIELDNAME = 'PRIORITY'.
    lr_column_PRIORITY->set_cell_editor( lr_input_field_PRIORITY ).
    lr_table_settings->set_read_only( abap_false ).
    else.
        CREATE OBJECT lr_input_field_PRIORITY EXPORTING SELECTED_KEY_FIELDNAME = 'PRIORITY'.
        lr_input_field_PRIORITY->set_enabled( abap_false ).
    lr_column_PRIORITY->set_cell_editor( lr_input_field_PRIORITY ).
    lr_table_settings->set_read_only( abap_false ).
    ENDIF.
    What is wrong in this and how initially table is populating as editable?
    Please help me on this issue.
    Thanks,
    GS

    CREATE OBJECT lr_input_field_PRIORITY EXPORTING SELECTED_KEY_FIELDNAME = 'PRIORITY'.
    lr_column_PRIORITY->set_cell_editor( lr_input_field_PRIORITY ).
    lr_table_settings->set_read_only( abap_false ).
    else.
    CREATE OBJECT lr_input_field_PRIORITY EXPORTING SELECTED_KEY_FIELDNAME = 'PRIORITY'.
    lr_input_field_PRIORITY->set_enabled( abap_false ).
    lr_column_PRIORITY->set_cell_editor( lr_input_field_PRIORITY ).
    lr_table_settings->set_read_only( abap_false ).
    ENDIF.
    Write down the Read only property in your code as ABAP_TRUE.

  • How to link a tree to a ALV table

    Hi Experts,
    I have a tree node on the left side of my display.
    Now according to the user selection on the tree node,
    i need to populate the ALV table on the right.
    That means selected value by the user is the input parameter
    and should fetch the corresponding data accordingly and displays on the ALV table on the right.
    Please advise.
    Regards,
    Chitrasen

    Hi,
    Define the ON_FUNCTION event in the view controller. This is an event of your ALV.  In the coding of this event handler method put code like:
    METHOD on_select .
      DATA: temp TYPE string.
      temp = r_param->id.
      IF temp = 'LBUTTON'.
        wd_comp_controller->get_selected_line_via lead_selection( ).
      ENDIF.
    ENDMETHOD.
    What also needed is next code to be placed in method wdoinit of the component controller:
    METHOD wddoinit .
      DATA: l_ref_cmp_usage           TYPE REF TO if_wd_component_usage,
            l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table.
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
      l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
      wd_this->l_value = l_ref_interfacecontroller->get_model( ).
    *&- Specify the display type
      wd_this->l_value->if_salv_wd_table_settings~set_display_type(
                          if_salv_wd_c_table_settings=>display_type_hierarchy ).
      wd_this->l_value->if_salv_wd_table_settings~set_enabled( abap_true ).
    *&- Specify a hierarchy columns Bucket, RE, PE and AE
      lr_column = wd_this->l_value->if_salv_wd_column_settings~get_column( 'BUCKET' ).
      lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).
      lr_column = wd_this->l_value->if_salv_wd_column_settings~get_column( 'RE' ).
      lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).
      lr_column = wd_this->l_value->if_salv_wd_column_settings~get_column( 'PE' ).
      lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).
      lr_column = wd_this->l_value->if_salv_wd_column_settings~get_column( 'AE' ).
      lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).
    *&- Display data of the last hierarchy as leaf
      wd_this->l_value->if_salv_wd_table_hierarchy~set_last_hier_column_as_leaf( abap_true ).
    *&- Create function in toolbar
      DATA  lr_button TYPE REF TO cl_salv_wd_fe_button.
      DATA  button1 TYPE REF TO cl_salv_wd_function.
      CREATE OBJECT lr_button.
      lr_button->set_text( 'SELECT' ).
      button1 = wd_this->l_value->if_salv_wd_function_settings~create_function( id = 'LBUTTON' ).
      button1->set_editor( lr_button ).
    ENDMETHOD.
    Cheers, John

  • Displaying a row by default in ALV table

    Hi all,
    I have created an alv table in which i have to display a row by default. I have set all the fields of the table as editable.
    Also I have created the total calculation for the amount field by using the aggregation method, I want to displat the total grid also to be displayed by default.
    How can I set that value?? Please give some suggestions.
    Thanks in advance,
    Nalla.B

    Hi Nalla,
    As you know you should call the agregation methode for displaying the total row :
    DATA : alv_config_table  TYPE REF TO cl_salv_wd_config_table.
    DATA : lr_field TYPE REF TO cl_salv_wd_field.
    alv_config_table->if_salv_wd_std_functions~set_aggregation_allowed( abap_true ).
    lr_field =  alv_config_table->if_salv_wd_field_settings~get_field( 'CARRIED' ) . "The column name for which total needs
    lr_field->if_salv_wd_aggr~create_aggr_rule( aggregation_type =  if_salv_wd_c_aggregation=>aggrtype_total ).
    OK, i guess this is done in a specific methode 'METHODE_ALV' for the ALV settings.
    Row by default :
    Try to populate a line in your internal table, and bind it to the reference context of the ALV in WDDOINIT.
    and call the METHODE_ALV
    Sum row :
    Check if you are implementing a methode that intercept the ON_DATA_CHECK event, if yes try to recall the METHODE_ALV.
    > The aggregation methode must be recalled.
    Best regards.

  • ALV Table columns reset!

    Hello,
    I have a WD application with ALV Table integrated in a view. When i run this application, and modify the settings of this table and hide some columns, this changes get saved permanently, i.e., if i relaunch the application in a new window these columns are still hidden.
    How can i make sure that every time a user runs this application he gets to see all the columns no matter how he left his column settings in his earlier session. This problem exists with the standard SAP Demo ALV examples as well. And I am sure that some of you must have also faced this problem. How can i resolve this. Thanks.
    Regards,
    Vasu

    I am not sure if there is a method to restore the default settings. But when you initialize your ALV, you can probably make each column visible explicitly. The code for doing that would be:
    data: lt_col type salv_wd_t_column_ref,
            ls_col type salv_wd_s_column_ref.
    lt_col = l_alv_model->if_salv_wd_column_settings~get_columns( ).
    loop at lt_col into ls_col.
    ls_col-r_column->set_visible( abap_true ).
    endloop.
    Regards,
    Nithya

  • DropdownByKey inside ALV Table - Problem with Value set

    Hi,
    I have Component A which has a custom controller that uses the interface controller of the ALV Component.
    Custom controller has node ITAB.. that has certain attributes...
    I want DropdownByKey inside the ALV Table column. I am populating the corresponding attribute of ITAB node with the value set that I want the drop down to have.
    However when I execute the application..I get error
    " Key XXX not present in Value Set and is not initial"
    XXX is present in the Value Set table of the attribute.
    <b>Following is my code in the methods of CUSTOM CONTROLLER</b>
    <u>Generate Value Set</u>
    nodeinfo_context = wd_context->get_node_info( ).
    nodeinfo_ITAB= nodeinfo_context->get_child_node( wd_this->wdctx_ITAB ).
    <u> Populate the Value Set</u>
    data ls_valueset type wdy_key_value.
    data it_valueset type wdy_key_value_table.
    ls_valueset-key = 'FRA'.
    ls_valueset-value = 'FRANCE'.
    Append ls_valueset to it_valueset.
    ls_valueset-key = 'SFO'.
    ls_valueset-value = 'SAN FRANCISCO'.
    Append ls_valueset to it_valueset.
    <u>Set the Value Set for the Attribute</u>
    call method nodeinfo_ITAB->SET_ATTRIBUTE_VALUE_SET
                  EXPORTING
                     NAME = <b>'ATTR1'</b>
                     VALUE_SET = it_valueset.
    <u>Changing ALV Column</u>
    Get the ALV Configuration Model
      ifc_alv2 = wd_this->wd_cpifc_alv2( ).
      itab_alv2_config = ifc_alv2->get_model( ).
      itab_alv2_config->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_false ).
    <u>Get the Column reference for ATTR1</u> 
    ref_alv2_colset = itab_alv2_config->if_salv_wd_column_settings~get_column( <b>'ATTR1'</b> ).
    <u>Create the DropDownByKey Object</u>
    CREATE OBJECT ref_dropdownkey
              exporting SELECTED_KEY_FIELDNAME = ref_alv2_colset->id.
      ref_dropdownkey->SET_SELECTED_KEY_FIELDNAME( <b>ref_alv2_colset->id</b> ).
      ref_alv2_colset->SET_CELL_EDITOR( <b>ref_dropdownkey</b> ).
    <u>Check the value set</u>
      ref_attr_info = nodeinfo_flight_details2->get_attribute( ref_alv2_colset->id ).
    I do get back the value set if I see ref_attr_info->value_set.
    SO the Value Set is getting set for attribute ATTR1, but still I get Error
    <b>"The value selectedKey = "SFO" in DropDownByKey "_8C" does not exist in the value list and is not initial either "</b><u></u>
    SAP  User

    You have forgotten to set a cell variant. I had the same with setting a ProgressIndicator cell-editor to a table column as default editor. This causes the column to be hidden on the table while it did show up in the settings dialog. I removed the set_editor( lr_progressindicator) and created a cell variant instead with this lr_progressindicator. You then need to add this cell variant to your column. By default it will select the standard viewtext-cell-editor (which can only be textview and inputfield, like when you create a table yourself in a view), but if you use a cell variant, it will display the required cell editor if you set it (last line of the code).
    <b>In your case, replace lr_progressindicator by your ref_dropdownkey.</b>
      DATA: lr_column_settings    TYPE REF TO if_salv_wd_column_settings,
            lr_column             TYPE REF TO cl_salv_wd_column,
            lr_column_header      TYPE REF TO cl_salv_wd_column_header,
            lr_cellvar            TYPE REF TO cl_salv_wd_cv_standard,
            l_cellvar             TYPE string,
            lr_progress_indicator TYPE REF TO cl_salv_wd_uie_progr_indicator.
      lr_column_settings ?= wd_this->mr_table.
      lr_column = lr_column_settings->get_column( 'STATUSBAR' ).
      lr_column_header = lr_column->get_header( ).
      lr_column_header->set_text( 'Completed' ).
    CREATE OBJECT lr_cellvar.
      l_cellvar = 'CV_SB'.
      lr_cellvar->set_key( l_cellvar ).
      CREATE OBJECT lr_progress_indicator.
      lr_progress_indicator->set_percent_value_fieldname( 'STATUSBAR' ).
      lr_progress_indicator->set_tooltip( 'completed' ).
      lr_cellvar->set_editor( lr_progress_indicator ).
      lr_column->add_cell_variant( lr_cellvar ).
      lr_column->set_selected_cell_variant( l_cellvar ).
    I hope this will solve your issues.

  • Action on alv table dropdown field

    Hello Gurus,
    i have alv table with some fields .in that one field is dropdown contains YES and NO values.if i select YES value for that field i
    need to set some fields in editable mode in that same row or else if i select NO value those fields are in greyout.
    this is my requirement.how can i achive this requirement.could you suggest me on this.could you send me sample code or
    reference links if poosible.
    Could anyone please suggest solutions?
    and if possible send me the sample code for this requirement.
    Thanks in Advance for your replies.
    Regards,
    Babu

    Hi,
    Create a context attribute READ_ONLY in the node to whcih the ALV is bound.
    Implement the column settings.
    For those columns which you want to make them enable/disbale for those columns
    create a input field  CL_SALV_WD_UIE_INPUT_FIELD for that alv config object CL_SALV_WD_CONFIG_TABLE.
    there are many thread on the same please search SCN.
    data lo_config type ref to cl_salv_wd_config_table. "model object
    * GET THE MODEL OBJECT USING CODE WIZARD
    *GET THE COLUMN SETTINGS GET_COLUMNS of IF_SALV_WD_COLUMN_SETTINGS of CL_SALV_WD_CONFIG_TABLE
    * LOOP AT THESE COLUMNS and create an INPUT field for those columns to enable/disbale
    * pass this read_only field name
    lo_input->GET_READ_ONLY_FIELDNAME
    VALUE( 'READ_ONLY' ).
    First Time  in WDODOINIT-
    I suppose that dropdown column as NO for all rows.
    If that dropdown column name is CHOOSE
    LOOP AT IT_TAB into WA_ITAB.
    IF wa_itab-choose = 'NO'.
    wa_itab-read_only = abap_true. "disbale
    ELSE.
    wa_itab-read_only = abap_false. "Enabale
    ENDIF.
    ENDLOOP.
    Next when the drop down is selected then ON_DATACHECK event gets triggered (or check for other event also)
    Implement this event handler
    You will get the index in this Method importing parameters
    Try to read the node at that index. - USe code wizard
    DATA LO_NODE type ref to if_wd_context_node.
    LO_NODE = WD_context->get_child_node ( 'TEST' ). "node name
    LO_ELEMENT = LO_NODE->GET_ELEMENT ( index = lv_index ).
    if LO_ELEMENT is bound.
    LO_ELEMENT->set_static_attribute
    importing
    name = 'READ_ONLY'
    exporting
    value = abap_false.  "enable
    endif.
    Hope this helps.
    Regards,
    Lekha.

  • How to change font while displaying data through an ALV table in WDA?

    Hi all,
    I am displaying data through and ALV table. Now I want to change the FONT only for few rows. Is this possible?
    If so then do the needful to me..
    Thanks & Regards,
    Yugesh A.

    I believe as you have found 'LVC_FIELDCATALOG_MERGE' would only work with the classic dynpro (SAPGUI based) version of the ALV. 
    You won't be able to control the font the same way in the WDA version of the ALV.  You will need to create a custom cell editor for the column(s) in question.  You can then bind context attributes to the properties of the cell editor. You will need extra attributes in your bound context to control these settings on the row level.  Also you will be restricted by the changing the DESIGN property. This means only the values allowed for the DESIGN of the particluar UI element.  For a TextView that wouldn't be the font directly (the font of course comes from the Theme).
    DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv_adv( ).
      DATA l_table TYPE REF TO cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
      data textview type ref to CL_SALV_WD_UIE_TEXT_VIEW.
      l_column = l_table->if_salv_wd_column_settings~get_column( 'ADD_PARTICIPANTS' ).
      create object textview.
      textview->SET_TEXT_FIELDNAME( 'ADD_PARTICIPANTS' ).
      textview->set_design_fieldname( 'ADD_DESIGN' ).
      textview->set_wrapping( abap_true ).
      l_column->set_cell_editor( textview ).
    DESIGN supports the following options:
    Value
    Visual Display
    Description
    emphasized
    Text is highlighted in default size
    groupTitle
    Header for forms
    This enumeration value is deprecated. Instead, use SectionHeader.
    header1
    Text is highlighted with font size +4 in relation to the default font size.
    header2
    Text is highlighted with font size +5.08 cm relation to the default font size.
    header3
    Text is highlighted in default size
    header4
    Text is highlighted in font size -1 (small) in relation to the default font size (like the legend but highlighted)
    label
    Text is display in the default font type. A space is always inserted after the text.
    label_small
    Text is displayed in default font type, as with label, onyl that font size is -1 (like the font size for header4).
    legend
    Text is displayed with default font type in size -1.
    reference
    Text is in italics and in default font size.
    standard
    Text is displayed in default font size. No text attributes are defined for this value.
    monospace
    Text is displayed in no-proportional font type. Each letter takes up the same space.

Maybe you are looking for