Define ranges in selection screen

hi all
does anybody know how to declare ranges on selection screen
i have to declare it for matnr
thanks for your help

Moderator message - Please do not ask or answer basic questions - thread locked
This is your third warning. There won't be a fourth.
Rob
Edited by: Rob Burbank on Sep 22, 2010 10:04 AM

Similar Messages

  • Define Ranges on Selection screen

    Hi All,
    I have a requirement to define company code as ranges on the selection screen, and then I have loop thru those company codes to get the plants. Any idea how I can define ranges and then use it in the program?
    Sample code will be really helpful.
    Thanks,
    David.

    Hi,
    selection-screen begin of block 1 with frame title text-100.
    select-options : s_ccode for t001-bukrs.
    selection-screen end of block 1.
    aRs

  • Ranges in Selection Screens

    Hi
    Can any body give the info regarding ranges in selection screens instead of selection-options.
    I want to use multiple selections
    Thanks & Regrads
    venkat

    Hi,
    Here both SELECT-OPTIONS & RANGES works for the same purpose.  They both are used for the range selection from selection screen.  The main diff. between them is, while we use SELECT-OPTIONS system implicitly creates the select options internal table which contains the fields of SIGN,OPTION,LOW & HIGH.  But in case of RANGES, this internal table should be defined explicitly.
    Eg. to SELECT-OPTIONS :
    REPORT YARSELECT.
    TABLES YTXLFA1.
    SELECT-OPTIONS : VENDOR FOR YTXLFA1-LIFNR.
    INITIALIZATION.
    VENDOR-LOW    =   1000.               " It specifies the range starting value.
    VENDOR-HIGH    =   2000.               " It specifies the range ending value.
    VENDOR-OPTION  =  'BT'.                " specifies ranges value is in between.
    VENDOR-SIGN      = 'I'.                     "specifies both inclussive.
    APPEND VENDOR.
    SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB 
    WHERE LIFNR IN VENDOR.
    Eg. to RANGES:
    REPORT YARRANGE.
    TABLES YTXLFA1.
    RANGES: VENDOR FOR YTXFLA1-LIFNR.
    SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB 
    WHERE LIFNR IN VENDOR.
    Here with RANGES  user has to design an internal table with fields - 
    SIGN,OPTION,LOW and HIGH EXPLICITLY.
    >
    Example:
    select-options: bukrs for zstock-bukrs.
    Should the user fill in 'ABFI' in BUKRS on the selection screen, BUKRS will look like this:
    IEQABFI
    This is because BUKRS is set as a table as follows:
    begin of bukrs occurs 0,
      SIGN(1)    type c,
      OPTION(2) type c,
      LOW         like bukrs,
      HIGH         like bukrs,
    end of bukrs.
    Now, when you create the following range, it will have the exact same fields set inside its table:
    Ranges: bukrs for zstock-bukrs.
    The difference is, because ranges doesn't show on the selection screen, you will have to fill it yourself, meaning you will have to fill bukrs-sign, bukrs-option, bukrs-low & bukrs-high all manually.
    Some tips:
    Sign is always I (for Include) or E (for Exclude)
    Option can be a whole range, which includes:
    EQ        (Equal) 
    BT        (Between)) 
    CP        (Contain Pattern)
    So let's say you want to have the range check for all company codes not starting with AB, you will set your code as follow:
    ranges: bukrs for zstock-bukrs.
    bukrs-sign = 'E'.             "Exclude
    bukrs-option = 'CP'.        "Pattern
    bukrs-low = 'AB*'.            "Low Value
    bukrs-high = ''.                "High Value
    append bukrs.
    Always remember to APPEND your range when you fill it, as the WHERE clause checks against the lines of the range table, not against the header line.
    Hope this explains it well enough.
    >
    What does SIGN "I" & "E" mean?
    The "I" stands for Include, and the "E" for Exclude.
    The easiest way to learn how the range selections work is, create the following dummy program:
    report dummy.
    tables: mara.
    select-options: matnr for mara-matnr.
    start-of-selection.
    loop at matnr.
    write: / matnr-sign,
               matnr-option,
               matnr-low,
               matnr-high.
    endloop.
    Run this program, and fill in a lot of junk into MATNR. Fill in some includes, some excludes, some ranges, etc., and you will soon realise how the system builds ranges (select-options). Once you know that, you can fill your own ranges quickly and efficiently.
    Regards,
    Sruthi

  • How to define our own selection screen for logical database  in abap-hr?

    Hi Friends,
    Can u please help me
    How to define your own selection screens for  logical database.
    we use to do like(goto->attributes-HRReportcatagerious ).but How to desin using  customer table like t599c, t599f and how to add to my logical database?
    Thanks in advance
    charan

    check out this online help
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/dba65c35c111d1829f0000e829fbfe/frameset.htm
    Regards
    Raja

  • FREE_SELECTIONS_INIT defining blocks on selection-screen.

    Hi,
    is it possible to define blocks on selection-screen if I use the function FREE_SELECTIONS_INIT.
    And is it possible to define the select-option obligatory.
    Best regards,
    Marcus

    hi
      Yes you can make select-options as obligatory by using
    SELECT-OPTIONS:
       s_abs for <some thing> OBLIGATORY
    and coming to the FM
    the function module receives information about
    the set of fields for which dynamic selections should be possible, and
    returns a selction ID
    i Think it is not possible
    regards
    Pavan

  • Can I define a vertical SELECTION-SCREEN block ?

    Hi, I started getting to know the SELECTION-SCREEN statements now, I was wondering if there's a way to define a vertical screen block instead of an horizontal one.
    Also, can I set the size of a given block ? Let's say I don't want it to extend to the right margin of the screen. Can I limit it to the middle, for instance ?
    Here's a code excerpt so you can understand a little what I'm intending to do (I want to place the operators vertically on the screen).
    SELECTION-SCREEN BEGIN OF BLOCK BOX1 WITH FRAME TITLE S_TBOX1.
      SELECTION-SCREEN BEGIN OF LINE.
        SELECTION-SCREEN COMMENT 20(10) S_COMM.
      SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN BEGIN OF BLOCK BOX2 WITH FRAME TITLE S_TBOX2.
        SELECTION-SCREEN BEGIN OF LINE.
          SELECTION-SCREEN PUSHBUTTON (3) S_PB1 USER-COMMAND 'XXX'.
          SELECTION-SCREEN PUSHBUTTON (3) S_PB2 USER-COMMAND 'XXX'.
          SELECTION-SCREEN PUSHBUTTON (3) S_PB3 USER-COMMAND 'XXX'.
          SELECTION-SCREEN PUSHBUTTON (3) S_PB4 USER-COMMAND 'XXX'.
        SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN END OF BLOCK BOX2.
      SELECTION-SCREEN BEGIN OF LINE.
        SELECTION-SCREEN PUSHBUTTON (3) S_PB5 USER-COMMAND 'XXX'.
      SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK BOX1.
    INITIALIZATION.
      S_COMM = 'CALCULATOR'.

    Ok, I thought of that but... now I need the answer for the 2nd question I posted: is it possible to limit the extension of the block, so it ends right after the 4 buttons column ?
    SELECTION-SCREEN BEGIN OF BLOCK BOX1 WITH FRAME TITLE S_TBOX1.
      SELECTION-SCREEN BEGIN OF LINE.
        SELECTION-SCREEN COMMENT 20(10) S_COMM.
      SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN BEGIN OF BLOCK BOX2 WITH FRAME TITLE S_TBOX2.
        SELECTION-SCREEN BEGIN OF LINE.
          SELECTION-SCREEN PUSHBUTTON (3) S_PB1 USER-COMMAND 'XXX'.
        SELECTION-SCREEN END OF LINE.
        SELECTION-SCREEN SKIP.
        SELECTION-SCREEN BEGIN OF LINE. 
          SELECTION-SCREEN PUSHBUTTON (3) S_PB2 USER-COMMAND 'XXX'.
        SELECTION-SCREEN END OF LINE. 
        SELECTION-SCREEN SKIP.
        SELECTION-SCREEN BEGIN OF LINE. 
          SELECTION-SCREEN PUSHBUTTON (3) S_PB3 USER-COMMAND 'XXX'.
        SELECTION-SCREEN END OF LINE. 
        SELECTION-SCREEN SKIP.
        SELECTION-SCREEN BEGIN OF LINE.
          SELECTION-SCREEN PUSHBUTTON (3) S_PB4 USER-COMMAND 'XXX'.
        SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN END OF BLOCK BOX2.
      SELECTION-SCREEN BEGIN OF LINE.
        SELECTION-SCREEN PUSHBUTTON (3) S_PB5 USER-COMMAND 'XXX'.
      SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK BOX1.
    INITIALIZATION.
      S_COMM = 'CALCULATOR'.

  • Validation for the select option value range of selection screen

    Hi All.
    if i wish to validate the selection screen parameter for a value range(select options),is it possible?
    what should i write in code.Also,m using FM DD_DOMVALUES_GET to get the values for a specific domain name.
    Please reply.

    Hiii,
         Yes it is possible.... Can you give me the piece of code ... about the select option
    and also the value range against which you want to validate the select option.
    So that i can help you with the coding tips...
    Thanks in advance..

  • Setting default date range in selection screen when executing as batch job.

    Hi Guys,
    I have one report to be scheduled as weekly batch job and one of the selection screen field is date range. If i set this report to run today then the date range will be from one week back date(Lower value) to today date(Higher value). When it runs for next week(Already scheduled as weekly batch job) the date range should be like this
    Lower value = today date
    higher value= next week run date.
    How can i achieve this functionality. Is it possible through Dynamic variant concept?. Rest of the selection screen fields have some default values and should not change.
    <REMOVED BY MODERATOR>
    Thanks in advance,
    Vinod.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 3:52 PM

    Hi Vinod,
    Would suggest you to this.
    Create two parameters : p_start_date and p_end_date of type sy-datum on your selection screen , instead of a range.
    Now goto create a variant from SE38 for the report.
    While creating the variant, mark the "Selection Variable" checkbox for the two parameters and click on "Selection Variables".
    Select the option "D: Dynamic date calculation" for both the date fields.
    For p_start_date - select the option "Current Date"
    For p_end_date  - select the option "Current date +/- ??? days" and put 7 in the pop up.
    Hence what you have done now is, set up a dynamic variant, where p_start_date will have sy-datum and p_end_date will have sy-datum + 7, everytime the job runs.
    Now, in the program, first step after START-OF-SELECTION code the following:
    RANGES: r_date FOR sy-datum.
    start-of-selection.
    refresh r_date.
    r_date-sign = 'I'. r_date-option = 'BT'.
    r_date-low = p_start_date. r_date-high = p_end_date.
    append r_date.
    Hence this way, you would have built your range and use it as needed.
    Cheers,
    Aditya

  • How to add ranges of selection screen

    hi experts.
    I have selection screen :
    eg. SELECT-OPTIONS :SPLGL FOR BSID-UMSKZ,
    ie. Special GL indicators. now if person enters A to Z in this  and 9 in single range on screen.
    I want to store A,B,C...Z  and 9 in an internal table. , what would be the  the easiest way for doing it ?
    Thanks in advance.
    PD

    Hello
    Try this code:
    select-options: splgl for bsid-umskz.
    data: abcde like sy-abcde,
    beg type i,
    end type i,
    div type i,
    counter type i.
    data: begin of itab occurs 0,
          splgl like bsid-umskz,
          end of itab.
    abcde = sy-abcde.
    loop at splgl.
      case splgl-option.
        when 'BT'.
          search abcde for splgl-low.
          if sy-subrc = 0.
            beg = sy-fdpos.
          endif.
          search abcde for splgl-high.
          if sy-subrc = 0.
            end = sy-fdpos.
          endif.
          div = end - beg + 1.
          counter = beg.
          do div times.
            itab-splgl = abcde+counter(1).
            append itab.
            counter = counter + 1.
          enddo.
        when 'EQ'.
          itab-splgl = splgl-low.
          append itab.
      endcase.
    endloop.
    In itab you will have all values from selection screen.

  • Date Range on Selection Screen not working

    Hi All,
    I have a selection screen with 3 selection options on there to run a report.
    1) Today
    2) Yesterday
    3) This week
    Now the first two are working fine but number 3 This Week isn't.  Any reason why? This week basically means Monday to Friday of this week. E.g. If I have This week Clicked on Monday it would just show Mondays result, if I run this report on Wednesday with This week clicked it should show Monday, Tuesday & Wednesday.
    Regards
    Adeel
    FORM posting_date .
      CLEAR : rg_finl.
      IF rb_1 = 'X'.
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'EQ'.
        rg_finl-low       = sy-datum.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_2 = 'X'.
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'EQ'.
        rg_finl-low       = sy-datum - 1.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_3 = 'X'.   
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'BT'.
        rg_finl-low       = sy-datum.
        rg_finl-high      = sy-datum - 7.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_4 = 'X'.
        rg_finl[] = s_budat[].
      ENDIF.
    ENDFORM.

    Hello
    You a wrong:
    Instead
    rg_finl-low = sy-datum.
    rg_finl-high = sy-datum - 7.
    you need:
    rg_finl-low = sy-datum - 7.
    rg_finl-high = sy-datum.

  • Error message for ranges in selection screen

    Hi
    i have this select option statement
    SELECT-OPTIONS: s_fevor FOR afko-fevor.
    i have written this code for error message display...
    AT SELECTION-SCREEN ON S_FEVOR.
    I_FEVOR-SIGN = 'I'.
    I_FEVOR-OPTION = 'EQ'.
    I_FEVOR-LOW = S_FEVOR.
    I_FEVOR-HIGH = S_FEVOR.
    IF not I_FEVOR-LOW EQ s_FEVOR .
    SELECT  FEVOR
         FROM AFKO
           INTO S_FEVOR
             WHERE FEVOR = S_FEVOR.
                UP TO 1 ROWS.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    MESSAGE E000.
    ENDIF.
    ENDIF.
    if i enter the correct data then also it is giving error message
    how to solve this?
    Regards
    Smitha

    Hi,
    Refer this code:-
    SELECT-OPTIONS: s_fevor FOR afko-fevor.
    DATA : BEGIN OF t_fevor OCCURS 0,
             fevor TYPE afko-fevor,
           END OF t_fevor.
    AT SELECTION-SCREEN FOR s_fevor.
      s_fevor-sign = 'I'.
      s_fevor-option = 'EQ'.
      s_fevor-low = S_FEVOR.
      s_fevor-high = S_FEVOR.
      APPEND s_fevor.
      CLEAR s_fevor.
      IF NOT s_fevor-low IN s_fevor.
        SELECT fevor
              FROM afko
              INTO TABLE t_fevor
              WHERE fevor IN s_fevor.
        IF sy-subrc NE 0.
          MESSAGE e000.
        ENDIF.
      ENDIF
    Hope this helps you.
    Regards,
    Tarun

  • Define path in selection screen to write the output file to pres.  server

    Hi can anyone tell me how to declare a variable so that the user can specify his own path name in the selection screen to store the output file in the presentation server. and please tell me how to link up the output file to the selection screen specified path.
    thanks in advance.

    DATA: FILE_TAB TYPE STRING.
    SELECTION-SCREEN BEGIN OF BLOCK B02 WITH FRAME TITLE TEXT-B02.
    PARAMETERS:
               P_FILE TYPE RLGRAP-FILENAME OBLIGATORY LOWER CASE.
    SELECTION-SCREEN END OF BLOCK B02.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      PERFORM OPEN_FILE USING P_FILE.
    FORM OPEN_FILE USING L_FILE.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          FILE_NAME     = L_FILE
        EXCEPTIONS
          MASK_TOO_LONG = 1
          OTHERS        = 2.
      IF SY-SUBRC <> 0.
        SY-MSGTY = 'I'.
        MESSAGE ID     SY-MSGID
                TYPE   SY-MSGTY
                NUMBER SY-MSGNO
                WITH   SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        STOP.
      ENDIF.
    ENDFORM.
    FILE_TAB = P_FILE.
      CALL FUNCTION 'GUI_DOWNLOAD'
    *Complete the FM
    Greetings,
    Blag.

  • Loading user defined variants for selection screens

    hi everybody,
    i want to add a feature to my report which automatically loads a variant for a report.just like iw38, where the variant for the main selection-screen is automatically set when you name it like "U_<username>". sadly i couldnt find anything helpful by debugging the report.
    is there a certain function module to load specific screen-variants?
    thanks,
    dsp

    Hi dsp,
    There is a table
    VARID - Variant directory.
    it consists of all the variants according to the user name, date & time.
    You can do something like this,
    data: it_variant type standard table of varid,
          wa_variant type varid.
    Initialization.
    select * into corresponding fields of table it_variant
    from varid
    where report = sy-repid
    and ename = sy-uname.
    sort it_variant descending by edat etime.
    delete adjacent duplicates from it_variant comparing ename.
    loop at it_variant into wa_variant.
    *CLEAR W_VARIANT.
    *W_VARIANT = wa_variant.
    CALL FUNCTION 'RS_SUPPORT_SELECTIONS'
      EXPORTING
        report                     = sy-repid
        variant                    = wa_variant-variant
    EXCEPTIONS
      VARIANT_NOT_EXISTENT       = 1
      VARIANT_OBSOLETE           = 2
      OTHERS                     = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endloop.
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

  • How to restrict field range in selection screen in adhoc report

    Hi Experts,
    I have created one adhoc report in which i have to restrict region values range when i searched for particular company code.is it possible to restrict in adhoc report.
    For example when i searched for particular company code US the values in region gets restricted automatically to US country itself.
    Thanks&Regards,
    narasimha.

    Hi,
    how to restrict  region list to particular company code in Adhoc report.Could you please explain it in brief .
    Regards,
    narasimha.

  • AT SELECTION-SCREEN defined in inlcude

    Hi all,
    I use the inlcude BDCRECX1 within my program.
    In the include, the "AT SELECTION-SCREEN" event is defined.
    Within my main program, I defined a pushbutton
      SELECTION-SCREEN BEGIN OF BLOCK B99.
      SELECTION-SCREEN PUSHBUTTON /1(30) DOKU
          USER-COMMAND SHOW_DOCU
          MODIF ID DOK.
      SELECTION-SCREEN END OF BLOCK B99.
    My problem is, that the SSCRFIELDS-UCOMM field is only filled with the value "SHOW_DOCU" when processing the include.
    After that, i.e. in the main program, the field is empty and I cannot query that value and check if the user pressed that button.
    Also, I cannot define the "AT SELECTION-SCREEN" event in my main program as it is already defined in the include.
    Is there any solution without changing the include?
    TIA
    Markus

    Hi
    U can manage it in AT SELECTION-SCREEN only.
    Try to manage it in a new event AT SELECTION-SCREEN ON BLOCK B99 defined in your program
    Max

