How to use ranges in the program

hi all,
my requirement is i need to create a range for srat date so iam creating a structure say name of the range table is zstartdate. how to use this table in my program.
selct * from zuser_Secobjects where start_date in zstartdate. is it ok ?
thanks
maheedhar.t

hi maheedhar,
I am sending u the sample program and the docs also.
Program:
                T A B L E  D E C L E R A T I O N                     *
**-- Tables used
**-- VBAK.    "Sales Document: Header Data
                  T Y P E  D E C L E R A T I O N                     *
**-- Type for VBAK
TYPES: BEGIN OF T_VBAK,
      VBELN LIKE VBAK-VBELN,
      ERDAT LIKE VBAK-ERDAT,
      AUART LIKE VBAK-AUART,
      END OF T_VBAK.
       I N T E R N A L  T A B L E  D E C L E R A T I O N             *
**-- Internal table to store header data
DATA: IT_VBAK TYPE STANDARD TABLE OF T_VBAK WITH HEADER LINE.
**-- Ranges for Inquiry/Quotation
RANGES R_AUART FOR VBAK-AUART.
       C O N S T A N T S           D E C L E R A T I O N             *
**-- Constant to store value of Inquiry (IN) / Quotation (QT).
CONSTANTS: C_IN LIKE VBAK-AUART VALUE 'AF',
           C_QT LIKE VBAK-AUART VALUE 'AG',
           C_EQ(4) TYPE C VALUE 'EQ',
           C_I(2) TYPE C VALUE 'I'.
                     I N I T I A L I Z A T I O N                     *
**-- Clear the internal tables and flag.
CLEAR: IT_VBAK,
       R_AUART.
**-- Refresh the internal tables.
REFRESH: IT_VBAK,
         R_AUART.
**-- Initialization of ranges
R_AUART-SIGN = C_I.
R_AUART-OPTION = C_EQ.
R_AUART-LOW = C_IN.
APPEND R_AUART.
CLEAR R_AUART.
R_AUART-SIGN = C_I.
R_AUART-OPTION = C_EQ.
R_AUART-LOW = C_QT.
APPEND R_AUART.
CLEAR R_AUART.
            S E L E C T I O N  S C R E E N                           *
SELECTION-SCREEN BEGIN OF BLOCK CHARLY WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR IT_VBAK-VBELN OBLIGATORY.
SELECT-OPTIONS: S_ERDAT FOR IT_VBAK-ERDAT.
SELECTION-SCREEN END OF BLOCK CHARLY.
  A T  S E L E C T I O N  S C R E E N ( V A L I D A T I O N S )      *
AT SELECTION-SCREEN.
**-- Check the sales order number exists in the database table or not
  SELECT SINGLE VBELN
                FROM VBAK
                INTO IT_VBAK
                WHERE VBELN IN S_VBELN
                  AND ERDAT IN S_ERDAT
                  AND AUART IN R_AUART.
**-- If no single data selected display error message.
  IF SY-SUBRC <> 0.
    MESSAGE E000.
  ENDIF.
               S T A R T  O F  S E L E C T I O N                     *
START-OF-SELECTION.
**-- To fetch data from database table (VBAK)
**-- Store the data into the internal tabe (IT_VBAK)
  PERFORM ZF_GETDATA.
                 E N D  O F  S E L E C T I O N                       *
END-OF-SELECTION.
**-- To display sales order.
  PERFORM ZF_CHECK_DISPLAY.
                        T O P  O F  P A G E                         *
TOP-OF-PAGE.
**-- Page header
  PERFORM ZF_TOP_OF_PAGE.
                        E N D  O F  P A G E                         *
END-OF-PAGE.
**-- Page footer
  PERFORM ZF_END_OF_PAGE.
*&      Form  ZF_GETDATA
      text
-->  p1        text
<--  p2        text
FORM ZF_GETDATA .
  SELECT VBELN
         ERDAT
         AUART
         INTO TABLE IT_VBAK
         FROM VBAK
         WHERE VBELN IN S_VBELN
               AND ERDAT IN S_ERDAT
               AND AUART IN R_AUART.
  IF SY-SUBRC <> 0.
    MESSAGE S001 WITH IT_VBAK-VBELN.
  ELSE.
    SORT IT_VBAK.
  ENDIF.
