Restricting user to exclude values in selection screen

Hi Everybody,
I am facing a problem with f.m SELECT_OPTIONS_RESTRICT.
I want to restrict user, so that he will only be able to exclude values (single, multiple or range) from a selection-option.
The code snippet is as follows:
item messages -> restrict selection
  opt_list-name = 'EXCLUDE'.
  opt_list-options-ne = 'X'.
  opt_list-options-nb = 'X'.
  APPEND opt_list TO restrict-opt_list_tab.
  ***-kind = 'B'.
  ***-name = 'A2'.
  ***-sg_main = 'I'.
  ***-sg_addy = ' '.
***-op_main = 'EXCLUDE'.
  ***-op_addy = 'EXCLUDE'.
  APPEND *** TO restrict-***_tab.
  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
    EXPORTING
    PROGRAM                      =
      restriction                  = restrict
    DB                           = ' '
    EXCEPTIONS
     TOO_LATE                     = 1
     REPEATED                     = 2
     SELOPT_WITHOUT_OPTIONS       = 3
     SELOPT_WITHOUT_SIGNS         = 4
     INVALID_SIGN                 = 5
     EMPTY_OPTION_LIST            = 6
     INVALID_KIND                 = 7
     REPEATED_KIND_A              = 8
     OTHERS                       = 9
But this is only including the single multiple and range value. Can anyone throw some light on it?
Thanks
Samit

I took a look at the documentation of this FM to confirm what I was thinking:
"You can also disable the function allowing users to enter values to be excluded from the selection (SIGN = 'E')."
So I think this is trying to tell us that we can turn off the ability for the user to enter "exclude" but we cannot turn off the option for the user to enter "include" options.
When you set ***-sg_main = 'I', it means that only "include" options are allowed.
I think you will need to do your own validation.
In the event AT SELECTION SCREEN you can do a LOOP on your selection option name and validate the users selections:
LOOP AT SO_MINE.
  IF SO_MINE-SIGN NE 'E'.
    SET CURSOR FIELD 'SO_MINE-LOW'.
    MESSAGE E123.
  ENDIF.
ENDLOOP.
It has been awhile since I used this FM so please let us know how it goes.