Maybe you are looking for

  • Deleting one row from a table view

    hi i have one tableview model. At the footer of this tableview there are 2 buttons add and delete. I want that when I press the delete button one row must be deleted. I have written one ondel event.I have to implement the logic inside that.Can anyone

  • Music on iPhone not playing. But screen indicates it is. Why?

    I've been listening to music on my iPhone while sitting and working and while in the car. After a few songs, the audio stops, but the screen indicates the music is still playing. While having the iPhone just playing music next to me, I noticed the pl

  • How do I open a new tab? None of the options work for me.

    I've tried: 1. Clicking the "+" icon next to my current tab 2. Going to "File -> New Tab" 3. Using the "Ctrl - T" keyboard shortcut 4. Restarting Firefox 5. Restarting my computer (Windows 7 laptop) 6. Downloading all possible updates -> Restarting m

  • How can I know which line contains the error in JSP

    Hello, I got following compiling error: ava.lang.NullPointerException      at org.apache.jsp.temp1Public_jsp._jspService(temp1Public_jsp.java:252)" Is there a way I can know in which line of the jsp page the null pointer exception occurs. "line 252 "

  • Time Constraint issue

    I am getting the error below when I change the S-S (A002) relationship in po13 "No time constraint exists for key 01001S 100003931001A   1 2009090499991231S 100020" When I go to OOIT to look for the time constraint I do see time constraint defined...