SELECT OPTIONS use in select statement

hi,
I have defined my selection screen in the main program.
selection-screen begin of screen 0101 as subscreen.
selection-screen begin of block b1.
select-options:  S_KUNNR for  KNA1-KUNNR,
selection-screen end of block b1.
selection-screen end of screen 0101.
then in an include in the same module pool, i try to use this in select statement
SELECT * INTO CORRESPONDING FIELDS OF XXX FROM ZPPP WHERE KUNNR IN S_KUNNR.
I get  an error saying " the IN operator with S_KUNNR is neither followed by an internal table nor by a valuelist "..what does this mean ?
thks

Check the sample code...
REPORT  ztest_mod.
DATA: kunnr TYPE kunnr.
* Custom Selection Screen 0200
SELECTION-SCREEN BEGIN OF SCREEN 0200 AS SUBSCREEN.
SELECT-OPTIONS: s_kunnr FOR  kunnr.
SELECTION-SCREEN END OF SCREEN 0200.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_kunnr-low.
  BREAK-POINT.
START-OF-SELECTION.
  "in this screen i have a button with function code 'SEARCH'
" and a subscreen area with name sub
  CALL SCREEN 100.
*&      Module  STATUS_0100  OUTPUT
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'STATUS'.
ENDMODULE.                    "status_0100 OUTPUT
*&      Module  USER_COMMAND_0100  INPUT
MODULE user_command_0100 INPUT.
  DATA: it_kunnr TYPE TABLE OF kna1.
  CASE sy-ucomm.
    WHEN 'SEARCH'.
      SELECT * FROM kna1
      INTO TABLE it_kunnr
      WHERE kunnr IN s_kunnr.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.                    "user_command_0100 INPUT
in the flow logic..
PROCESS BEFORE OUTPUT.
  MODULE status_0100.
  CALL SUBSCREEN sub INCLUDING sy-repid '0200'.
PROCESS AFTER INPUT.
  MODULE user_command_0100.
Regards
Vijay Babu Dudla

