Check Select Options

Hi Genius,
Could you please tell me how to check the internal table entries using select options in a subroutine i.e  if the entry exists in  a range of select-options it is to be taken otherwise it is to be neglected.
I will definitely reward gd point to u but tell me in any case,
Thnx ,
Rahul.....................................................

Here is the simple example ->
tables : mara.
data : i_mara like mara occurs 0 with header line.
select-option s_matnr for mara-matnr.
start-of-selection.
select * from mara into table i_mara
                           where matnr <b>in s_matnr.</b>
if sy-subrc ne 0.
give error message " No data found ".
endif.
for internal table
loop at i_mara where field in s_matnr
endloop.
Thanks
Seshu
Message was edited by:
        Seshu Maramreddy
Message was edited by:
        Seshu Maramreddy

Similar Messages

  • CHECK SELECT-OPTIONS not allowed in ECC6.0

    HI,
    Obsolete Statement 4.7 version and Ecc 6.0 Version,
    CHECK SELECT-OPTIONS not allowed
    The construct SELECT-OPTIONS in the statement CHECK is not allowed in ABAP Objects.
    Error message in ABAP Objects if the following syntax is used:
    CHECK SELECT-OPTIONS.
    Correct syntax:
    CHECK f IN seltab.
    Reason:
    This form of the statement CHECK is intended only for use during the event GET during execution of type-1-programs with logical databases. The statement checks whether the content of the work area, which was filled by the logical database for the current GET event, meets the conditions in all the selection tables that are connected with the database table read. The name of the database table is taken statically from the next higher GET statement in the ABAP program. Thus the statement does not make sense outside of an GET event block. However, the previous event concept of the ABAP runtime environment, that is, the previous way of processing logical databases, is not supported by ABAP Objects.
    I want the simple example program for Correct syntax .Can any one send me with example program and pinpoint information of the statement.
    Regards,
    venkat
    Moderator message: please search for available information.
    Edited by: Thomas Zloch on Jan 8, 2011 10:32 AM

    Hey i have the same issue with this FM
    Did u find any solution to this..?
    plz help me ... urgent..!!

  • Alternative for "check select-options" for select query.

    hi all,
    my report is using a "GET" syntax, followed by "check select-options".
    My senior told me to replace the Get syntax with select query.
    Now, my program also has dynamic selection screen.
    the dynamic selection screen almost has all the fields of database table.
    so, what is the way to replace this check select-options while applying select query?
    can you tell me how dynamic selection screen fields are populated? are they stored in some internal table?
    thanks for help.

    HI
    Here is some points about LDB.
    Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is still to read data from database tables by linking them to executable ABAP programs.
    However, from Release 4.5A, it has also been possible to call logical databases using the function module LDB_PROCESS. This allows you to call several logical databases from any ABAP program, nested in any way. It is also possible to call a logical database more than once in a program, if it has been programmed to allow this. This is particularly useful for programs with type 1.
    Logical databases contain Open SQL statements that read data from the database. You do not therefore need to use SQL in your own programs. The logical database reads the program, stores them in the program if necessary, and then passes them line by line to the application program or the function module LDB_PROCESS using an interface work area
    For further on LDB's refer to this link.
    [http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm]
    Hope this will help.
    Reward if helpful.
    Sumit Agarwal

  • No "Check selected" option in Aperture???

    I know that , for import into Aperture, one can either chose to "check all", "uncheck all", or check individual images, and then hit "import checked"
    It is of course also possible, to select a number of images, and drag them into aperture, BUT, now there is an "import checked" option, Why can I not find a "check selected" option??
    Say that I have a card with 500 images, and I only want to import 300, in order to use the "import checked" option, I would have either: to check all 300 images individually, or "check all", and thereafter uncheck the 200 I do not want to import, also  - individually!!
    Is it just me who cannot find the command, or is there indeed no "Check selected" option in Aperture???

    Glad you found what you needed.
    The information is on this page in the User Manual, found by searching for "import checked"
    Importing from Your Digital Camera or Card Reader
    (Link)
    The text on that page:
    You can also Shift-click adjacent images and Command-click nonadjacent images, and then select the checkbox for one of the images. Selecting a single checkbox selects the checkboxes for all of the selected images.
    The User Manual is good.  It should be the first resource you consult.
    --KIrby

  • Check select-options in selection-screen

    I have two select-options in a selection-screen s_vbeln and p_ebeln with intervals & with extensions. Now i have to check whether values in  high or in low are valid or not? I have written the following code to check the validity of the values.
    AT SELECTION-SCREEN ON s_vbeln.
      IF SY-UCOMM EQ 'ONLI' .
        IF NOT s_vbeln[] IS INITIAL.
          LOOP AT s_vbeln.
            SELECT SINGLE VBELN
                        FROM VBAK
                        INTO gs_vbeln
                       WHERE VBELN EQ s_vbeln-LOW.
            IF SY-SUBRC <> 0.
              MESSAGE E398(00) WITH 'Invalid Sales Order Number!!'.
            ENDIF.
            SELECT SINGLE VBELN
                         FROM VBAK
                        INTO gs_vbeln
                       WHERE VBELN EQ s_vbeln-HIGH.
            IF SY-SUBRC <> 0.
              MESSAGE E398(00) WITH 'Invalid Sales Order Number!!'.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    The similar is with p_ebeln which is a field of ekko table.And vbeln is a field of vbak table. if gurus can post the code
    for the same.
    Regards,
    Priya

    Hi Shweta,
    select-options are represented as internal tables in the system. If the user extends the select-option and enters a couple of values, they should be checked all. So the code should be a little bit enhanced.
    To have the cursor positioned a the field with the error, you may use event
    AT SELECTION-SCREEN ON s_vbeln.
      PERFORM check_s_vbeln.
    *&      Form  CHECK_S_VBELN
    FORM check_s_vbeln .
      LOOP AT s_vbeln.
        IF s_vbeln-low IS NOT INITIAL.
          SELECT count(*) FROM vbak WHERE vbeln = s_vbeln-low.
            IF sy-subrc <> 0.
              MESSAGE e001(vb) WITH s_vbeln-low.
    *   Sales document & does not exist
            ENDIF.
          ENDIF.
          IF s_vbeln-high IS NOT INITIAL.
            SELECT count(*) FROM vbak WHERE vbeln = s_vbeln-high.
              IF sy-subrc <> 0.
                MESSAGE e001(vb) WITH s_vbeln-high.
    *   Sales document & does not exist
              ENDIF.
            ENDIF.
          ENDLOOP.
        ENDFORM.                    " CHECK_S_VBELN
    Kind regards,
    Clemens

  • Check select-options parametr value

    hi,
    i want to check if select-option parameter value is '002' then execute some code, how can i do that .
    thanks in advance,
    ramakrishna buddala.
    Moderator Message: Not enough search done. Thread locked.
    Edited by: Suhas Saha on Oct 20, 2011 3:15 PM

    Hi
    Perform the validation in AT Selection-screen on field event.If validation is not succes then give error message.
    AT selection-screen on <Fieldname>.
    if fieldname-low <> '002'.
       message '<Message Text>' type 'E'.
    endif.
    Regards.
    Raghu.

  • Check selection-options value

    I would like to check the selection criteria whether equal to some value or not. i use
    if s_bukrs in ('1234', '2222') it has error. Thanks!

    Hi
    Check the below code..
    It will be helpful...
    1. First Prepare Range Based on Selection Screen.
    2. Select Data Into Table..
    3. Then Validate..
    FORM validate_purchasing_group.
      DATA:  BEGIN  OF  l_t_ekgrp  OCCURS  0,
                ekgrp  LIKE  t024-ekgrp,
               END  OF  l_t_ekgrp.
      RANGES:  ra_ekgrp  FOR  t024-ekgrp.
      IF NOT so_ekgrp[] IS INITIAL.
        LOOP AT so_ekgrp.
          IF NOT so_ekgrp-low IS INITIAL.
            ra_ekgrp-sign  =  'I'.
            ra_ekgrp-option  =  'EQ'.
            ra_ekgrp-low  =  so_ekgrp-low.
            APPEND ra_ekgrp.
            CLEAR: ra_ekgrp.
          ENDIF.
          IF NOT so_ekgrp-high IS INITIAL.
            ra_ekgrp-sign  =  'I'.
            ra_ekgrp-option  =  'EQ'.
            ra_ekgrp-low  =  so_ekgrp-high.
            APPEND ra_ekgrp.
            CLEAR: ra_ekgrp.
          ENDIF.
        ENDLOOP.
        SELECT  ekgrp  INTO  TABLE  l_t_ekgrp
                              FROM  t024
                              WHERE  ekgrp  IN  ra_ekgrp.
        LOOP  AT  so_ekgrp.
          IF  so_ekgrp-low <>  space.
            READ TABLE  l_t_ekgrp  WITH  KEY  ekgrp  =  so_ekgrp-low.
            IF  sy-subrc  <>  0.
              SET CURSOR FIELD 'SO_EKGRP-LOW'.
              MESSAGE e755(me) WITH so_ekgrp-low.
            ENDIF.
          ENDIF.
          IF  so_ekgrp-high  <>  space.
            READ  TABLE  l_t_ekgrp  WITH  KEY  ekgrp  =  so_ekgrp-high.
            IF  sy-subrc  <>  0.
              SET CURSOR FIELD 'SO_EKGRP-HIGH'.
              MESSAGE e755(me) WITH so_ekgrp-high.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " validate_purchasing_group
    Hope this helps.
    Praveen

  • Checking against Select-Options with "CP" using "IF value IN select_option"

    Dear experts,
    first of all: I'm sorry, if this question already should have been asked and answered!
    I tried quite a lot of search terms but didn't find anything helpful.
    We are using a statement like "IF value IN select_option" to perform comparisons after the Select-Options have been used in a SELECT statement. This logical expression fails (compared to the results of the DB-SELECT) whenever a select-option line contains the option CP (Contains Pattern). To be more specific: The case sensitivity of the LOW value doesn't seem to play a role any more. A variable with the value 'ABCD' would be positively checked against a select-option with OPTION 'CP' and LOW 'abc*', whereas this value wouldn't have been selected if the select-option had been used in a DB-SELECT.
    Does anybody know a workaround?
    Thanks in advance
    Andreas

    Dear Keshav,
    it's an own field in an own table, defined as CHAR of length 140 (lowercase allowed), reflecting to a line of remittance info of an account statement. A regular Select-Option for this field is provided in a report which works perfectly fine regarding the case sensitivity. For reasons I don't want to point out in detail we need to check a value in this field against the select-option without selecting it from the db again.
    Let's assume that a field remittance_info contains the value 'ABCD'.
    A line of the select-option table looks like this:
    select_option_table-SIGN = 'I'
    select_option_table-OPTION = 'CP'
    select_option_table-LOW = 'abc*'.
    Then an ABAP statement such as
    IF remittance_info IN select_option_table.
    * would be true !!!
    ENDIF.
    but wouldn't deliver a result in a SELECT such as
    SELECT * FROM my_table INTO TABLE my_internal_table WHERE remittance_info IN select_option_table.
    because of the differences in lower/upper case.
    regards
    Andreas

  • MANDATORY CHECK FOR SELECT OPTION.

    Hi gurus,
    How to do a mandatory check on select options..
    how do wegive messages in webdynpro..as in information, error as we do it in report programming..!
    Best Regards,
    Navin fernandes.
    Edited by: NAVIN FERNANDES on Dec 30, 2009 3:18 PM

    Hi,
    To make a selection field mandatory:
    wd_this->m_handle->add_selection_field(
                            i_description = 'Candidate Profit Center'
                            i_id = '/MRSS/T_RMOR_PROF_CENTER'
                             i_value_help_type = if_wd_value_help_handler=>co_prefix_searchhelp
                            i_value_help_id = '/MRSS/SH_RM_PC_GROUP'
                            it_result = lt_range_table
                           *I_OBLIGATORY = ABAP_TRUE*
                            i_read_only = read_only ).
    MAKE THE PARAMETER ABAP_TRUE  TO MAKE IT MANDATORY.
    OR PUT THE PARAMETER AS ABAP_FALSE.
    Priya
    Edited by: Chaitanya Priya Puvvada on Dec 30, 2009 6:34 PM

  • Selection screen: no sequence check for select option

    Hello everyone,
    I am an SAP starter and this will is my first question:
    I am making a program that approves a stock demand over several levels. When a level approves, the demand goes to the next level.
    for example:
    level 1 = planning
    level 2 = management
    level 3 = buyer
    In an overview report i want to choose for which levels i want to see stock demands. But when I make a select option for the level, I cannot choose the range between management and buyer or planning and buyer for example, because it is alphabetically not in the right order. In this case the alfabet is not important but the order of the levels is, so can I prevent this check from happening?
    Thank you very much

    Hi vandersteen,
    1. There should be some CODE
       for each level.
    2. Each code will have some description.
      eg. planning, management, buyer
    3. So, make select-option
       for the FIELD of CODE
       (and not the description)
    regards,
    amit m.

  • FM to check values in select option

    Hi Experts ,
    I want to compare values entered in select option with certain constant values. Is there any FM which will do this?
    Thanks & Regards ,
    Jigar Thakkar

    I believe that there is no such FM. You need to build a range for your constant values and then compare your select option with the range build for constants.
    Eg.
    select-options: s_werks for t001w-werks.
    ranges r_werks for t001-werks.
    r_werks-sign = 'I'.
    r_werks-option = 'EQ'.
    r_werks-low = '2101'.   "Pass the constant value.
    append r_werks.         "Range built for one entry 2101. Similarly append further constant values.
    *Check if select option contains any of the constant values.
    if s_werks in r_werks.
    * Select-options contains value as defined in range
    else.
    * No matching value found.
    endif.

  • Check syntax of select option structure

    I've got a custom transparent table which contains a select option:
    field = SIGN (data element = ddsign)
    field = OPTION (data element = ddoption)
    field = ROLE_FROM (data element = agr_name)
    field = ROLE_TO (data element = agr_name)
    This custom transparent table is populated via a custom dialog program where the user enters all four of these data fields.  Does SAP provide some type of function module which can check the syntax of a select option structure before the table is updated?  For example, it would flag the following as OK:
    SIGN = I
    OPTION = CP
    ROLE_FROM = 001*
    ROLE_TO = <blank>
    But it would flag the following as not OK (either OPTION needs to be CP or ROLE_FROM doesn't need to have a wildcard):
    SIGN = I
    OPTION = EQ
    ROLE_FROM = 001*
    ROLE_TO = <blank>
    Thanks,
    Brad

    Brad
    I don't know abuot available function modues.
    Another option is to use a SAP function to create the dialog screen to get the values:
    Function FREE_SELECTIONS_DIALOG returns a RANGE table.
    Using the fields_tab table you csn define which fields are shown.
    FORM get_selection_condition .
      DATA:
        w_selid         TYPE rsdynsel-selid,
        lt_tables       TYPE TABLE OF rsdstabs,
        ls_tables       TYPE rsdstabs,
        lt_fields       TYPE TABLE OF rsdsfields,
        lt_where        TYPE rsds_twhere,
        ls_where        TYPE rsds_where.
      ls_tables-prim_tab = p_tab.
      APPEND ls_tables TO lt_tables.
      CALL FUNCTION 'FREE_SELECTIONS_INIT'
    *    EXPORTING
    *      expressions  = lt_expr
        IMPORTING
          selection_id = w_selid
    *      expressions  = lt_expr
        TABLES
          tables_tab   = lt_tables
        EXCEPTIONS
          OTHERS       = 20.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
    * Display free selection diaerrorlog
      CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
        EXPORTING
          selection_id            = w_selid
          title                   = 'Selection'
          status                  = 1
          as_window               = 'X'
          tree_visible            = 'X'
        IMPORTING
    *      expressions             = lt_expr
    *      field_ranges            = lt_ranges
    *      number_of_active_fields = w_active
          where_clauses           = lt_where
        TABLES
          fields_tab              = lt_fields
        EXCEPTIONS
          OTHERS                  = 1.
      IF sy-subrc IS NOT INITIAL.
    *    p_cancel = c_true.
        EXIT.
      ENDIF.
    * Get the where conditions for the master data table.
      READ TABLE lt_where INTO ls_where
        WITH KEY tablename = p_tab.
      APPEND LINES OF ls_where-where_tab TO selopt_tab.
    ENDFORM.                    " get_selection_condition

  • Check value in select-options

    Hello,
    how can i check, if a certain value is in a select-option range,
    f.e. check if value '1000' is in s_matnr (s_matnr for mara-matnr)
    Thanks,
    TomSd

    Hi Thomas Strehle ,
    Do the checking in AT SELECTION SCREEN.
    S_MATNR will have two fields LOW and HIGH.
    HIGH value wont accept if the low value is empty.
    So Check with the low value.
    select single * from mara where matnr in s_matnr
    this will take the range if both the low and high value is given
    else if only low is given "=" is taken
    else if no value is given it will fetch all the values
    Or
    select single * from mara where matnr = s_matnr-low
    this will fetch only if the value in low is present.
    for all other option it wont fetch.
    choose any according to your requirement.
    validation has to be done in  AT SELECTION SCREEN.
    if you do it in other events and had to display a error message.
    It wont allow the user to correct the entry and rerun the program.

  • Validation Check in Select Options

    Hi All,
         I have a select-options variable. I want to write a check that the user doesnot enter any values other than 04,03 and 07. Can i write this validation check because the select options table can have many values in the option field and two values in the sign field.
    Thanks & Regards,
    Rahul Rathi

    i,
        use below logic
         select-options s_matnr for mara-matnr no intervals.
       at selection-screen.
      ranges r_matnr for mara-matnr.
      R_matnr-LOW = '04'.
      r_matnr-sign = 'I'.
      r_metnr-option = 'EQ'.
      append r_matnr.
      R_matnr-LOW = '03'.
      append r_matnr.
      R_matnr-LOW = '07'.
      append r_matnr.
    clear r_matnr.
    select single matnr from mara into mara-matnr
         where matnr in r_matnr.
    if sy-subrc <> 0.
    message e00 'enter values in range '03,04,07'
    endif.
    or
    you can default this value
    at selection-screen output.
      ranges r_matnr for mara-matnr.
      R_matnr-LOW = '04'.
      r_matnr-sign = 'I'.
      r_metnr-option = 'EQ'.
      append r_matnr.
      R_matnr-LOW = '03'.
      append r_matnr.
      R_matnr-LOW = '07'.
      append r_matnr.
    clear r_matnr.
    s_matnr[] = r_matnr[].
    Regards,
    amole

  • Removing the Cancel,copy,reset, check buttons of select option screen.

    Hi All,
    Please help me in removing the Cancel,copy,reset, check  buttons from the select options screen of the WD4A.
    Thanks & Regards,
    Selvakumar M,.

    Use the following code in the WDDOINIT method after using add_selection_field method
    data:
        display_btn_cancel  type abap_bool,
        display_btn_check   type abap_bool,
        display_btn_reset   type abap_bool,
        display_btn_execute type abap_bool.
    wd_this->G_HANDLER->set_global_options(       "G_HANDLER is the attribute of IF_WD_SELECT_OPTIONS
        i_display_btn_cancel  = display_btn_cancel
        i_display_btn_check   = display_btn_check
        i_display_btn_reset   = display_btn_reset
        i_display_btn_execute = display_btn_execute ).

Maybe you are looking for