About DropDown in ALV

Hi, experts
  I want use the dropdown by key field in alv,
  How to catch the event 'ON_CLICK' when user choose
  a value from DropDown?
  Thanks you very much!

The SALV UI elements that are exposed as part of the ALV are a bit abstracted in order to encapsulate their usage within the ALV.  That does mean that you lose some of the control - not all events or properties of the underlying UI elements are exposed via their SALV counterparts.  I believe that in this case the event you want for DDLB is simply not exposed. 
Perhaps you should consider if the regular table UI element can meet your needs.  With a table UI element, you have full control of the column UI elements.

Similar Messages

  • Dropdown in ALV Grid (OO)

    Hi All,
    I am populating a dropdown in the ALV grid, Now I have a requirement to fill this dropdown when I press enter button after selecting a value in the grid for a previous column ,I have written the code for this but the values are not getting filled into the dropdown , I tried debug the program and found out that the internal table I am using to fill the dropdown is getting filled with correct values but when I am calling the function
    CALL METHOD g_grid->set_drop_down_table
        EXPORTING
          it_drop_down_alias = lt_dropdown.
    the values are not getting passed to that field in the grid.
    Please help.
    I am posting the code also.
    DATA : lt_ct1_mat TYPE STANDARD TABLE OF eina .
      DATA:  ls_dropdown TYPE lvc_s_dral.
      DATA : wa like line of lt_ct1_mat.
      SELECT * FROM eina INTO TABLE lt_ct1_mat
               WHERE matnr = l_partno.
      IF NOT lt_ct1_mat[] IS INITIAL.
      clear lt_dropdown[].
        LOOP AT lt_ct1_mat into wa.
          ls_dropdown-handle = '1'.
          ls_dropdown-value = wa-lifnr.
          APPEND ls_dropdown TO lt_dropdown.
          CLEAR ls_dropdown.
        ENDLOOP.
      ENDIF.
      CALL METHOD g_grid->set_drop_down_table
        EXPORTING
          it_drop_down_alias = lt_dropdown.
    Thanks

    Hi,
    Please check links,
    ALV Grid Control - Dropwdown / Checkbox
    Question about triggering event for ALV dropdown
    Regards,
    Hema.
    Reward points if it is useful.

  • About filter in alv grid display

    Hi,
       I am practicing on REUSE_ALV_GRID_DISPLAY in that i want to know about how to use some fields like
       *ITFILTER*_
       IT_ALV_GRAPHICS
       IT_HYPERLINK
       IT_ADD_FIELDCAT
       IT_EXCEPT_QINFO

    Hi Rock.
    I would like to suggest you a couple of references which quite relate to your case,
    REUSE_ALV_GRID_DISPLAY -  Output of a simple list (single-line)
    [SDN - Reference for Using REUSE_ALV_GRID_DISPLAY - Basic Program|alv prog;
    [SDN - Reference for Use of IT_FILTER in REUSE_ALV_GRID_DISPLAY |Doubts in ALV?;
    [SDN - Reference for use of IT_FILTER with CODE in REUSE_ALV_GRID_DISPLAY|ALV Report;
    [SDN - Refernce for Using IT_ALV_GRAPHICS in REUSE_ALV_GRID_DISPLAY|OOPs :  SAVE and ALV Display Variant;
    [SDN - Reference for Editing a graph in ALV (IT_ALV_GRAPHICS) using REUSE_ALV_GRID_DISPLAY|Edit Graph display ALV list display;
    [SDN - Reference for use of IT_HYPERLINK in REUSE_ALV_GRID_DISPLAY|editable fields on ALV grid;
    [SDN - Reference including example of IT_ADD_FIELDCAT in REUSE_ALV_GRID_DISPLAY|building top of page in ALV list;
    [SDN - Reference for scenario for use of IT_EXCEPT_QINFO in REUSE_ALV_GRID_DISPLAY|Background ID in ALV Grid;
    [SDN - Reference for application example of IT_EXCEPT_QINFO in REUSE_ALV_GRID_DISPLAY|PF Status in ALV list.;
    Hope That's Usefull.
    Good Luck & Regards.
    Harsh Dave

  • How to provide view selection dropdown like ALV

    Hi all,
    As you know, ALV can save your own view but it's embeded in component SALV_WD_TABLE. And I want to provide such a dropdown on selection screen before searching. Can I reference this dropdown directly?
    I've found out the db tables that store these info wdy_conf_usert and WDY_CONF_USER. It's feasible to select out relevant entries and fill the dropdown. Anyway, I don't think it's a good idea because I have to do so for each screen.
    Thanks,
    Felix

    Hi all,
    As you know, ALV can save your own view but it's embeded in component SALV_WD_TABLE. And I want to provide such a dropdown on selection screen before searching. Can I reference this dropdown directly?
    I've found out the db tables that store these info wdy_conf_usert and WDY_CONF_USER. It's feasible to select out relevant entries and fill the dropdown. Anyway, I don't think it's a good idea because I have to do so for each screen.
    Thanks,
    Felix

  • DROPDOWN in ALV webdynpro- the last value set entry coming double

    I have done one webdynpro alv display with one field as a drop down. The drop down is suppose to have values "yes" and "No". But strange its values is coming as "No" "Yes" and "No" (3 entries).
    I have created an attribute in context named "VALUESET".
    DROPDOWN wanted: option1 "Yes" option 2: "No"
    But its coming as :
    option1: "No" option2:"yes" option3:"No"
    Please seee the code below:
    SELECT
      PLNTCODE
      PLNTNAME
      USRID
      FIRSTNM
      LASTNM
      ABLTYID
      ABTYDES
      SOURCESYS
      ROLE
      ROLEDES
    FIELD
    VALF
    VALT
    ABTYBA
      SITENM
      REGION
      COSTCEN
      EMAIL
      BUNAME
      BNR
      RREVON
      RREVBY
       FROM ZBXX_CM_HCAR
       INTO CORRESPONDING FIELDS OF TABLE lt_output_alv
       UP TO 10 ROWS.
      LOOP AT lt_output_alv
        INTO ls_output_alv.
        MOVE sy-tabix TO w_tabix.
        FREE: LT_VALUESET.
        CLEAR : LS_VALUESET.
        CLEAR : ls_output_alv-valueset.
        CLEAR : ls_output_alv-BNR.
        MOVE 'Yes' TO LS_VALUESET-TEXT.
        MOVE 'Y' TO LS_VALUESET-VALUE.
        APPEND LS_VALUESET TO ls_output_alv-valueset.
        APPEND LS_VALUESET TO LT_VALUESET.
        CLEAR : LS_VALUESET.
        MOVE 'No' TO LS_VALUESET-TEXT.
        MOVE 'N' TO LS_VALUESET-VALUE.
        APPEND LS_VALUESET TO ls_output_alv-valueset.
        APPEND LS_VALUESET TO LT_VALUESET.
    CLEAR : LS_VALUESET.
        MODIFY lt_output_alv
          FROM ls_output_alv
          INDEX w_tabix
          TRANSPORTING
          BNR
          valueset.
        ENDLOOP.
      lo_nd_output_alv = wd_context->get_child_node( name = wd_this->wdctx_output_alv ).
    lo_nd_output_alv->bind_table( new_items = lt_output_alv ).
    DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
    DATA lo_cmp_usage           TYPE REF TO if_wd_component_usage.
    DATA lv_value               TYPE REF TO cl_salv_wd_config_table.
    DATA lr_column              TYPE REF TO cl_salv_wd_column.
    DATA lr_drdn                TYPE REF TO cl_salv_wd_uie_dropdown_by_idx.
    DATA lr_nodeinfo            TYPE REF TO IF_WD_CONTEXT_NODE_INFO.
    *DATA: lt_columns TYPE salv_wd_t_column_ref,
         lr_column_settings type ref to if_salv_wd_column_settings.
    *FIELD-SYMBOLS: <fs_column> LIKE LINE OF lt_columns.
    lo_cmp_usage =   wd_this->wd_cpuse_alv_display( ).
    IF lo_cmp_usage->has_active_component( ) IS INITIAL.
      lo_cmp_usage->create_component( ).
    ENDIF.
    lo_interfacecontroller =   wd_this->wd_cpifc_alv_display( ).
      lv_value = lo_interfacecontroller->get_model(
    lr_column_settings ?= lv_value.
      lr_nodeinfo = lo_nd_output_alv->get_node_info( ).
    lr_nodeinfo->set_attribute_value_set(
    EXPORTING
      name = 'BNR'
      value_set = lt_valueset ).
    CALL METHOD lv_value->if_salv_wd_column_settings~get_column
    EXPORTING
      id = 'BNR'
    RECEIVING
      value = lr_column.
    CREATE OBJECT lr_drdn
    EXPORTING
      selected_key_fieldname = 'BNR'.
    CALL METHOD lr_drdn->set_valueset_fieldname
    EXPORTING
      value = 'VALUESET'.
    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.
    Please help,
    Regards,
    Tashi Norbu

    Please Debug this part of your code:
    LOOP AT lt_output_alv
    INTO ls_output_alv.
    MOVE sy-tabix TO w_tabix.
    FREE: LT_VALUESET.
    CLEAR : LS_VALUESET.
    CLEAR : ls_output_alv-valueset.
    CLEAR : ls_output_alv-BNR.
    MOVE 'Yes' TO LS_VALUESET-TEXT.
    MOVE 'Y' TO LS_VALUESET-VALUE.
    APPEND LS_VALUESET TO ls_output_alv-valueset.
    APPEND LS_VALUESET TO LT_VALUESET.
    CLEAR : LS_VALUESET.
    MOVE 'No' TO LS_VALUESET-TEXT.
    MOVE 'N' TO LS_VALUESET-VALUE.
    APPEND LS_VALUESET TO ls_output_alv-valueset.
    APPEND LS_VALUESET TO LT_VALUESET.
    CLEAR : LS_VALUESET.
    MODIFY lt_output_alv
    FROM ls_output_alv
    INDEX w_tabix
    TRANSPORTING
    BNR
    valueset.
    ENDLOOP.
    I wager the problem to be in the Loop. Also be careful with using sy-tabix, I never use it because it can be 'unclean'. Using a counter variable which you increment manually after each loop is a much better choice.
    Get back after debugging!
    Cheers, Lukas

  • 2 questions about Dropdown Box Item

    Hi all,
    I just started using Design Studio and I have two questions about the Dropodown Box Item (well actually it's more about scripting...):
    - in the startup script of the application I want to populate one dropdown box with master data values of the infoobject 0FISCPER, how can I realize that? (if I use "DS_1.getMemberList...." I get only the values of 0FISCPER for which there is transaction data)
    - as a datasource I use a query with 2 variables:
         - Is it possible to populate these 2 variables with default values and skip the initial Variabile Initialization Screen?
         - I use 2 dropdown box items to set the values of these 2 variables. For one variable everything it's ok (I select the value in the dropdown and the      script populate the variable with that value and the data in the crosstable changes accordingly) but for the other variable associated to the 0FISCPER      infoobject when I select the value in the dropdown it's seem that nothing happens since the Variabile Initialization Screen pop-up and an error says that      I have to select a value for the variable. I did the same simple scripts for the these 2 variables, why does it work for one variable and not for the other?
    Thanks,
    Michele

    I answer myself about one question:
    "Is it possible to populate these 2 variables with default values and skip the initial Variabile Initialization Screen?"
    Yes, it's possible to create a script in order to populate the variables in the event "On Variable Initialization" of the Application and set false to the property "Force Prompts on Startup".

  • About field in alv

    hello experts:
    how to make a field mandatory in alv.
    best regards,
    Kevin

    Hi kevin,
    please visit the thread where the same doubt is being discussed.see this link:
    Re: Making a column Mandatory / Required in an Editable ALV Grid.
    you can try this also:
    FORM DATA_CHANGED USING P_ER_DATA_CHANGED TYPE REF TO
    CL_ALV_CHANGED_DATA_PROTOCOL .
    DATA: L_VALUE TYPE LVC_VALUE,
    ls_mod_cell type lvc_s_modi.
    READ TABLE P_ER_DATA_CHANGED->MT_MOD_CELLS INTO LS_MOD_CELL.
    if sy-subrc = 0.
    CALL METHOD P_ER_DATA_CHANGED->GET_CELL_VALUE
    EXPORTING
    I_ROW_ID = LS_MOD_CELL-row_id
    I_FIELDNAME = LS_MOD_CELL-fieldname
    IMPORTING
    E_VALUE = L_VALUE.
    IF LS_MOD_CELL-FIELDNAME 'fieldname what u want'
    MESSAGE 'ENTER VALUE INTO (fieldname u want) ' TYPE 'I'.
    ENDIF.
    ELSE.
    MESSAGE 'ENTER VALUE INTO (fieldname u want) ' TYPE 'I'.
    ENDIF.
    hope this helps.
    Thanks,
    Rahul
    Edited by: Rahul Kumar Sinha on Oct 14, 2008 12:48 PM

  • Question about subtotal in alv output

    I am using REUSE_ALV_GRID_DISPLAY for my ALV output.
    In that i am sub-totaling for quantity base on material group(MATKL). But also I want to display material group descriptions(WGBEZ) at the same subtotal-line. How can do that?

    Sort on the field WGBEZ...
    Check the sample program.
    TYPE-POOLS: SLIS.
    DATA: G_REPID LIKE SY-REPID,
    GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
    GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
    GT_FIELDCAT         TYPE SLIS_T_FIELDCAT_ALV,
    FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
    COL_POS TYPE I.
    DATA: BEGIN OF ITAB,
      FIELD1(5) TYPE C,
      FIELD2(5) TYPE C,
      FIELD3(5) TYPE P DECIMALS 2,
        FIELD4(5),
    END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB1.
    DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB_FIELDCAT.
    INITIALIZATION.
    G_REPID = SY-REPID.
    START-OF-SELECTION.
    MOVE 'TEST1' TO ITAB1-FIELD1.
    MOVE 'TEST1' TO ITAB1-FIELD2.
    MOVE '10.00' TO ITAB1-FIELD3.
    MOVE '1esr0' TO ITAB1-FIELD4.
    APPEND ITAB1.
    MOVE 'TEST2' TO ITAB1-FIELD1.
    MOVE 'TEST2' TO ITAB1-FIELD2.
    MOVE '20.00' TO ITAB1-FIELD3.
    MOVE 'sdtg0' TO ITAB1-FIELD4.
    APPEND ITAB1.
    DO 5 TIMES.
      APPEND ITAB1.
    ENDDO.
    END-OF-SELECTION.
    PERFORM BUILD.
    PERFORM CALL_ALV.
    FORM BUILD.
    * DATA FIELD CATALOG
    * Explain Field Description to ALV
    DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD1'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD2'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT    = ' '.
    FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME     = 'FIELD3'.
    FIELDCAT_LN-TABNAME       = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT        = ' '.
    FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME     = 'FIELD4'.
    FIELDCAT_LN-TABNAME       = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT        = ' '.
    FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    GS_LAYOUT-TOTALS_TEXT = ' My Total'.
    GS_LAYOUT-subtotals_text = 'subtot'.
    * DATA SORTING AND SUBTOTAL
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    <b>CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS      = 2.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.</b>
    ENDFORM.
    FORM CALL_ALV.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = G_REPID
    I_STRUCTURE_NAME = 'ITAB1'
    IS_LAYOUT =  GS_LAYOUT
    IT_FIELDCAT = GT_FIELDCAT[]
      IT_SORT = GT_SORT[]
    TABLES
    T_OUTTAB = ITAB1
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    ENDFORM.

  • About AVG in ALV List

    Dear Friends,
    I know that we can use do_sum in the fieldcatalog to make AVG calculation, e.g do_sum = 'C'
    but the function will automatically divide the total with the total line, what if I want to divide using static number, like 2?
    Please advice.
    Thank you,
    Sam

    hi sammyindra ,
    Check the demo program ERGP2127 (One-Line List with Total and Subtotal).
    It has logic for subtotals. You can use this logic for Averages.
    ls_fieldcat-do_sum = 'X'.
    ls_fieldcat-h_ftype = 'avg'.
    note: fieldcat should be of lvc type to achive the above
    1. Field Catalogue.
    use alvfc-do_sum = 'C'.
    C = average
    X = Sum
    2. In the mean time,
    using screen we can do like this :
    3. Show the alv list on screen first :
    4. EDIT ---> Calculate ---> Mean Value
    Regards
    Saurabh Goel

  • About event in alv

    Hi, expert
      We know when i set the column as LinkToAction or
      Button in alv, we can use the 'on_click' method to catch
      the action, but i set the column as dropdownbykey,
      I can not catch the action in 'on_click'.
      How to solve this problem?
      Thanks you very much!

    Hi,
    do sth. like this:
    CALL METHOD LR_ALV_CONFIG->IF_SALV_WD_TABLE_SETTINGS~SET_CELL_ACTION_EVENT_ENABLED
      EXPORTING
        VALUE  = ABAP_true.
    Regards,
    Hendrik

  • About Variants in ALV grid

    Hi all,
    I am displaying 4grids on a TAB Strip in ALV
    i have created one variant for each grid(report)
    But when i run the prog and press on F4 help for variant parameter, i am getting variants of all the grids
    Is there any way to get only those variants related to a particular grid.
    thanks in advance

    Hi,
    Specify different variant handles for each of the four grids. Some thing like the following,
    <b>ls_variant-report = <your program name>.</b>
    ****Set following handler different for each grid ****reference
    ****something like 'GRD1', 'GRD2' and so on..
    <b>ls_variant-handle = <your grid handle 4 characters>.</b>
        CALL METHOD ref_grid->set_table_for_first_display
          EXPORTING
          I_BYPASSING_BUFFER            =
          I_BUFFER_ACTIVE               =
          I_CONSISTENCY_CHECK           =
          I_STRUCTURE_NAME              =
    <b>        is_variant                    = ls_variant</b>
            i_save                        = 'A'
          I_DEFAULT                     = 'X'
            is_layout                     = ls_layout
          IS_PRINT                      =
          IT_SPECIAL_GROUPS             =
          it_toolbar_excluding          =
          IT_HYPERLINK                  =
          IT_ALV_GRAPHICS               =
          IT_EXCEPT_QINFO               =
          CHANGING
            it_outtab                     = lt_data
            it_fieldcatalog               = lt_fcat
          IT_SORT                       =
          IT_FILTER                     =
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
    Hope this helps..
    Sri
    Message was edited by: Srikanth Pinnamaneni

  • Multiple Listbox (dropdown) in ALV

    All,
    I have an ALV using class CL_GUI_ALV_GRID (Editable) and have drop down in 2 different columns , using following but in display both the columns shows same drop down values as OR & AND.
    Any Info?
      ls_fcat-fieldname = 'DROPDOWN_F4_1'.
      ls_fcat-datatype  = 'INT4'.
      ls_fcat-checktable = '!'.
      ls_fcat-no_out    = c_x.
      append ls_fcat to pt_fieldcat.
      clear ls_fcat.
      ls_fcat-fieldname = 'DROPDOWN_F4_2'.
      ls_fcat-datatype  = 'INT4'.
      ls_fcat-checktable = '!'.
      ls_fcat-no_out    = c_x.
      append ls_fcat to pt_fieldcat.
      ps_dropdown-handle = '1'.
      ps_dropdown-value = ' '.
      append ps_dropdown to pt_dropdown.
      ps_dropdown-handle = '1'.
      ps_dropdown-value = 'AND'.
      append ps_dropdown to pt_dropdown.
      ps_dropdown-handle = '1'.
      ps_dropdown-value = 'OR'.
      append ps_dropdown to pt_dropdown.
      call method g_grid->set_drop_down_table
        exporting
          it_drop_down = pt_dropdown.
      ps_dropdown-handle = '2'.
      ps_dropdown-value = ' '.
      append ps_dropdown to pt_dropdown.
      loop at i_ynetstat.
        ps_dropdown-handle = '2'.
        ps_dropdown-value = i_ynetstat-status.
        append ps_dropdown to pt_dropdown.
      endloop.
      call method g_grid->set_drop_down_table
        exporting
          it_drop_down = pt_dropdown.

    Hi,
    I tried your fieldcatalog and it is working correctly...The only thing I changed is the data type from INT4 to CHAR.
    Try changing to CHAR data type.
    DATA: ok_code     TYPE sy-ucomm,
          g_container TYPE scrfname VALUE 'CONTAINER1',
          g_grid      TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          gs_layout          TYPE lvc_s_layo.
    DATA: pt_dropdown TYPE lvc_t_drop,
          ps_dropdown TYPE lvc_s_drop,
          ls_fcat     TYPE lvc_s_fcat,
          pt_fieldcat TYPE lvc_t_fcat.
    TYPES: BEGIN OF type_output,
             dropdown_f4_1 TYPE char10,
             dropdown_f4_2 TYPE char10,
           END OF type_output.
    DATA: gt_outtab TYPE TABLE OF type_output.
    START-OF-SELECTION.
      APPEND INITIAL LINE TO gt_outtab.
    * Call the screen.
      CALL SCREEN 100.
    *       MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'TEST'.
      SET TITLEBAR 'MAIN100'.
    * Create the grid.
      IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
          EXPORTING
            container_name = g_container.
        CREATE OBJECT g_grid
          EXPORTING
            i_parent = g_custom_container.
    * field catalog.
        ls_fcat-fieldname = 'DROPDOWN_F4_1'.
        ls_fcat-drdn_hndl = '1'.
        ls_fcat-datatype  = 'CHAR'.  " Changed
        ls_fcat-checktable = '!'.
        APPEND ls_fcat TO pt_fieldcat.
        CLEAR ls_fcat.
        ls_fcat-fieldname = 'DROPDOWN_F4_2'.
        ls_fcat-drdn_hndl = '2'.
        ls_fcat-datatype  = 'CHAR'.    " Changed
        ls_fcat-checktable = '!'.
        APPEND ls_fcat TO pt_fieldcat.
    * Drop down box values 1
        ps_dropdown-handle = '1'.
        ps_dropdown-value = ' '.
        APPEND ps_dropdown TO pt_dropdown.
        ps_dropdown-handle = '1'.
        ps_dropdown-value = 'AND'.
        APPEND ps_dropdown TO pt_dropdown.
        ps_dropdown-handle = '1'.
        ps_dropdown-value = 'OR'.
        APPEND ps_dropdown TO pt_dropdown.
        CALL METHOD g_grid->set_drop_down_table
          EXPORTING
            it_drop_down = pt_dropdown.
    * Drop down box values 2
        ps_dropdown-handle = '2'.
        ps_dropdown-value = ' '.
        APPEND ps_dropdown TO pt_dropdown.
        ps_dropdown-handle = '2'.
        ps_dropdown-value = 'X'.
        APPEND ps_dropdown TO pt_dropdown.
        CALL METHOD g_grid->set_drop_down_table
          EXPORTING
            it_drop_down = pt_dropdown.
    * Display the ALV.
        gs_layout-edit = 'X'.
        CALL METHOD g_grid->set_table_for_first_display
          EXPORTING
            is_layout       = gs_layout
          CHANGING
            it_fieldcatalog = pt_fieldcat
            it_outtab       = gt_outtab.
      ENDIF.
    ENDMODULE.                    "pbo OUTPUT
    Thanks
    Naren

  • About Display interactive Alv

    Hi all,
    Can we create an interactive Alv on the same page on which the first Alv is placed?
    If so what is the process of that.
    Suggess.
    Sanket sethi.

    Hi Sanket,
    In the User Command form you have to simply repeat the process you carry out for a normal ALV grid Report i.e Build Catalog , Events, Top of Page, Set Menu and finally call the FM for Grid Display.
    U can refer to this thread - 
    PROGRAM FOR INTERACTIVE ALV REPORT

  • What's it all about ALV?

    Dear All
    This fine day I have had a fair few questions about the ALV land on my
    doorstep, asking what articles were around. I have never found any good
    ones. The online help ranges from patchy and confusing to non-existant, and
    keeps bursting into German. I started off with the example in the "reporting
    made easy" book which scratches the surface, and then have progressed by
    trial and error.
    The chances of there being any meaningful documentation for an SAP function
    module tend to be inversely proportional to how useful it is. One trick I
    have found is that when it tells you "Documentation not available in
    language EN", log off and log back on in German. Go back to the function
    module and look again. Sometimes the documentation appears - in English. But
    more often than not it's not there at all.
    Anyway, back to the ALV:-
    The things I have discovered were how to
    change the name of fields
    add extra buttons to the toolbar at the top
    get a box with the users selections to appear when the report is
    printed
    have traffic lights say if a record is OK or not
    allow the user to enter the initial display variant on the front
    screen
    have the user name and date appear at the top of the report
    Here is a "Frankenstien's Monster" containing extracts of code from several
    reports, and re-arranged into a logical order. this doesn't do anything, but
    contains examples of how to do all sorts.
    report z-alv_a_sixpence.
    include z_alv_include.
    Internal Tables
    Selection Screen
    Parameter for the user to choose how the initial screen will be (vital
    for running big reports in background)
    SELECTION-SCREEN BEGIN OF BLOCK blk3 WITH FRAME TITLE text-003.
    PARAMETERS: p_vari LIKE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK blk3.
    At Selection-Screen have a word with the display variant
    AT SELECTION-SCREEN.
    PERFORM check_variant.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
    PERFORM f4_for_variant.
    START-OF-SELECTION.
    END-OF-SELECTION.
    Build Field Catalogs (Begin)**************************
    PERFORM resetvalues.
    fieldcat_ln-key = 'X'.
    fieldcat_ln-hotspot = 'X'.
    PERFORM addfield USING '2' 'LIKP' 'WERKS'. "Plant
    PERFORM build_sortcat.
    ******Build Field Catalogs (End)*****************************
    ******Build Event Catalog (Begin)****************************
    PERFORM build_eventcat.
    PERFORM build_layout.
    ********Add a header at the top of the report *******
    PERFORM set_report_header USING w_list_top_of_page[].
    ********Start List Viewer
    PERFORM start_list_viewer.
    ******Start List Viewer (End)********************************
    *******Process Call Back Events (Begin)**************************
    FORM user_command USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
    CASE ucomm.
    WHEN '&IC1'.
    READ TABLE irepo INDEX selfield-tabindex.
    CHECK sy-subrc = 0.

    1. your listed programm below has an include (z_alv_include) which you
    didn't supply.
    2. have a look at the developement class 'SLIS' which contains manyexamples
    for ALV-programs.
    3. In BC405 one chapter is about reports with ALV.

  • Dropdown field in alv

    Hi,everyone.
    I have a problem with dropdown field in alv .
    When i set some fields dropdown in alv created by oo.
    i can't input words in this field . can anyone give me some advice?
    ths!

    Hi,
    steps..
    1. X_FIELDCAT-DRDN_HNDL = '1'. "pass this to the field you want to show as drop down
    2.
    DATA: X_OCRC LIKE LINE OF IT_OCRC.
      DATA:LT_DRAL TYPE LVC_T_DRAL,
            LS_DRAL TYPE LVC_S_DRAL.
      LOOP AT IT_OCRC INTO X_OCRC.
    * First listbox (handle '1').
        IF SY-INDEX = 1.
          LS_DRAL-HANDLE = '1'.
          LS_DRAL-VALUE =  ' '.
          LS_DRAL-INT_VALUE =  ' '.
        ELSE.
          LS_DRAL-HANDLE = '1'.
          LS_DRAL-VALUE =  X_OCRC-COMBI.
          LS_DRAL-INT_VALUE =  X_OCRC-COMBI.
        ENDIF.
        APPEND LS_DRAL TO LT_DRAL.
      ENDLOOP.
    **Setting the Drop down table for field1
      CALL METHOD G_GRID->SET_DROP_DOWN_TABLE
        EXPORTING
          IT_DROP_DOWN_ALIAS = LT_DRAL.
    for sample code check here i gave one.
    Event for the List Box in ALV Grid Control
    Regards
    vijay

Maybe you are looking for

  • T400 realtek wifi fails after short use, given IOMMU errors in dmesg

    Hello, thanks for reading. The title explains the problem pretty well.  I can connect to any given network just fine through wicd, but after a short bit of use the networking entirely stops and if I try to make any changes I get what I assume is a ke

  • How do I backup to a specific device at an specific moment?

    Here is what I want to do: - Any night of any day in the week, connect my external HDD to my Arch computer, and go to sleep. - At the next morning there is a backup done on that HDD. I understand the basics on some tools which can help me do that (cr

  • SQLJ vs. JDBC

    This was posted some time ago: Some advantages you gain in using SQLJ over JDBC for static SQL statements are: SQLJ uses database connections to type-check static SQL code. JDBC, being a completely dynamic API, does not do any type checking until run

  • Subclips in FCP6

    I'm sending clips, about 20 [10 second]cuts from a long [20 minute] single clip, to Motion to build an open. The problem is that when I tried to optically re-time one of the clips it analyzed the entire original [20 minute] clip. I wanted it to analy

  • Selling my 13" 2.53GHz MBP What should I sell it for:

    Im selling my MacBook Pro, and wondering how much it's worth? It's the 13.3" screen, 2.53GHz processor, 250GB Hard Drive, and 3 years AppleCare expires 6/9/2012. In excellent condition: no dead pixels, no dents, no problems. Leopard (10.5) and Snow L