Dropdown list in selection screen linking with Ztable

Hi,
In selection screen, i coded for parameter with dropdownlist with hardcoded values in the list. Client asking me link this list to Z table fields so that whenever they make entries in future just he need to create a variant for the new entries and program should work accordingly.

Hi,
Select the required entries from the Ztable and pass them to the function module VRM_SET_VALUES for populating the list box .
However there is a restriction .
The maximum  number of possible entries available (less than 40),If ,suppose large number of entries are there in Z table.
Selection from the drop-down list box menu is hindered by a scroll bar (due to a large number of entries) .
Also Sorting is not supported in drop-down list box menus, so the user is not offered ny help in managing huge number of values.
I would better suggest to go for a select-options or parameters attached with F4 help.
Regards,
Lakshman

Similar Messages

  • Display month and year in dropdown list on selection screen

    Hi
      Can anyone tell me how to display months and year in a dropdown list on a selection screen?
      also please tell me how to get the first and the last dates upon selecting the month and year on the dropdown list.
    Month: January Year:2007 . 
    After selecting the required month and year, the first date and last date i.e '01.01.2007 - 31.01.2007' should be displayed on the right side.
    Reward Points assured..
    thanks,
    Chetan

    Hi..,
    <b>
    Just copy, paste and execute this program !!</b>
    type-pools: vrm.
    parameters : p_month(2) type n as listbox visible length 10,
    p_year(4) type n as listbox visible length 10.
    DATA : W_DATE type d, w_ldate type d.
    initialization.
    perform user_drop_down_list_fordt.
    perform user_drop_down_list_foryr.
    start-of-selection.
    concatenate p_year p_month '01' into w_date.
    call function 'BKK_GET_MONTH_LASTDAY'
      exporting
        i_date        = w_date
    IMPORTING
       E_DATE        = w_ldate
    write /: w_date,w_ldate.
    build user_drop_down_list
    form user_drop_down_list_fordt.
    data: name type vrm_id,
    list type vrm_values,
    value like line of list.
    data: t_months type t247 occurs 0 with header line.
    clear list. refresh list.
    name = 'P_MONTH'.
    select * into  table t_months
    from t247 where spras eq 'EN'.
    sort t_months ascending by mnr.
    loop at t_months.
    clear value.
    value-key = t_months-mnr.
    value-text = t_months-ltx.
    append value to list.
    endloop.
    Set the values
    call function 'VRM_SET_VALUES'
    exporting
    id = name
    values = list.
    endform.
    for year...
    form user_drop_down_list_foryr.
    data: name type vrm_id,
    list type vrm_values,
    value like line of list.
    clear list. refresh list.
    name = 'P_YEAR'.
    do 9999 times.
    clear value.
    value-key = sy-index.
    append value to list.
    enddo.
    Set the values
    call function 'VRM_SET_VALUES'
    exporting
    id = name
    values = list.
    endform.
    <b>
    Hope this solves ur problem..</b>
    regards,
    sai ramesh

  • How to use dropdown list in selection screen

    Hi everyone.
    I'm stating a new report and a drop down list is required in initial filtering. I red different articles in google but  istill just don't get it... please help...

    Sample Code:
    TYPE-POOLS: vrm.
    DATA: name TYPE vrm_id, list TYPE vrm_values, value LIKE LINE OF list.
    * List box
    PARAMETERS: ps_parm AS LISTBOX VISIBLE LENGTH 10.
    INITIALIZATION.
    * Populate list box values
      name = 'PS_PARM'.
      value-key = '1'. value-text = 'Line 1'. APPEND value TO list.
      value-key = '2'. value-text = 'Line 2'. APPEND value TO list.
    AT SELECTION-SCREEN OUTPUT.
    * Set list box with value
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id     = name
          values = list.
    START-OF-SELECTION.
      WRITE: / 'Parameter:', ps_parm.
    Regards,
    Angelo.

  • Dropdown list in selection screen

    Hi guys,
    I am having a drop down list of 5 values in my selection screen.
    I am able to show the list of values in the droplist of the selection screen.
    How should I set default value in the list.
    Regards
    mac

    REPORT ztest1234.
    type-POOLs : vrm.
    PARAMETERS : dr1 as LISTBOX VISIBLE LENGTH 20,
    dr2 as LISTBOX VISIBLE LENGTH 20.
    DATA : lv_values TYPE vrm_values,
    lv_values1 TYPE vrm_values,
    gw_values like LINE OF lv_values.
    AT SELECTION-SCREEN OUTPUT.
    gw_values-key = '1'.
    gw_values-text = 'One'.
    append gw_values to lv_values.
    gw_values-key = '2'.
    gw_values-text = 'Two'.
    append gw_values to lv_values.
    gw_values-key = '3'.
    gw_values-text = 'Three'.
    append gw_values to lv_values.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    ID = 'dr1'
    VALUES = lv_values
    EXCEPTIONS
    ID_ILLEGAL_NAME = 1
    OTHERS = 2
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    else.
    dr1 = '1'. ( Just give ur id number which u wants to be default)
    ENDIF.
    With Regards,
    Sumodh.P
    Edited by: Sumodh P on Apr 23, 2010 12:25 PM
    Edited by: Sumodh P on Apr 23, 2010 12:26 PM
    Edited by: Sumodh P on Apr 23, 2010 12:30 PM

  • What r the list of selection screen events

    What r the list of selection screen events

    hi,
    chk out the following links...
    http://help.sap.com/saphelp_nw04/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/content.htm
    http://www.sap-img.com/abap/different-types-of-selection-screens.htm
    Regards,
    Viji

  • Display list on selection-screen

    Hello everyone,
    I've got a question concerning selection screen. I want to know, if there is a way to display list/table on selection screen after user input. Specifically, when user enters for example 30 invoice numbers into select-options, I need those 30 numbers displayed on the same selection screen.
    Thanks in advance

    instead u can print selection screen....along with output.....
    for this....
    You can use given function module to print your
    selection screen
    RS_REFRESH_FROM_SELECTOPTIONS
    >This will get Current contents of selection screen
    RS_LIST_SELECTION_TABLE
    >This will Generates list according to values in selection table(RSPARAMS)
    Sample
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
    curr_report = p_repid
    TABLES
    selection_table = it_int_tab
    EXCEPTIONS
    not_found = 1
    no_report = 2
    OTHERS = 3.
    IF sy-subrc EQ 0.
    WRITE:1 'Selection Criteria'(i19),
    /1 sy-uline(18),
    /1 'Variant Name'(i21),
    23 sy-slset.
    *-- This function module lists the Selection Screen contents
    CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
    EXPORTING
    report = p_repid
    seltext = 'X'
    newpage = space
    TABLES
    sel_tab = it_int_tab
    EXCEPTIONS
    sel_tab_empty = 1
    OTHERS = 2.

  • From ALV list to Selection-screen

    Hi,
    I have problem in coming back to selection screen after displaying ALV List.
    In ALV list i'm using check box option to delete selected records. After deletion I'm displaying the remaining records with one more call to ALV function module.
    As this is not a secondary list i'm not able to use SY-LSIND and even call selection-screen or leave to screen 0 are not working.
    could you please help me out.
    Thanks,
    Vinay.

    Hi
      You don't have to show the remaining records in another ALV.
      In the user command sub-routine we will be passing the parameter RS_SELFIELD TYPE SLIS_SELFIELD.
      When you delete the rows from the internal table in the user command set the refresh field to on.
      RS_SELFIELD-REFRESH = 'X'.
      Please let me know if it works.
    Thanks,
    Naren

  • Creating Transaction code for selection screen of one ztable

    Hi ,
        i have one Ztable in order see the data in it , he wants one new transaction . by executing tht transaction he wants to view the data inside the table.
    i have created one transaction code by taking the transaction type as report transaction and program name i gave the selection screen program of tht table.
    when i executed tht t code  selection screen of table contents should come and on executing it i have to get  data.
    but im not getting data on executing tht selection screen .
    why? for this scenario which tcode type i have to select.

    Hi Pavan,
    Check this,
    Step 1
    Create parameter transaction (i.e. via SE93)
    Select the fourth options
    Step 2
    Enter transaction details. Within the Proposed values section there are a number of value which
    can be setup, simply use drop down menu to view the list. The 2 values assigned in the following
    example are as follows:
                   VIEWNAME:        Set table name to maintained
                   UPDATE:               Open table for update
    Mohinder

  • Is it possible to change fonts in dropdown lists for question screens?

    I'm using Captivate 7, and creating training modules for a client with it. In these training modules, there are random quiz questions throughout. Some of these contain dropdown lists where the user will have to select choices A-D, etc. For some reason, after publishing, the fonts are all different within the dropdown list (Option A is in Times New Roman, Option B-D in Arial). I can't seem to find any option to edit these - does anyone have any insight on how to set these fonts?

    Figured this one out. Using the P1_ROWS item, added a static LOV with the correct values to override the one APEX was providing. The P1_ROWS item goes in the Number of Rows (Item) field in the layout and pagination section of the report.

  • Create a flat list from SELECTION-SCREEN

    Hi,
    I have a selection for date on in an report,
    SELECTION-SCREEN  BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : dat_rang FOR sy-datum.
    SELECTION-SCREEN END OF  BLOCK blk1.
    I want to create a flat list of dates from this selection. This list should exclude the date(s), which are excluded in the selection.
    Please give some starters on how to do this.
    Thank you,
    CD

    Here is another example, adding the dates to an internal table.
    REPORT  zrich_0001.
    TYPES: BEGIN OF t_datum,
            datum TYPE sy-datum,
           END OF t_datum.
    DATA: lt_datum TYPE TABLE OF t_datum.
    DATA: ls_datum LIKE LINE OF lt_datum.
    DATA: lv_date TYPE sy-datum.
    SELECTION-SCREEN  BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : dat_rang FOR sy-datum.
    SELECTION-SCREEN END OF  BLOCK blk1.
    INITIALIZATION.
      lv_date = '19000101'.
    START-OF-SELECTION.
      DO.
        IF lv_date IN dat_rang.
          ls_datum-datum = lv_date.
          APPEND ls_datum TO lt_datum.
        ENDIF.
        lv_date = lv_date + 1.
        IF lv_date = '20500101'.
          EXIT.
        ENDIF.
      ENDDO.
      LOOP AT lt_datum INTO ls_datum.
        WRITE:/ ls_datum-datum.
      ENDLOOP.
    Regards,
    Rich Heilman

  • Drop down list in selection screen.

    hello there,
    How to get a drop down list box in selection screen and in module pools.
    explain also, how to populate some data into that.

    *& Report  ZSREE_DROP                                                  *
    REPORT  ZSREE_DROP                    .
    TABLES : LFA1,EKKO,EKPO.
    TYPE-POOLS : VRM.
    DATA I1 TYPE I VALUE 0.
    DATA  : BEGIN OF WA_LFA1,
            LIFNR TYPE LIFNR,
            NAME1 TYPE NAME1,
            END OF WA_LFA1.
    DATA IT_LFA1 LIKE TABLE OF WA_LFA1.
    DATA : BEGIN OF WA_EKKO,
           EBELN TYPE EBELN,
           END OF WA_EKKO.
    DATA IT_EKKO LIKE TABLE OF WA_EKKO.
    DATA : BEGIN OF WA_EKPO,
           EBELP TYPE EBELP,
           END OF WA_EKPO.
    DATA IT_EKPO LIKE TABLE OF WA_EKPO.
    DATA : BEGIN OF WA_VRM,
           KEY(40) TYPE C,
           TEXT(80) TYPE C,
           END OF WA_VRM.
    DATA IT_VRM LIKE TABLE OF WA_VRM.
    *&      Module  USER_COMMAND_0100  INPUT
          text
    module USER_COMMAND_0100 input.
    CASE SY-UCOMM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'PDOC'. "fctcode for first list box
    CLEAR IT_EKKO.
    SELECT EBELN INTO TABLE IT_EKKO FROM EKKO WHERE LIFNR = LFA1-LIFNR.
    CLEAR IT_VRM.
    LOOP AT IT_EKKO INTO WA_EKKO.
    WA_VRM-KEY = WA_EKKO-EBELN.
       WA_VRM-TEXT = WA_EKKO-EBELN.
       APPEND WA_VRM TO IT_VRM.
    CLEAR WA_VRM.
    ENDLOOP.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        ID                    = 'EKKO-EBELN'
        VALUES                = IT_VRM
    EXCEPTIONS
      ID_ILLEGAL_NAME       = 1
      OTHERS                = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WHEN 'PITEM'. "fctcode second listbox
    CLEAR IT_EKKO.
    SELECT EBELP INTO TABLE IT_EKPO FROM EKPO WHERE EBELN = EKKO-EBELN.
    CLEAR IT_VRM.
    LOOP AT IT_EKPO INTO WA_EKPO.
    WA_VRM-KEY = WA_EKPO-EBELP.
       WA_VRM-TEXT = WA_EKPO-EBELP.
       APPEND WA_VRM TO IT_VRM.
    CLEAR WA_VRM.
    ENDLOOP.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        ID                    = 'EKPO-EBELP'
        VALUES                = IT_VRM
    EXCEPTIONS
      ID_ILLEGAL_NAME       = 1
      OTHERS                = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDCASE.
    endmodule.                 " USER_COMMAND_0100  INPUT
    **&      Module  STATUS_0100  OUTPUT
          text
    module STATUS_0100 output.
      SET PF-STATUS 'ZSREE'.
      SET TITLEBAR 'ZSREE'.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Module  SELECT_LIST  OUTPUT
          text
    module SELECT_LIST output.
    CLEAR IT_LFA1.
    SELECT LIFNR NAME1 INTO TABLE IT_LFA1 FROM LFA1.
    CLEAR IT_VRM.
    LOOP AT IT_LFA1 INTO WA_LFA1.
       WA_VRM-KEY = WA_LFA1-LIFNR.
       WA_VRM-TEXT = WA_LFA1-LIFNR.
       APPEND WA_VRM TO IT_VRM.
    CLEAR WA_VRM.
    ENDLOOP.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        id                    = 'LFA1-LIFNR'
        values                = IT_VRM
    EXCEPTIONS
      ID_ILLEGAL_NAME       = 1
      OTHERS                = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endmodule.                 " SELECT_LIST  OUTPUT
    Bye Murthy

  • Regarding dropdown box on selection screen

    Hi Abapers,
    I am facing a problem in handling dropdown box. please suggest . My Problem description below.
    There is one Text field and other is one dropdown box on the selection screen.
    Now When user enter the Prod Order number and press enter then automatically all the serial number will get appended into the dropdown box which are related to the Prod Order.
    Now suppose if the user only Press F8 not Enter Button then that case It doesn't contain the serial number information.
    <b>Now I want to handle it in selection screen.. Please suggest how to check the dropdown box if the dropdown box is not selected then Return to the selection screen..</b>
    Please suggest me...........Very urgent.

    Hello,
    *& 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.
    *& 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.
    Regards,
    Deepu.K

  • From ALV output list to selection screen

    Hi,
    I created one ALV report.
    After executing the program, it displays an ALV list.
    When I click on the back/exit/cancel buttons on the screen, it should take me to the selection screen.
    But that is not happening. it is taking to one screen which shows the report heading. IF i click back/cancel/exit buttons in this screen, it is taking me to the selection screen.
    I checked the program for any write statement, but therre are no write statements.
    Even i tried to remove the end-of-selection event in the program. but not working.
    Can any one help me on this how to overcome this issue.
    Thank you.
    Kumar

    hi check this example...
    REPORT zalv_sel_screen .TABLES: mara.DATA: BEGIN OF i_alv OCCURS 0,
          matnr TYPE mara-matnr,
          mtart TYPE mara-mtart,
          matkl TYPE mara-matkl,
          groes TYPE mara-groes,
          maktx TYPE makt-maktx,
          END OF i_alv.DATA: alv_container  TYPE REF TO cl_gui_docking_container.
    DATA: alv_grid       TYPE REF TO cl_gui_alv_grid.
    DATA: layout    TYPE lvc_s_layo.
    DATA: fieldcat  TYPE lvc_t_fcat.PARAMETERS: p_check.INITIALIZATION.  PERFORM get_data.AT SELECTION-SCREEN OUTPUT.  DATA: variant TYPE  disvariant.
      DATA: repid TYPE sy-repid.  repid = sy-repid.  variant-report = sy-repid.
      variant-username = sy-uname.  layout-zebra = 'X'.
      layout-edit_mode = 'X'.  CHECK alv_container IS INITIAL.  CREATE OBJECT alv_container
                  EXPORTING repid     = repid
                            dynnr     = sy-dynnr
                            side      = alv_container->dock_at_left
                            extension = 1500.  CREATE OBJECT alv_grid
             EXPORTING
                   i_parent          =  alv_container.*  ALV Specific. Data selection.
    Populate Field Catalog
      PERFORM get_fieldcatalog.  CALL METHOD alv_grid->set_table_for_first_display
        EXPORTING
          is_layout        = layout
          is_variant       = variant
          i_save           = 'U'
          i_structure_name = 'I_ALV'
        CHANGING
          it_outtab        = i_alv[]
          it_fieldcatalog  = fieldcat[].
    START-OF-SELECTION.
    FORM GET_DATA
    FORM get_data.  SELECT * INTO CORRESPONDING FIELDS OF TABLE i_alv
            FROM mara
              INNER JOIN makt
                ON maramatnr = maktmatnr
                       UP TO 100 ROWS
                   WHERE makt~spras = sy-langu.  SORT i_alv ASCENDING BY matnr.ENDFORM.                    "get_data***************************************************************
         Form  Get_Fieldcatalog - Set Up Columns/Headers
    FORM get_fieldcatalog.  DATA: ls_fcat TYPE lvc_s_fcat.
      REFRESH: fieldcat.  CLEAR: ls_fcat.
      ls_fcat-reptext    = 'Material Number'.
      ls_fcat-fieldname  = 'MATNR'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '18'.
      ls_fcat-fix_column = 'X'.
      ls_fcat-key        = 'X'.
      ls_fcat-col_pos    = '1'.
      APPEND ls_fcat TO fieldcat.  CLEAR: ls_fcat.
      ls_fcat-reptext    = 'Material Type'.
      ls_fcat-fieldname  = 'MTART'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '10'.
      ls_fcat-fix_column = 'X'.
      ls_fcat-key        = 'X'.
      ls_fcat-col_pos    = '2'.
      APPEND ls_fcat TO fieldcat.  CLEAR: ls_fcat.
      ls_fcat-reptext    = 'Material Group'.
      ls_fcat-fieldname  = 'MATKL'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '12'.
      ls_fcat-col_pos    = '3'.
      APPEND ls_fcat TO fieldcat.  CLEAR: ls_fcat.
      ls_fcat-reptext    = 'Size'.
      ls_fcat-fieldname  = 'GROES'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '30'.  ls_fcat-col_pos    = '4'.
      APPEND ls_fcat TO fieldcat.  CLEAR: ls_fcat.
      ls_fcat-reptext    = 'Material Description'.
      ls_fcat-fieldname  = 'MAKTX'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '40'.  ls_fcat-col_pos    = '5'.
      APPEND ls_fcat TO fieldcat.ENDFORM.                    "get_fieldcatalog
    regards,
    venkat

  • How to Print Selection-Screen along with ALV Report output

    Hi,
    I have a requirement wherein i need to also print the Selection Screen of a report when I print the ALV report output.
    Basically i need to print the ALV output along with selection screen.
    Could you plz suggest me the way.
    Regards,
    Nitin

    Hi,
    My selection Screen is a very big one. It contains around 30 select-options.
    So is their any standard method in which you can choose whether you want to take the output printout with or without Selection screen.
    Regards,
    Nitin

  • To fill selection screen parameter with user's parameter id

    Hi,
    I need to display PLANT on the selection screen of a report as SELECT-OPTIONS.
    When launching the transaction for the report, the program must fill the PLANT by default with the user's own parameter id (WRK) .
    How can it be done?
    Regards
    Nishant

    HI nishant,
    in INITIALIZATION EVENT.
    1. first get the parameter id value
       in some variable of type plant.
       (eg p1)
    2. then (suppose the select option name is myplant)
      MYPLANT-SIGN = 'I'.
      MYPLANT-OPTION = 'EQ'.
      MYPLANT-LOW =  p1 . "<---- from above variable in point 1
    APPEND MYPLANT.
    regards,
    amit m.

Maybe you are looking for