ENDFORM.                    " ZF_GETDATA
*&      Form  ZF_CHECK_DISPLAY
      text
-->  p1        text
<--  p2        text
FORM ZF_CHECK_DISPLAY .
  CLEAR: IT_VBAK.
   LOOP AT IT_VBAK.
  IF IT_VBAK-AUART = C_IN.
    ULINE.
    WRITE:/1 SY-VLINE, 10 TEXT-006 INVERSE COLOR COL_HEADING,
           50 TEXT-007 INVERSE COLOR COL_HEADING,
           143 SY-VLINE.
      WRITE:/1 SY-VLINE,12 IT_VBAK-VBELN INVERSE COLOR COL_NORMAL,
             52 IT_VBAK-ERDAT INVERSE COLOR COL_NORMAL,
             143 SY-VLINE.
  ENDIF.
  IF IT_VBAK-AUART = C_QT.
    ULINE.
    WRITE:/1 SY-VLINE, 10 TEXT-008 INVERSE COLOR COL_HEADING,
            50 TEXT-007 INVERSE COLOR COL_HEADING,
            143 SY-VLINE.
      WRITE:/1 SY-VLINE,12 IT_VBAK-VBELN INVERSE COLOR COL_NORMAL,
             52 IT_VBAK-ERDAT INVERSE COLOR COL_NORMAL,
             143 SY-VLINE.
  ULINE.
  ENDIF.
   ENDLOOP.
ENDFORM.                    " ZF_CHECK_DISPLAY
*&      Form  ZF_TOP_OF_PAGE
Header of the page gets displayed as soon as a new page is generated
FORM ZF_TOP_OF_PAGE .
  ULINE.
  WRITE:/1 SY-VLINE, 5 TEXT-002 INVERSE COLOR 7,143 SY-VLINE.
  WRITE:/1 SY-VLINE, 143 SY-VLINE .
  WRITE:/1 SY-VLINE, 30 TEXT-003 INVERSE COLOR 7,143 SY-VLINE.
  WRITE:100 TEXT-004 INVERSE COLOR 7,120 SY-DATUM INVERSE COLOR 7,
  143 SY-VLINE.
  WRITE:/1 SY-VLINE,100 TEXT-005 INVERSE COLOR 7,
  120 SY-PAGNO INVERSE COLOR 7,143 SY-VLINE.
  ULINE.
ENDFORM.                    " ZF_TOP_OF_PAGE
*&      Form  ZF_END_OF_PAGE
Footer text displayed in each page
FORM ZF_END_OF_PAGE .
  WRITE:/60 TEXT-008.
Docs:
                                       Ranges