Similar Messages

  • Dynamic select-options using parameter

    Hi experts,
    It the user selects one value from dropdown list, it should generate one select-option using that name. Is it possible?
    for example, (pls see my code).
    If user selects 'Malek' from parameter, <b>and press 'ENTER'</b>
    <b>select-option should display with that name</b> like
    Malek      malek-low  malek-high
    And if user selects some other like 'Amran'. It should generate(and append)
    Malek      malek-low  malek-high
    amran      amran-low amran-high
    and so on....
    report c.
    data: t_return like ddshretval occurs 0 with header line.
    data: begin of t_names occurs 0,
           name like usr01-bname,
          end of t_names.
    parameters : i_inspec like usr01-bname.
    at selection-screen on value-request for i_inspec.
      perform get_names.
    form get_names.
      t_names-name = 'Malek'.
      append t_names.
      t_names-name = 'Amran'.
      append t_names.
      t_names-name = 'Ow CC'.
      append t_names.
      t_names-name = 'titbit'.
      append t_names.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
          retfield    = 'T_NAMES-NAME'
          dynpprog    = sy-cprog
          dynpnr      = sy-dynnr
          dynprofield = 'I_INSPEC'
          value_org   = 'S'
        tables
          value_tab   = t_names.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno with
        sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      read table t_return index   1.
    endform.                    "GET_NAMES
    Reward guaranteed,
    thanks
    kaki

    Use At selection-screen output,use screen internal table..
    User Dynamic Selection
    at selection-screen output.
      select single * from t000md.
      loop at screen.
        case screen-group1.
          when 'REL'.
            if not  p_old is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'BEL'.
            if not p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'ARB'.
            if  p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'MTA'.
            if  p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
        endcase.
      endloop.

  • Need to disable one of the select-options in dynamic selection screen

    Hi,
    we have copied the Standard program: RFDOPR00 into Z, my requirement is to disable one of the select-options in dynamic selection screen for ex: Reason code(User shouldnot able to enter anything in it).
    Can anyone please tell me the procedure to do it... I had tried using at selection-screen but it doesnt work as it in 'LOOP AT SCREEN', i am not able to capture the Parameter name(screen-name).
    Thanks,
    Ravi

    Hi,
    Get inside your selection screen, by executing your program.
    Now type /h in the field where you enter transaction code and press enter.
    Now again press enter, this will take you debugger starting from your Selection screen.
    You might be knowing this, still if you are not aware of this, this might be a valuable tip.
    From here , you can trace your Parameter name.

  • Adding default value for a select-options in a selection-screen

    hello gurus,
    i have a report program with the following select-options in a selection-screen block:
    select-options:  so_site  for MyTable-werks.
    i want the so_site to have a default value once the program displays. can it be possible?
    regards,
    sid

    Hi sid,
    1. Whenever we use select-option,
       an internal table of type range is
      automatically created.
    2. so, in fact, we have to put
       record in this internal table.
    3. eg. Just copy paste in new program.
    4.
    report abc.
    tables : t001.
    select-options : bukrs for t001-bukrs.
    initialization.
      bukrs-sign = 'I'.
      bukrs-option = 'EQ'.
      bukrs-low = '1000'.
      append bukrs.
    regards,
    amit m.

  • Default Current year in select option field on selection Screen

    Dear Experts,
    I want to set current year as default value in fiscal year select-options field on selection screen.
    for this, i hv written following code
    DATA:VAR_DATE TYPE SY-DATUM.
    DATA VAR(4) TYPE C.
    VAR_DATE = SY-DATUM.
    VAR = VAR_DATE+0(4).
    this retrieves current year .
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    SELECT-OPTIONS I11 FOR ANLC-GJAHR DEFAULT VAR TO VAR..                            "Fiscal Year
    SELECTION-SCREEN END OF BLOCK B1.
    Now when i am executing program pop-up is raised describing "Specify the range Limits". Please help.
    Regards,
    Apoorv Sharma

    >
    Ganga Bhavani R wrote:
    > Use below lines.
    >
    > SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    > SELECT-OPTIONS I11 FOR ANLC-GJAHR DEFAULT SY-DATUM+0(4). "Fiscal Year
    > SELECTION-SCREEN END OF BLOCK B1.
    Hi, Ganga,
    I think it will not working properly that way, Please test the bellow Sample Code.
    TABLES: anlc.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS i11 FOR anlc-gjahr .
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
      IF i11[] IS INITIAL.
        i11-low = sy-datum+0(4).
        APPEND i11.
      ENDIF.
    Thanks and Regards,
    Faisal

  • Say in selection screeen (ie is in select-options) i have selected record r

    say in selection screeen (ie is in select-options) i have selected record range from 1000 to 2000 but in the final display list i sholud not get 1200 to 1300 records it should be hide how is it posible
    Thanks
    Basu

    Hello Math,
    There are two ways of restricting the records with 1200 & 1300 values in output list display -
    1. Either restrict the records while selecting the data from database using SELECT query. This can be achieved by ranges table populated with the values, which won't select the 1200 & 1300 records.
    Find the following code for this -
    TABLES: TAB1.
    RANGES: R_FLD1 FOR TAB1-FLD1.
    R_FLD1-SIGN = 'I' .
    R_FLD1-OPTION = 'EQ'.
    R_FLD1-LOW = '1000'.
    R_FLD1-HIGH = '2000'.
    APPEND R_FLD1.
    R_FLD1-SIGN = 'I' .
    R_FLD1-OPTION = 'NE'.
    R_FLD1-LOW = '1200'.
    R_FLD1-HIGH = '1300'
    APPEND R_FLD1.
    SELECT * FROM TAB1
        INTO IT_TAB1
        WHERE FLD1 IN R_FLD1.
    2. Select the data first in internal table first and then delete the entries having 1200 & 1300 values.
    Find the following code for this -
    TABLES: TAB1.
    RANGES: R_FLD1 FOR TAB1-FLD1.
    SELECT * FROM TAB1
        INTO IT_TAB1
        WHERE FLD1 IN R_FLD1.
    IF SY-SUBRC EQ 0.
      SORT IT_TAB1 BY FLD1.
      DELETE IT_TAB1 WHERE ( FLD1 = '1200' ) OR  ( FLD1 = '1300' ).
    ENDIF.
    Hope this helps you.
    PS If the answer solves your query, plz close the thread by rewarding each reply and marking it Solved.
    Regards

  • Select Options use in ALV Report in ABAP Webdynpro

    Hello Experts,
    I Already Done ALV Report In webdynpro with use of view Container UI element.But i do not know ALV  report with help of select option.so
    Kindly Give Me simple Example of Use in select Option In ALV.
    Reply ASAP.
    Regards,
    Ameya Karadkhedkar

    First you need to add the component WDR_SELECT_OPTIONS to the tab "Used components" of your Web Dynpro component and then also in the properties tab of your view. In the layout you need to create another view container and embed the view WND_SELECTION_SCREEN of the new used component to it.
    Then in the WDDOINIT method of your view you can write this code (where SEL_OPT is the given name for the used component) in order to set the select option (This example is a select option for a date):
    DATA: lo_cmp_usage           TYPE REF TO if_wd_component_usage,
          lo_interfacecontroller TYPE REF TO iwci_wdr_select_options,
          lo_r_helper_class      TYPE REF TO if_wd_select_options,
          rt_range_date          TYPE REF TO data.
    * Instantiate used component WDR_SELECT_OPTIONS (SEL_OPT)
    lo_cmp_usage = wd_this->wd_cpuse_sel_opt( ).
    IF lo_cmp_usage->has_active_component( ) IS INITIAL.
      lo_cmp_usage->create_component( ).
    ENDIF.
    * Call method in used controller
    lo_interfacecontroller = wd_this->wd_cpifc_sel_opt( ).
    lo_r_helper_class = lo_interfacecontroller->init_selection_screen( ).
    * Create select option for the date
    CALL METHOD lo_r_helper_class->create_range_table
      EXPORTING
        i_typename    = 'DATS'
      RECEIVING
        rt_range_table = rt_range_date.
    CALL METHOD lo_r_helper_class->add_selection_field
      EXPORTING
        i_id          = 'DATS'
        it_result     = rt_range_date
        i_read_only   = ABAP_FALSE.
    * Hide unnecessary buttons
    CALL METHOD lo_r_helper_class->set_global_options
      EXPORTING
        i_display_btn_cancel  = abap_false
        i_display_btn_check   = abap_false
        i_display_btn_reset   = abap_false
        i_display_btn_execute = abap_false.
    Finally you need to write the following code in the action of the button in order to fetch the range table selected by the user.
    DATA: lo_cmp_usage            TYPE REF TO if_wd_component_usage,
          lo_interfacecontroller  TYPE REF TO iwci_wdr_select_options,
          lo_r_helper_class       TYPE REF TO if_wd_select_options,
          rt_date                 TYPE REF TO data.
    FIELD-SYMBOLS: <fs_date> TYPE table.
    * Instantiate used component WDR_SELECT_OPTIONS (SEL_OPT)
    lo_cmp_usage = wd_this->wd_cpuse_sel_opt( ).
    IF lo_cmp_usage->has_active_component( ) IS INITIAL.
      lo_cmp_usage->create_component( ).
    ENDIF.
    * Call method in used controller
    lo_interfacecontroller = wd_this->wd_cpifc_sel_opt( ).
    lo_r_helper_class = lo_interfacecontroller->init_selection_screen( ).
    * get selected range of inspections date
    CALL METHOD lo_r_helper_class->get_range_table_of_sel_field
      EXPORTING
        i_id          = 'DATS'
      RECEIVING
        rt_range_table = rt_date.
    ASSIGN rt_date->* TO <fs_date>.
    Then you can use the value that is assigned to the field symbol <fs_date> to continue with your ALV.

  • Select options using OVS empty

    Hi all,
    I have created a select options dynamically using OVS.
    If the output table is empty my OVS appears empty and i don't want that this appears.
    The search help must appear only when the output table is not empty.
    How do i solve this?
    Thanks

    Hi.
    My problem has not been repair.
    There is no way to disable an OVS at runtime.
    See:
    cancelling an OVS help?
    Thanks a lot.

  • How to combinate the select options using 'when........(.....or......)  '

    Dears,
    I used select statement like
    select rnn
             pucustctycode
        into table gt_zgrrnnh
             from zgrrnnh
             where rnn           in s_rnn
             and   lrcdate       gt gv_update
             and   deleteind     eq space.
    and
    select rnn
             pucustctycode
      appending table gt_zgrrnnh
             from zgrrnnh
             where rnn           in s_rnn
             and   lrcdate       eq gv_update
             and   lrctime       gt gv_uptime
             and   deleteind     eq space.
    in my program. and now i want to combinate them using just one select.
    and the different select conditions is lrdate and lrtime. and the firest selections has no limit to lrtime, but just limit to lrdate.
    Anyone could help me how to use    select ............when ..........(...........or............)?
    Thanks a lot.
    Julie.

    Change your select query like this:
    Select time also, u have to change your internal table Strucutre.
    SELECT   rnn
                   pucustctycode
                   lrctime
        INTO TABLE gt_zgrrnnh
        FROM zgrrnnh
             WHERE  rnn               IN   s_rnn
             AND      lrcdate         GE  gv_update
             AND      deleteind      EQ  space.
    from this you will all the data irrespective of time , but you have time field in your internal table .
    Now Loop at your internal table and delete those records whoes LRCTIME is less than GV_UPTIME.
    This is one way, i am sure there can be many ways to do this.
    One has to keep trying...
    Let me know ,if you face further issue..
    Regards,
    Mayank

  • I need to pass multiple select options using submit and reutrn

    dear all,
    my requirement is i need to pass multiple values for work center like(biw01,biw02,biw03    etc) for this iam giving as biwl* and biot* for the tcode zpp_hmm ,using this i am going to get total working hours of perticular equiment.
    for this iam using submit and return query but iam unable to pass multiple work centers as input.
    my code is
    DATA : z_budat TYPE  RANGE OF budat,
           wa_budat LIKE LINE OF z_budat.
    wa_budat-low = '20111001'.
    wa_budat-sign = 'I'.
    wa_budat-option = 'BT'.
    wa_budat-high = '20111031'.
    APPEND wa_budat TO z_budat.
    CLEAR wa_budat.
    *wa_budat-High = '20111031'.
    *wa_budat-sign = 'I'.
    *wa_budat-option = 'BT'.
    *append wa_budat to z_budat.
    DATA : z_arbpl TYPE  RANGE OF arbpl,
           wa_arbpl LIKE LINE OF z_arbpl.
    wa_arbpl-low = 'BIWL*'.
    wa_arbpl-sign = 'I'.
    wa_arbpl-option = 'EQ'.
    APPEND wa_arbpl TO z_arbpl.
    CLEAR wa_arbpl.
    wa_arbpl-high = 'BIOT'.
    *wa_arbpl-sign = 'I'.
    *wa_arbpl-option = 'BT'.
    *APPEND wa_arbpl TO z_arbpl.
    SUBMIT   zpp_rep_hemm_perf WITH s_bukrs = '1004'  WITH s_budat IN z_budat WITH      s_werks = 'SMJT'
                   with   S_ARBPL IN Z_ARBPL USING SELECTION-SCREEN '1000' AND RETURN.
    but my doubt is whether it is corect or wrong what ever i am passing inputs for arbpl.
    thanks in advance.

    You can pass all parameter (rsparams-kind = 'P') and select-options (rsparams-kind = 'S') as a single internal table of type RSPARAMS. Go on appending the field names and values as rows and pass using SELECTION-TABLE parameter of SUBMIT command.
    I gave appending one set of selection values for s_budat field but you can go on appending more values for s_budat and other fields.
    DATA: lt_rsparams TYPE TABLE OF rsparams,
          ls_rsparams TYPE rsparams.
    CLEAR ls_rsparams.
    ls_rsparams-selname  = 'S_BUDAT'.
    ls_rsparams-kind = 'S'.
    ls_rsparams-sign = 'I'.
    ls_rsparams-option = 'BT'.
    ls_rsparams-low =  '20111001'.
    ls_rsparams-high = '20111031'.
    APPEND ls_rsparams TO lt_rsparams.
    SUBMIT zpp_rep_hemm_perf WITH SELECTION-TABLE lt_rsparams
                      USING SELECTION-SCREEN '1000'
                      AND RETURN.

  • Create select-options using internal table

    Hello,
    I have number of table-fields in one internal table.
    I need to create select-options on screen for each of the table field in that internal table.
    Can anybody please provide a code for it ?
    Thanks.

    hi,
    you can create in this way :
    select-options: <name> for itab-<field name>.
    example code:
    TABLES: vbak.    " standard table
    TYPE-POOLS: slis.
    *-- Structure to hold data from table
    TYPES: BEGIN OF tp_itab1,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           werks LIKE vbap-werks,
           lgort LIKE vbap-lgort,
           END OF tp_itab1.
    *-- Data Declaration
    DATA: t_itab1 TYPE TABLE OF tp_itab1.
    DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
    *                    Selection  Screen                                 *
    *--Sales document-block
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
                                 s_posnr FOR vbap-posnr,
                                 s_werks FOR vbap-werks,
                                s_lgort  FOR vbap-lgort.*
    SELECTION-SCREEN END OF  BLOCK b1.
    hope it will help you
    regards
    Rahul sharma
    Edited by: RAHUL SHARMA on Sep 19, 2008 8:25 AM

  • Multiple select options validation at selection screen

    Hi,
    I have the requirement to create a selection screen with 3 select options. Two of them are cross-dependent. It is mandatory to fill one of them and it is not allowed to fill both. The third one is optional. I tried the validation at selection-screen on block... and I have a problem that search help buttons for select options react like execution buttons, when I press any of them I am getting one of errors instead of search help.
    Any help on this issue would be appreciated.
    Here is my code:
    DATA:
          so_rbkp TYPE rbkp,
          so_mseg TYPE mseg.
    SELECTION-SCREEN BEGIN OF BLOCK blok WITH FRAME.
      SELECT-OPTIONS:
            s_fakt   FOR so_rbkp-belnr,
            s_matdok FOR so_mseg-mblnr,
            s_god FOR so_mseg-gjahr.
    SELECTION-SCREEN END OF BLOCK blok.
    INITIALIZATION.
    SET TITLEBAR '0100'.
    START-OF-SELECTION.
      AT SELECTION-SCREEN on block blok.
          if s_fakt <> space and s_matdok <> space.
            MESSAGE 'Message1' TYPE 'E'.
          elseif s_fakt = space and s_matdok = space.
            MESSAGE 'Message2' TYPE 'E'.
          endif.
        ENDIF.

    Only perform the check when user wants to execute or submit the program, not when pressing F4 or even Enter, but in a selection-screen event, before START-OF-SELECTION which were program would terminate in error :
    TABLES: SSCRFIELDS.
    AT SELECTION-SCREEN OB BLOCK b01.
        IF sscrfields-ucomm EQ 'ONLI'
        OR sscrfields-ucomm EQ 'PRIN'
        OR sscrfields-ucomm EQ 'SJOB'.
          IF s_fakt[] IS NOT INITIAL AND s_matdok IS NOT INITIAL.
            MESSAGE 'Message1' TYPE 'E'.
          ELSEIF s_fakt[] IS INITIAL and s_matdok[] IS INITIAL.
            MESSAGE 'Message2' TYPE 'E'.
          ENDIF.
        ENDIF.
    (You could also always send the message, but using type 'E' for those function code and 'S' status for any other value.)
    Regards,
    Raymond

  • Text for block and select option on the selection screen of Logical Databas

    Hi,
    I have copied a standard program (RFBELJ10) which is making use of LDB (BRF) and created a custom program. Now, the requirement is to add a selection screen option to the custom report and do some validation on the data extracted. I have added the select option and provided a text (lets say "Segment") to it using menu path Goto --> Text Elements --> Selection Texts and activated. But this text is not displayed on the screen when i execute the report. It is showing the string which i used while defining the select option.
    Also i need to provide a frame and title to it. but its not displayed.
    i have written the following code for that:
    SELECTION-SCREEN: BEGIN OF BLOCK seg WITH FRAME TITLE text-h01. " Segment
    SELECT-OPTIONS: s_segmnt FOR faglflexa-segment. " Segment
    SELECTION-SCREEN: END OF BLOCK seg.
    Could you please help me in getting the texts displayed for fram and the select option?
    Thanks,
    Phani

    Solved the problem. I have maintained the text in German. So, when I execute the report in english, it is not displaying the text. I have translated the texts to English and is working fine now.

  • Greying out some selection options on a selection screen

    Hi,
    selection-screen: begin of block b0 with frame title text-000.
    select-options so_vnum for lfa1-lifnr.
    parameters: r1 radiobutton group rad1 default 'X',
                r2 radiobutton group rad1,
                r3 radiobutton group rad1.
    parameters: p_numdys type piqnumb.
    selection-screen end of block b0.
    In the above code, I want that if the p_numdys is entered then the radiobuttons r1, r2, n r3 to be greyed out how can I achieve that?
    Regards
    B

    Hi,
    if you want to gray out radio buttons after interactiing with selection screen then use following logic.
    selection-screen: begin of block b0 with frame title text-000.
    select-options so_vnum for lfa1-lifnr.
    parameters: r1 radiobutton group rad1 modif id ABC default 'X',
                r2 radiobutton group rad1  modif id ABC,
                r3 radiobutton group rad1  modif id ABC.
    parameters: p_numdys type char4.
    selection-screen end of block b0.
    AT SELECTION-SCREEN.
    AT SELECTION-SCREEN OUTPUT.
    IF P_NUMDYS IS NOT INITIAL.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'ABC'.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    Regards,
    Peranandam

  • Select options validation in selection screen

    Hi all,
    I have select options for plant in selection screen..I want to validate the Plants. and display the invalid plants in the selection screen itself....Since my report is for online purpose i am in need of this requirement...i dont want to print or display the invalid plants as output of the report..
    Is thaee any way to achieve this...please help.
    points will be rewareded  definetely if problem gets solved by your solution.
    Thanks in advance..

    Hi
    AT SELECTION-SCREEN ON S_WERKS.
    PERFORM F_CHECK_PLANT    USING TEXT-024.
    FORM F_CHECK_PLANT  USING    P_TEXT_004.
      IF S_WERKS IS NOT INITIAL.
        DATA: LV_WERKS TYPE WERKS_D.
        SELECT SINGLE WERKS
               INTO   LV_WERKS
               FROM   T001W
               WHERE  WERKS IN S_WERKS.
        IF SY-SUBRC <> 0.
          CLEAR S_WERKS.
          MESSAGE E000 WITH P_TEXT_004 "(Plant does not exist)
        ENDIF.
        CLEAR LV_WERKS.
      ENDIF.
    ENDFORM.                    " F_CHECK_PLANT
    Reward if useful
    Narendra

Maybe you are looking for