Similar Messages

  • Check the user's entry from query selection screen

    Hi,
    Is there a way to check the user's entry at the selection screen? I created an exit variable and did some code to default a date to the selection screen. What if the user enters some other date, and I would want to check the value of this entry, where would I do this?
    Thanks,
    RT

    RT,
    This can easily be done. You can read the variable after the user has entered some different value.
    I_STEP = 2.
    Read table i_t_var_range with key vnam =<your variable name >
    Hope it helps.
    Thx,
    Soumya

  • Values in selection screen

    Iam trying to create the drop down list. Well, I got some programs, creating these lists for both parameter and ranges on the selection screen.
    What the user wants is when the selection screen is loaded, he wants to select from the list OR ENTER ANY DATA WHICH IS NOT THERE IN THE LIST. To be able enter any data other than what is there in the list is not working for me.

    Hi,
    It's impossible to use exclusions in some kind of variable type (eg. "Multiple single values").
    What kind of variable do you use ?
    Try the same with "Selection option". It should help.
    Regards, Leszek
    Message was edited by: Lesław Piwowarski

  • Populate values at selection screen

    Hi All,
    My requirement is:
    There are 2 radio buttons and 2 parameter fields.
    By default, one radio button is selected and the two fields are populated with some values at the selection screen.
    If the other radio button is selected, we need to pass different values to the two parameter fields.
    Can you please suggest me how to populate values at selection screen.
    I have tried populating them using AT SELECTION SCREEN OUTPUT, but didn't work.
    Any pointers are helpful.
    Thanks & Regards
    Gowthami

    Hi Gowthami,
        Try it this way:
    PARAMETERS:
      R1 RADIOBUTTON group rad USER-COMMAND ABC default 'X',
      R2 RADIOBUTTON group rad.
    Parameters:
      char1(10) type c,
      char2(10) type c.
    Initialization.
      char1 = 'radio1'.
      char2 = 'radio1'.
    At Selection-screen output.
      if r2 = 'X'.
    *    loop at screen.
          char1 = 'radio2'.
          char2 = 'radio2'.
    *      modify screen.
    *    endloop.
      elseif r1 = 'X'.
    *    loop at screen.
          char1 = 'radio1'.
          char2 = 'radio1'.
    *      modify screen.
    *    endloop.
      endif.
    With luck,
    Pritam.
    Edited by: Pritam Ghosh on Feb 24, 2009 11:54 AM

  • How to refresh value in selection screen field

    Hi Experts,
    I have a requirement to refresh the value in selection screen.while i run the report in selection screen i selecting one variant for look the output if i use some other field value with same variant without save its working fine i am avle to see the data but while i come back to again selection screen and selecting some other variant that extra add value is not getting refresh its showing with new variant.Its happening for only one variant not for all if i select some other variant then its getting refresh value in same field.Any one can help me for this issue.
    Thanks.

    Hi,
    That means, I believe - the value that is "not changing" is saved in the particular variant. You can easily verify it by starting the report without variant and then selecting the variant in question. Remove the value from screen and save the variant again. Don't forget to check of variant needs to be transported from development system...
    cheers
    Janis

  • How to pass a default value in selection screen of logical database pnpce

    Dear All,
    Can any one tell me how to pass a default value in selection screen of logical database pnpce .
    Regards
    Rakesh Singh

    Hi Rakesh,
    Go to SE36 (logical database Builder).First enter PNPCE in Logical Database and press documentation,here you will get the details of exactly what is PNPCE and how it works.After that select selections in subojects in se36 only and enter display ,there you have the include from where you acn get the idea.
    Regards,
    Rahul

  • Problem in getting parameter value from selection screen in web dynpro abap

    Hi,
    I am facing problem in getting parameter value from selection screen.
    Please find my code below:
    DATA LT_PAR_ITEM TYPE IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM.
    FIELD-SYMBOLS:<FS_PAR_ITEM> LIKE LINE OF LT_PAR_ITEM,
                                 <FS_OBJ_USAGE>    TYPE REF TO data.
      WD_THIS->M_HANDLER->GET_PARAMETER_FIELDS( IMPORTING ET_FIELDS = LT_PAR_ITEM ).
      LOOP AT LT_PAR_ITEM ASSIGNING <FS_PAR_ITEM>.
        CASE <FS_PAR_ITEM>-M_ID.
          WHEN `OBJ_USAGE`.
             ASSIGN <FS_PAR_ITEM>-M_VALUE->* TO <FS_OBJ_USAGE>.      
    [ Here, sy-subrc is 4,  <FS_OBJ_USAGE> is not assigning.]
        ENDCASE.
      ENDLOOP. 
    So, can any one solve this problem.
    Thanks in advance,
    Radhika

    Hi Radhika,
    Try using GET_RANGE_TABLE_OF_SEL_FIELD...
    Please Refer below code..
       DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA: RT_CARRID TYPE REF TO DATA.
      DATA: ISFLIGHT TYPE TABLE OF SFLIGHT.
      DATA: WSFLIGHT TYPE SFLIGHT.
      FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE.
    Retrieve the data from the select option
      RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
    Assign it to a field symbol
      ASSIGN RT_CARRID->* TO <FS_CARRID>.
      CLEAR ISFLIGHT. REFRESH ISFLIGHT.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE ISFLIGHT FROM SFLIGHT
                           WHERE CARRID IN <FS_CARRID>.
      NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( NAME = `FLIGHTS` ).
      NODE_FLIGHTS->BIND_ELEMENTS( ISFLIGHT ).
    Thanks,
    Regards,
    Kiran

  • Default value on Selection Screen

    Hi experts,
    I want to put sy-datum + 1 as a default value on selection screen.
    I tried this but it didnt work. Please help me.
    DATA : tarih like sy-datum.
    initialization.
    tarih = sy-datum  + 1.
    SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE TEXT-002.
    parameters : h_tarih like sy-datum obligatory default tarih.
    SELECTION-SCREEN END OF BLOCK 3.
    Thanks

    Hi,
    Do it in INITIALIZATION event.
    SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE TEXT-002.
    parameters : h_tarih like sy-datum obligatory default tarih.
    SELECTION-SCREEN END OF BLOCK 3.
    INITIALIZATION.
    h_tarih = sy-datum + 1.
    In this case no need to have one more extra variable. U can directly assign to ur parameter.
    In data declaration u can only default hard coded values. But not calculated values. This is because first selection screen will be triggered and later ur calculations. So at the time of selection screen is triggered ur variable dont have any value. Thats why it was not working. Change ur code to like above. It will work fine.
    Thanks,
    Vinod.
    Edited by: Vinod Reddy Vemuru on Jun 27, 2008 12:37 PM

  • User presses F4 on the selection screen for the field ''Transport Request"

    Dear ALL,
                     I want to build up a functionality in my report where if the user presses F4 on the selection screen for the field ''Transport Request", then it will display all the Transport Requests involving that particular User...
    What I mean is the normal process that is provided by SAP on saving an object in a package & assigning it to TR...
    How do we Achieve it ?

    Hi.
    First we need to give the client after that client number related requestes display in second parameter F4 help for that purpose i used two function modules.First for read the client no dynamically after that pass the client number second function module.
    then u can get all the request for that client.
    DFIELD-FIELDNAME = 'P_MANDT'.
    APPEND DFIELD.
    CALL FUNCTION 'DYNP_VALUES_READ'
      EXPORTING
        dyname                               = 'Y9EZ_TR_COPYCLIENT'
        dynumb                               = SY-DYNNR
      tables
        dynpfields                           = DFIELD
    READ TABLE DFIELD INDEX 1 ."WITH KEY DFIELD-FIELDVALUE = 'P_MANDT'.
    V_MANDT = DFIELD-FIELDVALUE.
    CALL FUNCTION 'TR_F4_REQUESTS'
    EXPORTING
      IV_USERNAME                   = SY-UNAME
      IV_TRKORR_PATTERN             =
      IV_TRFUNCTIONS                =
       IV_TRSTATUS                   = 'RNDL'
      IV_FROM_DATE                  =
      IV_TO_DATE                    =
       IV_CLIENT                     = V_MANDT
      IV_PROJECT                    =
      IV_TITLE                      =
      IV_VIA_SELECTION_SCREEN       = 'X'
      IV_COMPLETE_REQUESTS          = 'X'
      IT_EXCLUDE_REQUESTS           =
    IMPORTING
       EV_SELECTED_REQUEST           = S_TRKORR-LOW.
      ES_SELECTED_REQUEST           =
    'TR_F4_REQUESTS' This function module for request
    Regards
    muralii

  • How to put values from selection screen to  ztable

    hi all,
    i have created a ztable.
    now i want to put data through se38.
    i have given 5 parameters in selection screen same as there in ztable.
    now if i put values in selection screen then it should put that values to my ztable .
    how can i put values into my ztable.
    i used insert but not workiing.

    Hi,
    Try this.
    TABLES : ztable.
    SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    PARAMETER : p_field1 TYPE field1_in_ztable,
                            p_field2 TYPE field2_in_ztable.
                            p_field3 TYPE field3_in_ztable.
                            p_field4 TYPE field4_in_ztable.
                            p_field5 TYPE field5_in_ztable.
    SELECTION-SCREEN:END OF BLOCK b1.
    DATA : itab TYPE TABLE ztable,
                 wa_itab TYPE ztable.
    AT SELECTION-SCREEN.
          MOVE p_field1 TO wa_itab-field1.
          MOVE p_field2 TO wa_itab-field2.
          MOVE p_field3 TO wa_itab-field3.
          MOVE p_field4 TO wa_itab-field4.
          MOVE p_field5 TO wa_itab-field5.
    INSERT ztable FROM wa_itab.
    IF sy-subrc = 0.
    MESSAGE 'Successfully saved' TYPE 'I'.
    ENDIF.
    Thanks,
    Sri.
    Edited by: Sri on Jul 28, 2009 4:15 PM

  • Default value for selection screen field

    Hi all,
      I am using LDB PNPCE. I want to give default value for field Personnel area on selection screen.
    How can I do it?
    Thanks
    Rahul

    Hi Rahul,
    In the INITIALIZATION event we can set the default values for selection screen fields.
    INITIALIZATION.
    loop at screen.
    if screen-name = 'S_MATNR-LOW'.
    CLEAR S_MATNR.
    s_matnr-low = '1234'.
    s_matnr-option = 'EQ'.
    s_matnr-sign = 'I'.
    append s_matnr.
    CLEAR S_MATNR.
    s_matnr-high = '5678'.
    s_matnr-option = 'EQ'.
    s_matnr-sign = 'I'.
    append s_matnr
    clear s_matnr.
    endif.
    endloop.
    Hope it helps.
    Mark if useful
    Regards,
    Saumya

  • How to restrict user to get values only from F4 in selection screen

    Hi All,
       We have given a Search hlep for a parameter  in selection screen of a report,but now we are facing a issue, whlile executing the report user entering the data directly into  field instead of  selecting from F4 help.
      Do anyone  know how to restric the user from entering the data directly.
    i have searched the fourm ,but not get any good tread.
    Regards
    CB
    Moderator Message: Search harder, because there are many threads that have discussed the same issue before.
    Edited by: kishan P on Dec 27, 2010 4:00 PM

    You cna check my reply here To enter the value by selecting values from the F4 help only.

  • How to add default value to the Exclude single value in selection screen..

    Hi Experts,
    i have searched in sdn, but not able to get proper results,
    in my report i have a selection screen, in that there is a Select-option like status, for this status i need to exclude '02'
    for this i need to add the default value under exclude singale values option, not in lower and upper limit.
    can anyone help me...
    Regards,
    Sudha.
    Moderator message: please search for available information/documentation before asking, don't just claim you did.
    Edited by: Thomas Zloch on Oct 27, 2010 2:50 PM

    Hi,
    you can use the function module SELECT_OPTIONS_RESTRICT .
    This function module simplifies the handling of SELECT-OPTIONS on the selection screen by restricting possible selection options and signs.
    By calling this function module, you can restrict the number of selectio options available for the chosen selection field. You can also disable the function allowing users to enter values to be excluded from the selection (SIGN = 'E').
    Regards,
    S.Velsankar

  • BEx variable screen to exclude values from selection

    Hi,
    I have a requirement in the BEx report variable screen here my user want to select values for the variable and
    from the values in selection on right hand user wants to exclude few values.I want the red color exclude button to appear in the screen.can anyone tell me whether there are any commands in WAD for variable personalization.
    Thanks,
    Harsha

    Hi,
    Try this.
    TABLES : ztable.
    SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    PARAMETER : p_field1 TYPE field1_in_ztable,
                            p_field2 TYPE field2_in_ztable.
                            p_field3 TYPE field3_in_ztable.
                            p_field4 TYPE field4_in_ztable.
                            p_field5 TYPE field5_in_ztable.
    SELECTION-SCREEN:END OF BLOCK b1.
    DATA : itab TYPE TABLE ztable,
                 wa_itab TYPE ztable.
    AT SELECTION-SCREEN.
          MOVE p_field1 TO wa_itab-field1.
          MOVE p_field2 TO wa_itab-field2.
          MOVE p_field3 TO wa_itab-field3.
          MOVE p_field4 TO wa_itab-field4.
          MOVE p_field5 TO wa_itab-field5.
    INSERT ztable FROM wa_itab.
    IF sy-subrc = 0.
    MESSAGE 'Successfully saved' TYPE 'I'.
    ENDIF.
    Thanks,
    Sri.
    Edited by: Sri on Jul 28, 2009 4:15 PM

  • Excluding single values on selection screen

    Hi,
    I'm using standard PCH logical database on a selection screen. Im running the report for multiple org unit, lets say A,B and C.
    Within org unit A are more org unit e.g 1a, 1b, 1c and i want to exlude 1c. I added it to the negative single values of the multiple selection but its still coming out on the report.
    Any ideas? Listing out all the ones, e.g. 1a, 1b, 2a, 2b, 2c etc isnt really an option of there as hundred and hundreds of them
    Thanks.

    Hi,
    Use FM SELECT_OPTIONS_RESTRICT. Pl. check the sample code:
    *& Report  Z_TEST_JG
    REPORT  Z_TEST_JG.
    tables: vbak.
    TYPE-POOLS: sscr.
    DATA:
         v_restrict       TYPE sscr_restrict,
         v_opt_list       TYPE sscr_opt_list,
              v_asn            TYPE sscr_***.
    select-options: s_vbeln for vbak-vbeln no intervals.
    INITIALIZATION.
      PERFORM sub_restrict_option.
    FORM sub_restrict_option .
      CHECK v_restrict-opt_list_tab[] IS INITIAL.
      CLEAR v_opt_list.
      v_opt_list-name       = 'EQ'.
      v_opt_list-options-eq = 'X'.
      APPEND v_opt_list TO v_restrict-opt_list_tab.
      CLEAR v_asn.
      v_asn-kind            = 'S'.
      v_asn-name            = 'S_VBELN'.
      v_asn-sg_main         = 'I'.
      v_asn-sg_addy         = space.
      v_asn-op_main         = 'EQ'.
      v_asn-op_addy         = 'EQ'.
      APPEND v_asn TO v_restrict-***_tab.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
          restriction            = v_restrict
        EXCEPTIONS
          too_late               = 0
          repeated               = 0
          selopt_without_options = 0
          selopt_without_signs   = 0
          invalid_sign           = 0
          empty_option_list      = 0
          invalid_kind           = 0
          repeated_kind_a        = 0
          OTHERS                 = 0.
    ENDFORM.                    " sub_restrict_option

Maybe you are looking for

  • My video goes out and comes back on frequently

    Hi, I have a mac mini and the video goes out (blue screen) with an error that says "Check video cable."  It will then comb back on without doing anything but it can take several seconds or a minute to do so.  This happens randomly not dependent on do

  • Drag-and-drop to desktop brings up Finder window - DO NOT WANT

    For some reason, every time I drag-and-drop an image from my browser onto my desktop, it now brings up a Finder window. Is there any way to stop this? Thanks.

  • In windows vista control Panel won't open

    in windows vista control panel icloud is there but won't open. how do i fix this? also photo stream is not  working right.

  • Some WLST Goodies

    In this post we will use WLST to create a WebLogic domain (cluster, web server, resources, security and deployment). WLST is a scripting language, which can be used to create, monitor and manage domains. WLST is based on Jython and provides next to t

  • Reg: Message LOV

    Hi All, I have requirement, where i have a Message LOV and a shuttle in one page. Based on the Value selected in the LOV, shuttle has to get populated. So what am doing is, in "lovUpdate" event am redirecting to the same Page, which is going to satis