A selection table is linked to the column of a database table, or to an internal field in the program. A selection table is an internal table object of the standard table type that has a standard key and a header line.
In addition to selection tables that we create using SELECT-OPTIONS, we can use the RANGES statement to create internal tables that have the structure of selection tables. You can use these tables with certain restrictions the same way you use actual selection tables.
A ranges table type is a special case of a table type. A ranges table type describes the structure of an internal table for administrating complex areas, i.e. the type of an internal table ranges table in the ABAP program.
The row type of a ranges table type has a fixed structure. The row type consists of 4 components SIGN (sign), OPTION (comparison operator), LOW (lower limit) and HIGH (upper limit) in this order.
1.     SIGN – The database type of SIGN is C with length 1. The contents of SIGN determine for each row whether the result of the row condition is to be included in or excluded from the resulting set of all rows. Possible values are I (inclusion criterion – operators are not inverted) and E (exclusion criterion – operators are inverted).
2.      OPTION – The database type OPTION is C with length 2. It contains the selection operator. The following operators are available:-
-     If HIGH is empty, we can use EQ, NE, GT, LE, LT, CP, and NP.
-     CP and NP are only allowed if wildcards (‘*' or '+’) are used in the input fields.
-     If wildcards are entered on the selection screen, the system automatically uses the operator CP. The escape character is defined as #.
-      If HIGH is filled, you can use BT (Between) and NB (Not Between). We cannot use wildcard characters.
3.     LOW - The data type of LOW is the same as the column type of the              database table, to which the selection criterion is linked.
– If HIGH is empty, the contents of LOW define a single field comparison. In combination with the operator in OPTION, it specifies a condition for the database selection.
–     If HIGH is filled, the contents of LOW and HIGH specify the upper and lower limits for a range. In combination with the operator in OPTION, the range specifies a condition for the database selection.
4.     HIGH - The data type of HIGH is the same as the column type of the database table, to which the selection criterion is linked. The contents of HIGH specify the upper limit for a range selection.
If the selection table contains more than one row, the system applies the following rules when creating the complete selection criterion:
1.     Form the union of sets defined on the rows that have SIGN field equal to I (inclusion).
2.     Subtract the union of sets defined on the rows that have SIGN field equal to E (exclusion).
3.     If the selection table consists only of rows in which the SIGN field equals E, the system selects all data outside the set specified in the rows.
RANGES tables
We can use the following variants of the TYPES and DATA statements to create internal tables of the same type as selection tables.
TYPES|DATA .
An elementary associated type defines the type of components LOW and HIGH. It can be defined by specifying a data element or by directly defining the data type, number of places and if necessary the number of decimal places.
A ranges table type always has Standard table access mode and a standard key that is non-unique.
I think this will help u .
Reward points if helpful.
Regards
Nilesh

