Drop down in ALV grid

I am able to display the editable ALV. I am able to edit and save into my ztable. now, the issue is in editable cells I am able to enter through keyboard, but I want data for particular field from standard tables i.e. I am not getting dropdown as we get in normal ALV display. if this is solved my entire issue is solved.

Hi,
Create the serach help for the field in the ALV fieldcatalog.
If you were using OO ALV, then you need to register the field for F4.
it_f4-fieldname = 'Field name'
it_f4-register = 'X'.
it_f4-chngeafter = 'X'
APPEND it_f4 .
      CALL METHOD grid->register_f4_for_fields
       EXPORTING
          it_f4 = it_f4[].
Regards,
Satish Kanteti

Similar Messages

  • Reg displaying a Field as Drop Down in ALV Grid Display

    Hi All,
    I have developed an ALV report program with one editable field using FM "REUSE_ALV_GRID_DISPLAY_LVC". My requirement is to make that editable field as dropdown box so that user can choose from the options. If i press SAVE all those will gets saved in a Ztable. Everything is working fine. But no values are getting populated in dropdown box.
    Kindly do the needful.
    Thanks in advance.

    Hi,
    Check out follwing subroutines in below programs.
    perform build_fieldcat changing pt_fieldcat.
    perform set_drdn_table.
    BCALV_EDIT_06
    BCALV_EDIT_07

  • How does one come to know this..drop down in ALV in WD

    Hello Friends,
                          I had a requirement of adding a drop down in ALV, i eventually got it but I have some questions about it
    I used the following code and got the drop down
    lr_column = lr_column_settings->get_column( 'BWART' ).
      CREATE OBJECT lr_input_field
        EXPORTING
          value_fieldname = 'BWART'.
      lr_column->set_cell_editor( lr_input_field ).
    DATA : LR_DROPDOWN TYPE REF TO CL_SALV_WD_UIE_DROPDOWN_BY_KEY.
    CREATE OBJECT LR_DROPDOWN EXPORTING SELECTED_KEY_FIELDNAME = 'BWART'.
    LR_COLUMN->SET_CELL_EDITOR( LR_DROPDOWN ).
    DATA: LT_VALUESET TYPE TABLE OF WDR_CONTEXT_ATTR_VALUE,
    LS_VALUESET TYPE WDR_CONTEXT_ATTR_VALUE,
    LR_NODE TYPE REF TO IF_WD_CONTEXT_NODE,
    LR_NODEINFO TYPE REF TO IF_WD_CONTEXT_NODE_INFO.
    LR_NODE = WD_CONTEXT->GET_CHILD_NODE( 'RETURN_NODE' ).
    LR_NODEINFO = LR_NODE->GET_NODE_INFO( ).
    LS_VALUESET-VALUE = '973'.
    LS_VALUESET-TEXT = '973'.
    APPEND LS_VALUESET TO LT_VALUESET.
    LS_VALUESET-VALUE = '222'.
    LS_VALUESET-TEXT = '222'.
    APPEND LS_VALUESET TO LT_VALUESET.
    LR_NODEINFO->SET_ATTRIBUTE_VALUE_SET( EXPORTING NAME = 'BWART' VALUE_SET = LT_VALUESET ).
    My question is ... how does 1 know which class to use? how to use that class... most of concepts about OOPS are clear.. but i still cant figure out how does 1 find out which class to use.. is it all by expericence..

    In short: Yes, by experience. Then again, for WD4A there is a class for each UI-Element available. Once you know this, you can easily search se24 for CLWD<UI-NAME>* or the like.

  • Drop Down in ALV  ABAP and NOT in OO - ABAP

    Hello Everyone....
    I m workin on an ALV which is in simple ABAP and not in OO-ABAP. There is some selection criteria on the first screen , as soon as the user fulfills the requirement an ALV GRID is displayed in which the last column is editable.
      But the Problem is that i wanna make that editable field in ALV as drop down which would contain values from the database table.
      Suggest me some method , so that i dont have to do much changes in my code .
      A Sample code will be very benificial .
    Thanx n Regards,
    Harpreet.

    Hi Harpreet,
    [compiled from sap online help - always a good chice]
    To make an input/output field into a list box, you must set the value L or LISTBOX in the Dropdown attribute in the Screen Painter. The visLg attribute determines the output width of the list box and the field. You can assign a function code to a list box field. In this case, the PAI event is triggered as soon as the user chooses a value from the list, and the function code is placed in the SY-UCOMM and OK_CODE fields. If you do not assign a function code, the PAI event must be triggered in the usual way – that is, when the user chooses a pushbutton or an element from the GUI status.
    If you have assigned a list box to an input/output field, you can use the Value list attribute of the screen element to determine how the value list should be compiled. There are two options:
    Value list from input help (recommended)
    If you do not enter anything in the value list attribute, the text field uses the first column displayed in the input help assigned to the screen field. The input help can be defined in the ABAP Dictionary, the screen, or a POV dialog module. It should be laid out in two columns. The key is automatically filled.
    Value list from PBO modules (not recommended).
    If you enter A in the value list attribute, you must fill the value list yourself before the screen is sent (for example, in the PBO event) using the function module VRM_SET_VALUES. When you do this, you must pass an internal table with the type VRM_VALUES to the import parameter VALUES of the function module. VRM_VALUES belongs to the type group VRM. The line type is a structure consisting of the two text fields KEY (length 40) and TEXT (length 80). In the table, you can combine possible user entries from the KEY field with any texts from the TEXT component. You specify the corresponding input/output field in the import parameter ID.
    Examples
    Example
    Dropdown box with a value list from input help (recommended)
    *& Report DEMO_DROPDOWN_LIST_BOX                                 *
    REPORT demo_dropdown_list_box.
    *& Global Declarations                                           *
    * Screen Interfaces
    TABLES sdyn_conn.
    DATA   ok_code TYPE sy-ucomm.
    * Global data
    TYPES: BEGIN OF type_carrid,
             carrid type spfli-carrid,
             carrname type scarr-carrname,
           END OF type_carrid.
    DATA itab_carrid TYPE STANDARD TABLE
         OF type_carrid WITH HEADER LINE.
    *& Processing Blocks called by the Runtime Environment           *
    * Event Block START-OF-SELECTION
    START-OF-SELECTION.
    CALL SCREEN 100.
    * Dialog Module PBO
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    * Dialog Modules PAI
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'SELECTED'.
          MESSAGE i888(sabapdocu) WITH sdyn_conn-carrid.
    ENDCASE.
    ENDMODULE.
    * Dialog Module POV
    MODULE create_dropdown_box INPUT.
      SELECT carrid carrname
                    FROM scarr
                    INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'CARRID'
                value_org       = 'S'
           TABLES
                value_tab       = itab_carrid
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc <> 0.
    ENDIF.
    ENDMODULE.
    The next screen (statically defined) for screen 100 is 100. The only input field on the screen is the component SDYN_CONN-CARRID. Its Dropdown attribute is set to L, and it has the output length 20. The Value list attribute is empty, and it has the function code SELECTED. The function codes of the buttons EXECUTE and CANCEL. CANCEL are defined in the GUI status as having the function type E.
    The screen flow logic is as follows:
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
    PROCESS AFTER INPUT.
      MODULE cancel AT EXIT-COMMAND.
      MODULE user_command_0100.
    PROCESS ON VALUE-REQUEST.
      FIELD sdyn_conn-carrid MODULE create_dropdown_box.
    Users cannot enter any values into the screen fields. When they choose the input field on screen 100, the system displays a list box. The Value list attribute is empty, so the system launches the input mechanism. In this case, the event block PROCESS ON VALUE-REQUEST is created in the screen flow logic. This event block controls all other mechanisms. A two-column internal table is filled in the appropriate dialog module and passed to the input help using the F4IF_INT_TABLE_VALUE_REQUEST function module. The system inserts the two columns of the table into the list box.
    When the user chooses a line in the list box, the PAI event is triggered using the function code SELECTED and the value in the first column of the internal table is copied to the input field.
    Regards,
    Clemens

  • Drop Down in ALV

    Hi,
    i have a problem to insert value in drop down list in ALV. (I want to use  this call function CALLFUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC' or 'REUSE_ALV_GRID_DISPLAY)
    How can i  insert directly in ABAP 3 value. Example of code you can test this :
    report ZCO_AFFACT_TEST.
    * type pools
    TYPE-POOLS: SLIS.
    * declarations for alv and internal tables
    DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
    WA_FIELDCAT TYPE LVC_S_FCAT,
    WA_LAYOUT TYPE LVC_S_LAYO,
    V_POSITION TYPE I ,
    LS_CELLCOLOR TYPE LVC_S_SCOL,
    L_INDEX TYPE SY-TABIX.
    DATA: BEGIN OF IT_VBAP OCCURS 0,
    VBELN LIKE VBAP-VBELN,
    POSNR LIKE VBAP-POSNR,
    flag  LIKE ztypfac-flag,
    CELLCOLOR TYPE LVC_T_SCOL,
    END OF IT_VBAP.
    * start of selection
    start-of-selection .
    *---get data from db table
    perform get_data .
    *---build layout for alv
    perform build_layout .
    *---build fieldcat for alv
    perform build_fieldcat .
    *---modify fieldcat for colors in alv
    Perform modify_fieldcat .
    *---display alv
    perform display_alv .
    *& Form get_data
    FORM get_data .
    SELECT VBELN
    POSNR
    UP TO 25 ROWS
    INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
    FROM VBAP.
    ENDFORM. " get_data
    *& Form build_fieldcat
    FORM build_fieldcat .
    WA_FIELDCAT-FIELDNAME = 'VBELN'.
    WA_FIELDCAT-REPTEXT   = 'VBELN'.
    WA_FIELDCAT-edit      = 'X'.
    WA_FIELDCAT-drdn_hndl = '1'. "I have had
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'POSNR'.
    WA_FIELDCAT-REPTEXT = 'POSNR'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'FLAG'.
    WA_FIELDCAT-REPTEXT = 'FLAG'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    ENDFORM. " build_fieldcat
    *& Form build_layout
    FORM build_layout .
    WA_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
    WA_LAYOUT-ZEBRA = 'X'.
    ENDFORM. " build_layout
    *& Form modify_fieldcat
    FORM modify_fieldcat .
    LOOP AT IT_VBAP.
    L_INDEX = SY-TABIX.
    if l_index = 5 or l_index = 15.
    LS_CELLCOLOR-FNAME = 'VBELN'.
    LS_CELLCOLOR-COLOR-COL = '6'.
    LS_CELLCOLOR-COLOR-INT = '1'.
    APPEND LS_CELLCOLOR TO IT_VBAP-CELLCOLOR.
    MODIFY IT_VBAP INDEX L_INDEX TRANSPORTING CELLCOLOR.
    endif.
    if l_index = 10 or l_index = 20.
    LS_CELLCOLOR-FNAME = 'VBELN'.
    LS_CELLCOLOR-COLOR-COL = '4'.
    LS_CELLCOLOR-COLOR-INT = '1'.
    APPEND LS_CELLCOLOR TO IT_VBAP-CELLCOLOR.
    MODIFY IT_VBAP INDEX L_INDEX TRANSPORTING CELLCOLOR.
    endif.
    if it_vbap-VBELN is initial .
    delete it_vbap.
    endif.
    ENDLOOP.
    ENDFORM. " modify_fieldcat
    *& Form display_alv
    FORM display_alv .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
    I_CALLBACK_PROGRAM  = SY-REPID
    IS_LAYOUT_LVC       = WA_LAYOUT
    IT_FIELDCAT_LVC     = IT_FIELDCAT
    TABLES
    T_OUTTAB = IT_VBAP .
    ENDFORM. " display_alv
    Thank you for your answers!
    Edited by: Emilien P. on Jun 30, 2010 10:42 AM

    Finaly i have user OO because all the example use the Object...
    With my old ALV i have used User command and Hotspot, it is very easy to use.
    Now with the OO i have a problem to manage the hot spot and a cell, when i am in mode debug /h when i click on the cell with the hotspot nothing happen !!! I don't undertand what is missing
    report ZCO_AFFACT_TEST.
    Tables : VBRK, VBRP,ZTYPFAC.
    *-- Global data definitions for ALV
    *--- ALV Grid instance reference
    DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid .
    *--- Name of the custom control added on the screen
    DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV' .
    *--- Custom container instance reference
    DATA gr_ccontainer TYPE REF TO cl_gui_custom_container .
    *--- Field catalog table
    DATA gt_fieldcat TYPE lvc_t_fcat .
    *--- Layout structure
    DATA gs_layout TYPE lvc_s_layo.
    types : begin of wls_facture,
           ...        END OF wls_facture.
    types : begin of wls_resultat,
          ...        END OF wls_resultat.
    data : wlt_facture type TABLE OF wls_facture,
           wls_facture type          wls_facture,
           wlt_final   type TABLE OF wls_resultat,
           wls_final   type          wls_resultat.
    PERFORM BUILD_DATA.
    PERFORM display_alv.
    end-of-selection.
    call SCREEN 1000.
    "display_alv OUTPUT
    *&      Form  display_alv
    *       text
    FORM display_alv .
      IF gr_alvgrid IS INITIAL .
    *----Creating custom container instance
        CREATE OBJECT gr_ccontainer
          EXPORTING
            container_name              = gc_custom_control_name
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            others                      = 6.
        IF sy-subrc <> 0.
    *--Exception handling
        ENDIF.
    *----Creating ALV Grid instance
        CREATE OBJECT gr_alvgrid
          EXPORTING
            i_parent          = gr_ccontainer
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            others            = 5.
        IF sy-subrc <> 0.
    *--Exception handling
        ENDIF.
    *----Preparing field catalog.
        PERFORM prepare_field_catalog CHANGING gt_fieldcat .
    *----Preparing layout structure
        PERFORM prepare_layout CHANGING gs_layout .
        PERFORM prepare_drilldown_values.
    *----Here will be additional preparations
    *--e.g. initial sorting criteria, initial filtering criteria, excluding
    *--functions
        CALL METHOD gr_alvgrid->set_table_for_first_display
            EXPORTING
         is_layout                     = gs_layout
            CHANGING
          it_outtab                    = wlt_final
          it_fieldcatalog              = gt_fieldcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4 .
        IF sy-subrc <> 0.
    *--Exception handling
        ENDIF.
      ELSE .
        CALL METHOD gr_alvgrid->refresh_table_display
          EXCEPTIONS
            finished       = 1
            OTHERS         = 2 .
      ENDIF .
    ENDFORM .                    "display_alv
    If anybody  have an idea Thanks a lot !
    Emilien
    Edited by: Emilien P. on Jul 1, 2010 4:21 PM

  • Drop-downs in ALV: display list of code & value

    Hi All.
    When you define a Drop-down in Screen-editor (SE51) you'll get a field that contains list of code & value (if you set the "Show key within dropdown lists" option in the SAPGUI).
    I would like to see the same behaviour in ALV Drop-downs. Currently there are 2 options: create a list that shows codes only, or create a that shows the values and the codes are hidden.
    Both these options are set via the tables in Method "SET_DROP_DOWN_TABLE" of the CL_GUI_ALV_GRID class ([this is an example of how to set it|List Box in ALV Grid;).
    Any idea how to set it will be welcome and rewarded.
    Regards.
    Ayal Telem.

    Hi Ridhima,
    I need a drop down field in ALV list for my ABAP report. The user will select one of them and the report will go with this selection. How do you make such thing? I need it too..

  • Issue in value set Drop down for ALV in Webdynpro with Index

    Hi Experts,
    We are unable to get the Drop down values in the ALV Table as shown below.
    Code:
       DATA lo_nd_table TYPE REF TO if_wd_context_node.
        DATA lt_table TYPE wd_this->elements_table.
       DATA ls_table TYPE wd_this->element_table.
       DATA: lr_input TYPE REF TO cl_salv_wd_uie_input_field,
             lr_column TYPE REF TO cl_salv_wd_column,
             lt_node_info TYPE wdr_context_attr_info_map,
             ls_node_info TYPE wdr_context_attribute_info,
             lr_dropdown TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
             lr_info TYPE REF TO if_wd_context_node_info.
       DATA:lt_columns TYPE salv_wd_t_column_ref,
             ls_columns TYPE salv_wd_s_column_ref,
             lv_tabix TYPE sy-tabix,
             lv_count TYPE c.
       DATA: ls_valueset TYPE wdr_context_attr_value,
             lt_valueset TYPE wdr_context_attr_value_list.
       TYPES:BEGIN OF ty_name,
       name TYPE string,
       END OF ty_name.
       DATA: lt_name TYPE TABLE OF ty_name,
       ls_name TYPE ty_name.
    *   navigate from <CONTEXT> to <TABLE> via lead selection
       lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
       SELECT * FROM zemp_table INTO CORRESPONDING FIELDS OF TABLE lt_table UP TO 10 ROWS.
       LOOP AT lt_table INTO ls_table.
         lv_tabix = sy-tabix.
         CLEAR: ls_table-leave_values.
         DO 1 TIMES.
           lv_count = lv_count + 1.
           CONCATENATE 'Open' lv_count INTO ls_valueset-value.
           CONCATENATE 'Open' lv_count INTO ls_valueset-text.
           APPEND ls_valueset TO ls_table-leave_values.
           CLEAR ls_valueset.
           CONCATENATE 'Approved' lv_count INTO ls_valueset-value.
           CONCATENATE 'Approved' lv_count INTO ls_valueset-text.
           APPEND ls_valueset TO ls_table-leave_values.
           CLEAR ls_valueset.
           CONCATENATE 'Rejected' lv_count INTO ls_valueset-value.
           CONCATENATE 'Rejected' lv_count INTO ls_valueset-text.
           APPEND ls_valueset TO ls_table-leave_values.
           CLEAR ls_valueset.
         ENDDO.
         MODIFY lt_table FROM ls_table INDEX lv_tabix TRANSPORTING leave_status leave_values.
       ENDLOOP.
       DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
       lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
       IF lo_cmp_usage->has_active_component( ) IS INITIAL.
         lo_cmp_usage->create_component( ).
       ENDIF.
       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_interfacecontroller->set_data( r_node_data = lo_nd_value_set ).
    **Get the context node information
       lr_info = lo_nd_table->get_node_info( ).
       lt_node_info = lr_info->get_attributes( ).
       LOOP AT lt_node_info INTO ls_node_info.
         ls_name-name = ls_node_info-name.
         APPEND ls_name TO lt_name.
       ENDLOOP.
    *Get all the columns to make row editable
       CALL METHOD lo_value->if_salv_wd_column_settings~get_columns
         RECEIVING
           value = lt_columns.
    * Make the field dropdown
       CALL METHOD lo_value->if_salv_wd_column_settings~get_column
         EXPORTING
           id    = 'LEAVE_STATUS'
         RECEIVING
           value = lr_column.
    * Create Object for dropdown
       CREATE OBJECT lr_dropdown
         EXPORTING
           selected_key_fieldname = 'LEAVE_STATUS'.
       CALL METHOD lr_dropdown->set_valueset_fieldname
         EXPORTING
           value = 'LEAVE_VALUES'.
       CALL METHOD lr_dropdown->set_type
         EXPORTING
           value = if_salv_wd_c_uie_drdn_by_index=>type_key_convert_to_value.
       CALL METHOD lr_column->set_cell_editor
         EXPORTING
           value = lr_dropdown.
    *Set the table Editable
       lo_value->if_salv_wd_table_settings~set_read_only( value = abap_false ).
       lo_nd_table->bind_table( new_items = lt_table ).
    Please suggest me where we are going wrong.
    Thanks in advance...!!!
    Best Regard's,
    Shashi Kanth

    Hi Shashi,
    Your code looks okay.  Debug & check if everything goes fine and all the required list of values getting bound to node.
    Is any code after this logic, which sets data to table ? if so, that logic is wiping out the drop down list values from context node.
    Final check point:
    Read the context node 'TABLE' and fetch records into internal table in WDDOMODIFYVIEW( ) method to make sure that, every row of your table contains the drop down list entries in "LEAVE_VALUES" attribute
    Hope this helps you.
    Regards,
    Rama

  • Abt Drop Down For ALV Data cells

    Hi,
    I m unable to create drop down for each cell of ALV table.
    Reply me as soon as possible.
    Thks.

    You need to create an object of type CL_SALV_WD_UIE_DROPDOWN_BY_KEY, which is the UI element for dropdown by key, and set that to be your individual cell editor.
    For whichever column you want a dropdown box, use the method set_cell_editor to make the editor as a dropdown box. Hope this helps.
    Regards
    Nithya

  • Drop down in ALV for Webdynpro ABAP

    Hi Experts,
    I was trying to implement one Web dynpro ABAP application that will show one ALV and ALV will content one dropdown so that user can select data from the drop down. Addtion to that, my dropdown should have data based on another column of ALV.
    I have followed one article which is available in Net.
    At the end of development, ALV is displayed with dropdown. Also dropdown has data binded. However, no data is visible in dropdown.
    I have created one context node having four dictionary element and one elemt for dispplaying the dropdown.
    In the DoInit method of view, i have written below code:
    Data Declaration
      DATA:
            lo_node_cskt  TYPE REF TO if_wd_context_node,
            lo_el_cskt    TYPE REF TO if_wd_context_element,
            ls_cskt       TYPE wd_this->element_cskt,
            lt_cskt       TYPE wd_this->elements_cskt,
            lo_cmp_usage  TYPE REF TO if_wd_component_usage,
            lv_value      TYPE REF TO cl_salv_wd_config_table,
            lr_column     TYPE REF TO cl_salv_wd_column,
            lr_drdn       TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
            ls_value_set  TYPE wdr_context_attr_value,
            lv_tabix      TYPE sy-tabix,
            lv_count(2)  TYPE c,
            lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
    Navigate from <CONTEXT> to <CSKT> via lead selection:
      lo_node_cskt = wd_context->get_child_node( name = wd_this->wdctx_cskt ).
    get element via lead selection
      lo_el_cskt = lo_node_cskt->get_element( ).
    Get Data:
      SELECT kokrs kostl datbi ktext FROM cskt  INTO CORRESPONDING FIELDS OF TABLE lt_cskt.
      lv_count = 0.
    Populate value set
      LOOP AT lt_cskt INTO ls_cskt.
        lv_tabix = sy-tabix.
        CLEAR ls_cskt-ktext.
        DO 3 TIMES.
          lv_count = lv_count + 1.
          CONCATENATE 'TEST' lv_count INTO ls_value_set-text.
          CONCATENATE 'TEST' lv_count INTO ls_value_set-value.
          if lv_tabix = 2.
           if sy-index = 2.
             EXIT.
           endif.
          endif.
          APPEND ls_value_set TO ls_cskt-valueset.
        ENDDO.
        MODIFY lt_cskt FROM ls_cskt INDEX lv_tabix TRANSPORTING ktext valueset.
      ENDLOOP.
    Bind data
      lo_node_cskt->bind_table( lt_cskt ).
    Instantiate ALV
      lo_cmp_usage = wd_this->wd_cpuse_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
    Bind Data to Interface Controller Node
       lo_interfacecontroller->set_data(
            r_node_data = lo_node_cskt
    Get ALV reference table
       lv_value = lo_interfacecontroller->get_model( ).
    Make KTEXT column as drop down
       CALL METHOD lv_value->if_salv_wd_column_settings~get_column
       EXPORTING
         id = 'KTEXT'
       RECEIVING
         value = lr_column.
    Create Object for Drop down
      CREATE OBJECT lr_drdn
       EXPORTING
         selected_key_fieldname = 'KTEXT'.
      CALL METHOD lr_drdn->set_valueset_fieldname
      EXPORTING
        value = 'VALUESET'.
      CALL METHOD lr_drdn->set_type
      EXPORTING
        value = IF_SALV_WD_C_UIE_DRDN_BY_INDEX=>TYPE_KEY_CONVERT_TO_VALUE.
      CALL METHOD lr_column->set_cell_editor
      EXPORTING
        value = lr_drdn.
      CALL METHOD  lv_value->if_salv_wd_table_settings~set_read_only
      EXPORTING
        value = abap_false.
    I am still finding the answer why data in drop down is not visible. However, I can select by clicking dropdown and blank elements (since data is not visible) can be selected.

    Hey
    i am using  the same code except i have just modified little bit the select statement to restrict the number of entries.
    and also besides writing the code in wddoinit i have added the compenent usage of alv component and added the node
    having the structure ckst and after that deleting the dictionary reference to add the attribute valueset in both places
    component controller and view controller and mapped them and mapped the data node of interface controller of comp
    usage to this node in comp contrlr.
    and adding the view container and embeding table view of alv comp there.
    that's it
    and here is the code which is almost same as yours except small change in select statement.
    method WDDOINIT .
      DATA:
    lo_node_cskt TYPE REF TO if_wd_context_node,
    lo_el_cskt TYPE REF TO if_wd_context_element,
    ls_cskt TYPE wd_this->element_cskt,
    lt_cskt TYPE wd_this->elements_cskt,
    lo_cmp_usage TYPE REF TO if_wd_component_usage,
    lv_value TYPE REF TO cl_salv_wd_config_table,
    lr_column TYPE REF TO cl_salv_wd_column,
    lr_drdn TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
    ls_value_set TYPE wdr_context_attr_value,
    lv_tabix TYPE sy-tabix,
    lv_count(2) TYPE c,
    lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
    * Navigate from <CONTEXT> to <CSKT> via lead selection:
    lo_node_cskt = wd_context->get_child_node( name = wd_this->wdctx_cskt ).
    * get element via lead selection
    lo_el_cskt = lo_node_cskt->get_element( ).
    * Get Data:
    SELECT kokrs kostl datbi ktext FROM cskt INTO CORRESPONDING FIELDS OF TABLE lt_cskt up to 10 rows .
    lv_count = 0.
    * Populate value set
    LOOP AT lt_cskt INTO ls_cskt.
    lv_tabix = sy-tabix.
    CLEAR ls_cskt-ktext.
    DO 3 TIMES.
    lv_count = lv_count + 1.
    CONCATENATE 'TEST' lv_count INTO ls_value_set-text.
    CONCATENATE 'TEST' lv_count INTO ls_value_set-value.
    if lv_tabix = 2.
    if sy-index = 2.
    EXIT.
    endif.
    endif.
    APPEND ls_value_set TO ls_cskt-valueset.
    ENDDO.
    MODIFY lt_cskt FROM ls_cskt INDEX lv_tabix TRANSPORTING ktext valueset.
    ENDLOOP.
    * Bind data
    lo_node_cskt->bind_table( lt_cskt ).
    * Instantiate ALV
    lo_cmp_usage = wd_this->wd_cpuse_alv( ).
    IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
    ENDIF.
    lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
    * Bind Data to Interface Controller Node
    lo_interfacecontroller->set_data(
    r_node_data = lo_node_cskt
    * Get ALV reference table
    lv_value = lo_interfacecontroller->get_model( ).
    * Make KTEXT column as drop down
    CALL METHOD lv_value->if_salv_wd_column_settings~get_column
    EXPORTING
    id = 'KTEXT'
    RECEIVING
    value = lr_column.
    * Create Object for Drop down
    CREATE OBJECT lr_drdn
    EXPORTING
    selected_key_fieldname = 'KTEXT'.
    CALL METHOD lr_drdn->set_valueset_fieldname
    EXPORTING
    value = 'VALUESET'.
    CALL METHOD lr_drdn->set_type
    EXPORTING
    value = IF_SALV_WD_C_UIE_DRDN_BY_INDEX=>TYPE_KEY_CONVERT_TO_VALUE.
    CALL METHOD lr_column->set_cell_editor
    EXPORTING
    value = lr_drdn.
    CALL METHOD lv_value->if_salv_wd_table_settings~set_read_only
    EXPORTING
    value = abap_false.
    endmethod.
    thanks
    sarbjeet

  • Page Up and Page Down in ALV Grid

    Hello Experts,
    I have a simple ALV Grid report program. . If the report displays a lot of records then the scroll ups and downs can be used. However the new requirement is to make the page up, next, prevoius, down function. I have already included a SET PF-STATUS where I copied the standard and added the page up,down,next and previous. Those buttons/icons are now active in the toolbar but its not functioning as expected, nothing happens when it is being clicked. I've read some forums and below are the propose solutions:
    - Reduce the SAP work area --> how to reduce it?
    - Most forums are about ALV Grid report in OO and Dialog programming whereas a code will be put in PAI and PBO to make the page up, down buttons to function. --> How will this be applied since the report is just a simple report program (not OO or dialog)
    What is best solution to apply in my case?
    Thanks in advance!
    Best Regards,
    Alezandro

    hi kurtt
    Perhaps the below code, for scrolling the buttons can help u if the PF status and functionlity is already in place-
    module scroll_tab input.
    data: v_lines1 type sy-loopc.
    clear: ok_code,
    save_ok.
    ok_code = sy-ucomm.
    save_ok = ok_code.
    case save_ok.
    when 'PU'. "Page Up
    tc1-top_line = tc1-top_line - lv_looplines.
    if tc1-top_line < 1.
    tc1-top_line = 1.
    endif.
    when 'PD'. "Page Down
    tc1-top_line = tc1-top_line + lv_looplines.
    if tc1-top_line > lv_lines.
    tc1-top_line = ( lv_lines - lv_looplines ) + 1.
    endif.
    when 'PTU'. "Page total up
    tc1-top_line = 1.
    when 'PTD'. "Page total down
    TC1-TOP_LINE = ( LV_LINES - LV_LOOPLINES ) + 1.
    describe table it_vbak lines v_lines1.
    tc1-top_line = v_lines1.
    endcase.
    endmodule. " SCROLL_TAB INPUT
    regards
    praveen

  • Drop Down List in Grid is dependent on Dropdown List at Level 0

    Hi All,
    In my secondary page, there are three Drop-Down List Boxes D1, D2 and D3.
    D3 is in grid at Level 1 on secondary page and the prompt Table in D3 have 3 Keys.Key 1 and Key 2 are the same field as D1 and D2.As D3 is dependent on D1 and D2.
    First time, D3 remains empty even i select values in D1 and D2 but when i EndModal(1) and then come back , D3 has values.
    What is happening ?
    What is the solution of this scenario ?
    Thanks for your help in advance.

    D3 is in GRID_RECORD at Level 1.
    As Grid Record is totally dependent on D1 and D2.
    therefore, On field Change of D2 ,
    I delete the Grid Record,
    for &i = GRID_RECORD.ActiveRowCount to 1 Step -1
    GRID_RECORD.DeleteRow(&i);
    End-for;
    As a Result, The Default Row only present at Grid_Record, and D3 has no values.
    so i also include in field change of D2
    for &i = GRID_RECORD.ActiveRowCount to 1 Step -1
    GRID_RECORD.DeleteRow(&i);
    End-for;
    Local Rowset &RowSetGRID_RECORD;
    &RowSetGRID_RECORD =GetLevel0()(1).GetRowSet(Scroll.GRID_RECORD);
    &RowSetGRID_RECORD(1).GRID_RECORD.KEY1.VALUE = D1.Value;
    &RowSetGRID_RECORD(1).GRID_RECORD.KEY2.VALUE = D2.Value;
    Now D3 has values.
    Am i doing right, or there is any better solution ?

  • Check box and Drop down in ALV

    Hi all ,
    I am using ALV to display my output . I am narrating my question in a example ,
    For eg :  In my ALV in 1st column i am getting check boxes in all the rows but i want the check boxes oly in specific line no's and in the 3rd column i want to use dropdown list , so user can select some datas from the list , Depend upon the user selection in the drop down list i want to display the values in the 4th column .For every  selection in a drop down list
    4th column should refresh and give the values . So kindly provide some inputs to finish this task .
    Note : I am using set table for 1st display and Function Module  LVC_FIELDCATALOG_MERGE .

    Hi Saravanan.
    FOLLOW THIS .
    data    :   gd_layout    TYPE lvc_s_layo,     "slis_layout_alv,
                 gd_repid     LIKE sy-repid.
    TYPES:  BEGIN OF TY_ITAB,,
                   LINE TYPE CHAR10,
                   CHECK TYPE CHAR1,
                    .....................................END OF TY_ITAB..
    DATA: ITAB TYPE TABLE OF TY_ITAB,
                WA TYPE TY_ITAB.
      wa_fieldcat-fieldname   = 'CHECK'.
      wa_fieldcat-scrtext_m   = 'CHECK BOX'.
      wa_fieldcat-col_pos     = 8.
       wa_fieldcat-edit     = 'X'.
      wa_fieldcat-checkbox = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
    loop at itab into wa.
         if  wa-line <> 3 or  6 or 7.
          ls_stylerow-fieldname = 'CHECK' .
          ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
                                                 "set field to disabled
          APPEND ls_stylerow  TO wa-field_style.
          MODIFY itAB FROM wa.
         ENDIF.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_user_command =  USER_COMMAND
                is_layout_lvc               = gd_layout                              " Use this Parameter
                it_fieldcat_lvc             = it_fieldcat
                i_save                  = 'X'
           TABLES
                t_outtab                = ITAB
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    REGARDS
    MURTHY.

  • Insert data in drop down in alv at run time.

    Hi Gurus,
    I have to insert data in the dropdown wich is in alv at run time.According to my requirement i have i fill my drop down in the init but depend upon some conditions i have to insert one more vaule in the drop down at the run time.
    My problem is that i have filled the drop down with new data but it is not displayed in at the alv output.It is working fine without alv.
    Thanks & Regards.

    Hi,
    As per my understanding you want to update values in the drop down, on enter event of some other field.
    For that you have written the code for drop down twice 1) in the init method 2) in the on enter event of one field, right?
    If the code is not working in the on enter event, I think you can still use 'WDDOMODIFYVIEW' method. Follow the below steps:
    1) create one attribute of type char1 in the attributes tab of the view
    2) Set the value of that attribute to 'X' in the on enter event of other field (where you have written the code for drop down)
    3) In 'WDDOMODIFYVIEW' method, check the value of attribute. If this is 'X' run the code for updating drop down, then clear the value of attribute
    Regards,
    Saket.

  • Editable Drop down in ALV

    Hi,
    I am working on the ALV report using objects (custom container
    and cl_gui_alv_grid).
    I have a drop down editable field in the alv. How can i capture the
    selected values in the dropdowns for all rows when a button is clicked on appln tool bar.
    Thanks,
    Prasad

    Hi,
    Refer demo programs:-
    BCALV_EDIT_06 --                 Dropdown Listbox at Column Level
    BCALV_EDIT_07 --                 Dropdown Listbox at Cell Level
    Also you can refer:-
    Alv Drop down filling
    Hope this helps you.
    Regards,
    Tarun

  • Drop down in ALV List

    Hi,
    Is drop down feature available in ALV using
    REUSE_ALV_LIST_DISPLAY ?
    If Yes, How i can acheive that ?
    Thanks.

    Edited by: Maré Pretorius on Jun 9, 2009 7:09 PM
    Edited by: Maré Pretorius on Jun 9, 2009 7:23 PM

Maybe you are looking for

  • My iphone 3 won't let me download free apps from itunes

    Every time I try it makes me verify my payment info, and then it tells me my session has timed out.  Does anyone know what I am doing wrong?

  • How do I cycle a number of bars?

    Hi, When editing a midi track, I would like to cycle a few bars when I work with the editing. This could be for example bar 12 to 14. I don't want to cycle the whole region or section. I could not figure out this one. Help anyone? /Tony

  • We need integrate a Web Logic server 6.1 or 7.0 with Lotus Domino 5.x or 6.x

    Hello, We have a customer that for requirements from some applicactions needs Web Logic server 6.1 or 7.0 to work with Lotus Domino 5.x or 6.x According to our experience we think its possible but we will appreciate your opinion on the issue. We woul

  • Total Price in Purchase Requisition

    Hi, Is there a way or OSS notes that i can do to address our client requirement whereby to display the total estimate/valuted price in the Purchase Requisition? Eg. i have 2 line item 1. Computer  2pc 500/pc  = 1000 2. Mouse      2pc  35/pc   = 70 To

  • One button to flatten and email

    Is it possible to make a button programmed to email and flatten a fillable acrobat form?  The form will be used for reader mostly.