Similar Messages

  • New computer win 8.1 pro, installed my creative Suite 4 Design premium but it shuts down when I try to use any of the programs and gives me an error code 147:20. How can I fix this?

    New computer win 8.1 pro, installed my creative Suite 4 Design premium but it shuts down when I try to use any of the programs and gives me an error code 147:20. How can I fix this? Is this a conflict with win 8.1 pro?

    You need to adjust your security stuff/ permissions and possibly use compatibility modes. It means that your licensing service is being blocked/ shut down.
    Mylenium

  • I downloaded the free trial for Adobe XI Pro but now I cant find it on my computer or figure out how to use it. The only thing I see that downloaded is Adobe Download Assistant. How can I access the program?

    I downloaded the free trial for Adobe XI Pro but now I cant find it on my computer or figure out how to use it. The only thing I see that downloaded is Adobe Download Assistant. How can I access the program?

    Assistanttolindsey the Adobe Download Assistant will download the installation files for Adobe Acrobat Professional XI.  By default they are saved to your download folder.  You can begin the installation process from there.

  • The disk containing your iPhoto library is running low on space.How is this possible? I have no photos and have never used iphoto and the program is up to date.

    How is this possible? I have no photos and have never used iphoto and the program is up to date. I try to import and drop my pictues into iphoto but nothing happens or I get above statement. Help please!

    Then it's a bogus message and indicates that the default library is damaged.
    Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library' and use that one.
    Regards
    TD

  • When I upgraded from v4 to v5 my bookmarks was lost. I do have the one that is in the firefox toolbar. Apparently I had a bookmarks add-on. V5 changed my browser how can I determine what the program was and if the bookmarks are still there?

    When I upgraded from v4 to v5 my bookmarks was lost. I do have the one that is in the firefox toolbar. Apparently I had a bookmarks add-on. V5 changed my browser how can I determine what the program was and if the bookmarks are still there?

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Websites remembering you and automatically log you in is stored in a cookie.
    *Create an allow Cookie Exception to keep such a cookie, especially for secure websites and if cookies expire when Firefox is closed.
    *Tools > Options > Privacy > Cookies: Exceptions
    In case you are using "Clear history when Firefox closes":
    *do not clear Cookies
    *do not clear Site Preferences
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
    *https://support.mozilla.org/kb/Clear+Recent+History
    Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.
    Clearing cookies will remove all specified (selected) cookies including cookies that have an allow exception and cookies from plugins.

  • How to use ranges?

    Hi all,
    can any body explain how to use ranges?  i used like below..
    but im not getting pls  correct it...
    RANGES : HKONT FOR BSEG-HKONT.
    DATA : WA_HKONT LIKE LINE OF HKONT.
    START-OF-SELECTION.
    WA_HKONT-SIGN = 'I'.
    WA_HKONT-OPTION = 'EQ'.
    WA_HKONT-LOW = '10725140'.
    WA_HKONT-HIGH = ' '.
    APPEND WA_HKONT TO HKONT.
    CLEAR WA_HKONT.
    WA_HKONT-SIGN = 'I'.
    WA_HKONT-OPTION = 'EQ'.
    WA_HKONT-LOW = '10725120'.
    WA_HKONT-HIGH = ' '.
    APPEND WA_HKONT TO HKONT.
    CLEAR WA_HKONT.
    WA_HKONT-SIGN = 'I'.
    WA_HKONT-OPTION = 'EQ'.
    WA_HKONT-LOW = '10725110'.
    WA_HKONT-HIGH = ' '.
    APPEND WA_HKONT TO HKONT.
    CLEAR WA_HKONT.
    WA_HKONT-SIGN = 'I'.
    WA_HKONT-OPTION = 'EQ'.
    WA_HKONT-LOW = '10725190'.
    WA_HKONT-HIGH = ' '.
    APPEND WA_HKONT TO HKONT.
    CLEAR WA_HKONT.
    WA_HKONT-SIGN = 'I'.
    WA_HKONT-OPTION = 'EQ'.
    WA_HKONT-LOW = '10725130'.
    WA_HKONT-HIGH = ' '.
    APPEND WA_HKONT TO HKONT.
    CLEAR WA_HKONT.
    WA_HKONT-SIGN = 'I'.
    WA_HKONT-OPTION = 'EQ'.
    WA_HKONT-LOW = '10725160'.
    WA_HKONT-HIGH = ' '.
    APPEND WA_HKONT TO HKONT.
    CLEAR WA_HKONT.
    WA_HKONT-SIGN = 'I'.
    WA_HKONT-OPTION = 'EQ'.
    WA_HKONT-LOW = '10725180'.
    WA_HKONT-HIGH = ' '.
    APPEND WA_HKONT TO HKONT.
    CLEAR WA_HKONT.
    WA_HKONT-SIGN = 'I'.
    WA_HKONT-OPTION = 'EQ'.
    WA_HKONT-LOW = '10725150'.
    WA_HKONT-HIGH = ' '.
    APPEND WA_HKONT TO HKONT.
    CLEAR WA_HKONT.
    WA_HKONT-SIGN = 'I'.
    WA_HKONT-OPTION = 'EQ'.
    WA_HKONT-LOW = '10725170'.
    WA_HKONT-HIGH = ' '.
    APPEND WA_HKONT TO HKONT.
    CLEAR WA_HKONT.
    and in select quer i have used like this.
    SELECT BUKRS
           BELNR
           GJAHR
           BUZEI
           HKONT
           LIFNR
           DMBTR
           KTOSL
           WERKS
           SEGMENT
           FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_BSEG
           FOR ALL ENTRIES IN IT_BKPF
           WHERE BUKRS = IT_BKPF-BUKRS
           AND   BELNR = IT_BKPF-BELNR
           AND   GJAHR = IT_BKPF-GJAHR
           AND   LIFNR IN S_LIFNR
           AND   WERKS IN S_WERKS
           AND   HKONT IN HKONT
          AND    KTOSL = 'FR1'
           AND   SEGMENT IN S_SEGM.
    pls  help...

    Hi Sameer,
    Let me share my solution with you.
    try with this....
    RANGES : HKONT FOR BSEG-HKONT.
    INITIALIZATION.
    HKONT-SIGN = 'I'.
    HKONT-OPTION = 'EQ'.
    HKONT-LOW = '10725140'.
    APPEND  HKONT.
    CLEAR HKONT.
    HKONT-SIGN = 'I'.
    HKONT-OPTION = 'EQ'.
    HKONT-LOW = '10725120'.
    APPEND HKONT.
    CLEAR HKONT.
    HKONT-SIGN = 'I'.
    HKONT-OPTION = 'EQ'.
    HKONT-LOW = '10725110'.
    APPEND  HKONT.
    CLEAR HKONT.
    HKONT-SIGN = 'I'.
    HKONT-OPTION = 'EQ'.
    HKONT-LOW = '10725190'.
    APPEND HKONT.
    CLEAR HKONT.
    HKONT-SIGN = 'I'.
    HKONT-OPTION = 'EQ'.
    HKONT-LOW = '10725130'.
    APPEND  HKONT.
    CLEAR HKONT.
    HKONT-SIGN = 'I'.
    HKONT-OPTION = 'EQ'.
    HKONT-LOW = '10725160'.
    APPEND HKONT.
    CLEAR HKONT.
    HKONT-SIGN = 'I'.
    HKONT-OPTION = 'EQ'.
    HKONT-LOW = '10725180'.
    APPEND HKONT.
    CLEAR HKONT.
    HKONT-SIGN = 'I'.
    HKONT-OPTION = 'EQ'.
    HKONT-LOW = '10725150'.
    APPEND HKONT.
    CLEAR HKONT.
    HKONT-SIGN = 'I'.
    HKONT-OPTION = 'EQ'.
    HKONT-LOW = '10725170'.
    APPEND  HKONT.
    CLEAR HKONT.
    Hope this helps you. Reply for queries, shall post the updates.
    Regards. 
    Kumar.

  • How to use labview with the handyboard

    Hi,
    how to use labview with the handyboard
    Thx...

    I'm assuming you're talking about this, since you didn't provide a link for those of us who don't know what you're talking about.
    As the other poster said, you didn't say how you want to use LabVIEW with it.  If you want to write LabVIEW programs than run on the microprocessor, then you're out of luck.  If you want LabVIEW to interact with it, then you've got a couple of options, SPI probably being the best, but it also has DI and AI that you could use to communicate with it - the DI's could be used as a parallel interface.
    Message Edited by Matthew Kelton on 12-17-2007 02:21 PM

  • How to use upload condition record program RV14BTCI

    Hi
    how to use upload condition record program RV14BTCI.
    kathir.

    Hi,
    To run this program we have to maintain Upload file in Application Directory,
    We have to maintain 3 levels of records in that file.. my feel you upload through BDC or LSMW.
    For your information,
    The batch input program RV14BTCI reads the parameters is necessary
    Giving sequential file and creates (depending on the data
    In the file seq) one or more batch input sessions.
    The data are seq file in the following structure expected:
    - The session a session intent (Table KOBTCI, Record 0)
    All other records until the next session, the intent
    Last session assigned to read
    - The head condition Sentence (Table KOBTCI, record 1)
    All other records until the next condition,
    Last read head appropriate rate
    This includes the corresponding condition
    Condition table
    - The key sentence of a Main (Table KOBTCI, record 2)
    It must be directly on the head set to follow
    It contains the key condition of the table
    + Detail fields
    - The season record has a subordinate clause (Table KOBTCI, record 3)
    The teams relate to the key sentence in the main
    Best Regards,
    KSK

  • How to use ComponentWork CWSerial to program such thing like HyperTerminal does to communicate 2 PCs through its RS232?

    Right now I use null modem cable, I can communicate 2 PCs use hyper-terminal. I wonder how to use ComponentWork CWSerial to program such kind of job? Thanks!

    Hi Kevin,
    Of course this will take a little work, but CWSerial should be able to handle this without too much hassle. Take a look at the example program usually included in C:\Program Files\National Instruments\MeasurementStudio\VB\Samples\Instr\Basic Serial
    You should be able to use this example as a starting point.
    Hope this helps out!!!
    Best Regards,
    Aaron Kobayashi
    Application Engineer
    National Instruments

  • I have made with iweb a website on my macbook, now i want to change it, through my imac, how can I get in the program , which is on the mac book. On both computer I have Lion

    i have made with iweb a website on my macbook, now i want to change it, through my imac, how can I get in the program , which is on the mac book. On both computer I have Lion

    You need to transfer your domain.sites file from your MacBook to your iMac.  This is the file where iWeb stores all info and can be found under User/Library/Application Support/iWeb/domain.sites.
    Transfer this file from your MacBook to the same place on your iMac and double click the domain.sites file and iWeb will open it on your iMac and you can update your site from there too.

  • I just bought photoshop elements 13 last night. Today I am watching tutorial videos to show me how to use it, but the videos are showing me things I don't have. Asking me to click on tabs i don't have. Why is this? Is there another way I can learn? Or is

    I just bought photoshop elements 13 last night. Today I am watching tutorial videos to show me how to use it, but the videos are showing me things I don't have. Asking me to click on tabs i don't have. Why is this? Is there another way I can learn? Or is my download messed up and not giving me everything I need?

    Got a link showing us which video tutorials you're watching and examples of what's missing in your software?

  • How do I know if the program has been downloaded to another computer or not?

    How do I know if the program has been downloaded to another computer or not? Also how do I know if it is the educational version or not?

    What exactly? Your questions don't make much sense since you failed to provide an explanation what problem you actually have, what program you actually mean and so on. That aside, edu versions are technically not different from the normal programs, just their licensing is different.
    Myleniumu

  • How to use shortDesc in the disabled inputtext

    hi,all
    i encounter a problem,our team must use disabled inputtext when the text is only used to output string.
    the reson we don't use outputext is if there is noting in the outputtext,there is nothing displayed.
    how to use shortDesc in the disabled inputtext?
    here is the code:
    <af:inputText value="#{bindings.shortdesc.inputValue}" disable="true"
    id="ot2" columns="25" shortDesc="#{bindings.longdesc.inputValue}"
    simple="true"/>
    thanks all

    Hi,
    ........... I use JDev 11g ..............
    If you make your inputText disabled -----> shortDesc will not be displayed.
    You can make a workaround to achieve this by using popup as :
    1- add showPopupBehavior inside your inputText as :
    <af:inputText label="label1" id="it1" disabled="true">
                    <af:showPopupBehavior triggerType="mouseOver"
                                          align="endBefore" alignId="it1"
                                          popupId="p1"/>
                  </af:inputText>2- add a popup which will display your shortDesc text
    <af:popup id="p1">
                      <af:outputText value="Sameh POPUP" id="ot1"/>
              </af:popup>I hope it is useful.
    Sameh Nassar

  • Hello , I need to find the serial number of my programs . Would anyone know where and how to do it? The programs are installed on PC Thank you

    Hello , I need to find the serial number of my programs .
    Would anyone know where and how to do it?
    The programs are installed on PC
    Thank you

    Find your serial number quickly

  • How to use PS to judge the existence of a folder in the specified directory and how to use PS in the specified directory to create to create the folder?(javascript)

    1,How to use PS to judge the existence of a folder in the specified directory?(use javascript)
    2, how to use PS in the specified directory to create to create the folder?(use javascript)
    Thanks you!

    Thanks you!

Maybe you are looking for

  • Recording on to my nano

    How can i record my own voice onto my nano, it is an ideal way to study material to be used in exams. Somebody please help as exams are getting closer.

  • Where to install 3.1?

    Do you where can I download UPK 3.1? Our server crashed and I to need to reinstall this old version. Istill have content in the library that Ineed to migrate to 3.6. Oracle's edelivery site only lists the current 11.0 version. Jon

  • Error while checking connection after establishing sap router

    Hello All, I have installed a sap router on our solution manager on Linux environment when i try to check the RFC connection from SM59 i am receiving the following error. my  message server is configured as follows Msg. Server - /H/<SAP Router Ip>/S/

  • All event listeners and models in one file?

    I have one java file for all my event listeners of a programm and one java file for all my models. Is this good? I create instances with new AllInOneHandler.MouseHandler() for example. Or should I have one file for each event and each model?

  • HP Pavilion 15 E182NR BIOS Access

    I need to know how to access the BIOS on a HP Pavilion 15 E182NR so that I can change the boot sequence. This laptop currently has Windows 8, my friend wants me to install Windows 7.