How to compare table's date field with dropdown year field

Hi All,
I have one requirement to display the selected rows from a database table based on the selection of drop down.
Here, I have one dropdown of year(like 2009,2010,....) and I have one database table which contains one field with "DATE".
Now, I want to compare table's DATE field with my dropdown field.
Problem is that table's DATE field is of type "DATS" and dropdown is of type INTEGER(or) STRING ...
How to compare this fields?
Can any one please give me solution for this...!
Thanks in Advance!

Hi  sreelakshmi.B,
try the following:
DATA lt_dats        TYPE TABLE OF dats.
DATA l_dat_i        TYPE          i.
DATA l_dat_c_4(4)   TYPE          c.
DATA l_dat_c_12(12) TYPE          c.
DATA l_dats_from    TYPE          dats.
DATA l_dats_to      TYPE          dats.
*Move Date from Integer to Char
l_dat_c_4 = l_dat_i = 2005.
*Create Date From use in WHERE-Clause
CONCATENATE '01.01.' l_dat_c_4 INTO l_dat_c_12.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
     EXPORTING
          date_external            = l_dat_c_12
     IMPORTING
          date_internal            = l_dats_from
     EXCEPTIONS
          date_external_is_invalid = 1
          OTHERS                   = 2.
IF sy-subrc <> 0.
ENDIF.
*Create Date To use in WHERE-Clause
CONCATENATE '31.12.' l_dat_c_4 INTO l_dat_c_12.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
     EXPORTING
          date_external            = l_dat_c_12
     IMPORTING
          date_internal            = l_dats_to
     EXCEPTIONS
          date_external_is_invalid = 1
          OTHERS                   = 2.
IF sy-subrc <> 0.
ENDIF.
* Select records in range
SELECT *
       FROM [DBTAB]
       INTO TABLE [ITAB]
       WHERE [DATE] BETWEEN l_dats_from
                    AND     l_dats_to.
Regards
REA

Similar Messages

  • How to create an UTF8 data file with max length fields

    We have a legacy application which allows for a transparent text field a maximum length of 30 Bytes.
    The DB-Length of the field is 40 Chars.
    In old NUC days it was so simple:
    TYPES: BEGIN OF t_items,
             hwmc(30) TYPE C,  
    A move, that was it.
    Now we have migrated to unicode, use UTF8 for the external data and are puzzeling over how to create an output field with a fixed length of 30 Bytes.
    Has somebody an elegant idea?

    wyfwong, >> Does the schema which stores a large BLOB column has to create a large tablespace in order to store the column value or the database automatically enlarge the tablespace when a large BLOB column is loaded into the table? <<
    The answer to this question would depend on how you defined the tablespace adn datafiles used to store the tablespace objects to begin with: raw partitions verse files, autoextend on or off, etc....
    It would seem to me to be foolish not to predefine the tablespace at least large enough to hold the tables and indexes based on their expected near_term data loads. That is, if you know the initial load of data will be 60G then the tablespace should be larger than 60G to start with.
    HTH -- Mark D Powell --

  • How to compare table data and table field

    Hi buddy,
        I have some question about how to compare table data and table field.
       1. I know there is one method:   CL_ABAP_UNIT_ASSERT=>ASSERT_TABLE_CONTAINS  , it use in unit test to compare the table data(A and B) , you can loop table A into structure A1, then use this mehtod it can compare whether table B contain structure A1.  but when I try to use this in main program it will dump.
              CL_ABAP_UNIT_ASSERT=>ASSERT_TABLE_CONTAINS(
                                                                                                        LINE    = A1
                                                                                                        TABLE = B ).
           Is there any method or FM can be used to compare the table data ?
        2. I also want to compare two table field , try to find out the different. How to realize this.
    Thank you for your sincerely answer.

    Hi Zongjie,
    What`s the difference, if you using loop A into wa_A, read table B into wa_B with all field, then compare with wa_A and wa_B.
    The question 2, seems no standard FM available here.
    Loop A into wa_A.
       Loop B into wa_B.
           if wa_A-field1 eq wa_B-field1.
           endif.
            if wa_A-field2 eq wa_B-field2. 
           endif.
       endloop.
    endloop.
    regards,
    Archer

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • Oracle Forms - How can I create a Data Block with query

    Dear friends I have a question, I couldn't do this..
    I have a sql query, I want to show the datas of the query.. How can I do this. ?
    Data Block Wizard wants a table, view or stored procedure, but I have a query, how can I create a data block with my query.. I m waiting your helps..? Please...
    Semih

    Hi,
    You have two options
    1. create a view and base the block on the view
    2. create a block with a query Data Source Type of 'FROM clause query'
    Hope this helps
    Neil

  • How to Map Proces form field with Resource form field?

    Hi,
    How to Map Proces form field with Resource form field while creating Process form in Form designer

    Are you talking about Provisioning ?
    then you do that in Data Flow under Process Defintion in OIM 10g
    In OIM 11g you use Request Dataset. In that you can directly map fields to process form.

  • How a relational table stores data

    Hi,
    Can anyone please tell me how a relational table stores data internally? I mean what happens internally when we insert a new row into table? Please give me link of PDFs that I needed to go through. What I want is to be able to write a code for Relational objects such as table. What kind of preparation is needed for this?
    Please give your answer in detail. You may send me direct email at [email protected]
    Quick answers are highly appreciated.
    Thanks in advance !!!
    Edited by: DataExpert on 01-Sep-2009 10:55

    Hi,
    Can anyone please tell me how a relational table stores data internally? I mean what happens internally when we insert a new row into table? Please give me link of PDFs that I needed to go through. What I want is to be able to write a code for Relational objects such as table. What kind of preparation is needed for this?
    Please give your answer in detail. You may send me direct email at [email protected]
    Quick answers are highly appreciated.You question is not clear what you want to know exactly.
    With respect to relations tables you can get the information on google it self
    http://livedocs.adobe.com/coldfusion/6.1/htmldocs/db_basi4.htm
    http://en.wikipedia.org/wiki/Relational_database
    I mean what happens internally when we insert a new row into table? Please give me link of PDFs that I needed to go throughRefer to : http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14220/memory.htm
    the above links gives the idea of oracle memory architecture, then if we say some thing how it process then you can understand.
    What I want is to be able to write a code for Relational objects such as table. What kind of preparation is needed for this? You need to know the SQL and PL/SQL , which enables you to handle the things.
    Please give your answer in detail. You may send me direct email at [email protected]
    Quick answers are highly appreciated.we are not hear to send email or to do the development things. We are spending some of our vauable time to help out and to learn some thing from forums. Sharing views and knowledge across. You must understand and we will be high appreciate that, f you do so.
    HTH
    sb92075 ,
    - Pavan KumarN

  • Moving LR5 catalog (Irdata & Ircat) to a new hard drive and photos. Lost all meta data - How do I move meta data along with catalog?

    I moved LR5 catalog (Irdata & Ircat) to a new hard drive and photos. Lost all meta data - How do I move meta data along with catalog?
    The meta data for each image is missing.
    I have over 2,000 images. I don't want to go back through each image and add meta data.
    Is there some way to move everything?

    No, do not re-import your images. I assume you can see the thumbnails in the library module, just cannot access the full images, right? If this is the case there should be an exclamation mark in the top right corner of every one of your pictures and you only have to tell LR where the images are now.
    Click the exclamation mark of one of the images and a dialog window should pop-up, telling you that LR cannot find the file, but with an option to locate it. Press "Locate" and navigate to the folder on your new HD where the file is. If in the new external HD you kept the same folder structure that you had on the internal disk, LR will be able to find all your images and re-link them to the database without further intervention.

  • How can we view the data asociated with Request ID

    Hi All,
    I have data loaded in an ODS there are multiple files loaded in this ODS. Now i want to view data for a perticuler request OR i want to know how can we know the data associated with a perticular request.
    Please help me out.
    Thanks & Regards
    Amit Kumar

    Copy the request number (not request ID) from the ODS manage screen, Goto RSRQ give the request number and execute. it shows the monitor screen- now goto PSA from the top and check the data. But this possible only if you are loading data to PSA also along with ODS.
    Otherwise, Goto Display Data of ODS from the right click on it -- in the selection screen give the Request ID that you want to check the data. Then it displays only that request data.
    Hope this helps.
    Veerendra.
    Edited by: denduluri veerendra kumar on Dec 1, 2009 12:40 PM
    Edited by: denduluri veerendra kumar on Dec 1, 2009 12:43 PM

  • HELP CREATING ADDITIONAL FIELDS  WITH  DROPDOWN IN STANDARD INFOTYPE

    HI ALL,
    I AM IN ABAP-HR.
    I HAVE 2 THINGS 2 ASK MY FRIENDZ..
    1). I WANT TO ENHANCE STANDARD INFOTYPE...
    I  WANT TO PUT ADDITINAL FIELD WITH DROPDOWN...
    I CAN PUT ADDITIONAL FIELD BUT I DONT KNOW HOW CAN I DO WITH DROPDOWN...
    2).
    OTHERTHING I WANT TO CHANGE THE TEXTFIELD OF STANDARD INFOTYPE..
    I MEAN 2 SAY CHANGE TEXT 'BIRTHDATE' TO 'DATE'..
    CAN U PLZ HELP ME OUT 4 THIS....
    WAITING 4 FAVOURABLE REPLY..
    BBYE..

    Hello Bhumit,
    1) to check how to bring values to a dropdown please refer the standard demo report programs in se38
    a)DEMO_DROPDOWN_LIST_BOX
    b)demo_dynpro_dropdown_listbox.
    2)We need to understand that if the field label 'BIRTHDATE' is from a standard screen then the approach is to go to that particular screen ...delete the text and put our own text there as 'DATE' ..otherwise if the field is a custom field we can change the name in the field level or domain level
    Pls check,revert and reward if helpful
    Regards
    Byju

  • How to compare the Two Date field

    Hi
    i am doing a program with has two field in the Database IssueDate and the ReturnDate. But these two Field Data Type are Text. i don't use them as Data/Time. Now i want to compare the ReturnDate With Today's Date. That is whether ReturnDate is Less than Today's Date.
    Please give me a suggestion to proceed with this Particular Program.
    Thank you for your suggestion
    jofin

    Hi thank you for your reply
    1) i am Creating a library system In that when i issue a book i have to add the number days that a candidate Eligible to hold the Book with a Issue Date and store it as a Return date.
    2) i want to know who has to return the Books on Today.
    3) i want to know you has to return the Book Yet.
    For 1 st one i used GregorianCalendar gcal=new GregorianCalendar();
              ridate= gcal.get(Calendar.DATE);
              rimonth=(int)gcal.get(Calendar.MONTH)+1;
              riyear= gcal.get(Calendar.YEAR);
              rissuedate = ridate+"/"+rimonth+"/"+riyear;this and Calulate it the Returndate.
    is it Possible to convert This rissuedate = ridate+"/"+rimonth+"/"+riyear; string into date like this Formate dd/mmd/yy. and store the Date in the Database
    if so please tell me how to write a query to insert a date and while retriving how to retrive the Date.
    i mean when we retrive a String from database we use getString(); method . Like this how to retrive the Date
    Please help me on this Issue
    Thank you very much for your Help
    Cheers
    Jofin

  • How to compare table in different versions?

    Hi,
    Please let me know how to comare table fields in different versions?
    Ex: I need to compare the table fields of version 4.5 with ECC6.0.
    Thank you.

    Hi,
      goto Se11 Transaction -> enter table -> display.
    Utilities ->Version -> version management
    now click on remote comparison -> enter target system.
    Regards
    Kiran Sure

  • Data associated with Activity Type field in Costing transaction KP26.......

    Hi,
    In what table can I find relation between the<b> Plan Activity</b> and <b>Distribution Key</b> data assciated with a <b>Activity Type</b> field in Costing transaction KP26.
    Please help.
    Regards,
    Rajesh.

    HI,
    Please check these notes.
    86613
    688883    Confirmation with price 0: Message BK057
    645811    Confirmation with plan price 0: No costs in CO
    Plese assign points if it useful.
    Regards
    Ravinagh Boni

  • How to add Currency field with dropdown on screen layout (module pool)

    I need to add a field called <b>Currency( field label )</b> with <b>dropdown (like SKB1-WAERS). </b>
    The <b>field label</b> and <b>input output field </b> should default as being hidden and
    sould be visible only when other field value ( on the same screen ) should match with the value in the database table . 
    Could you please suggest me how to create dropdown
    and give this functionality with coding ?
    Thanks in advance.

    Hi,
    In the field attributes of the SKB1-WAERS..in the group attributes..give a group name G1..Add the same G1 for the field lable also.
    Then in the PBO of the screen..
    ***Check the conditions..when other field value (on the same screen) matches
    ***with the value in the database table.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'G1'.
        SCREEN-INPUT = '0'.
        SCREEN-INVISIBLE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    Thanks,
    Naren

  • How Can i send the data entered in Input text fields to e-mail?

    Iam Jennifer, Iam having a doubt in Flash, I hope that you
    are going to solve my problem, Iam taking 3 Static text fields as
    Name, Age and Country and besides each and every static text fields
    i have taken 3 input text fields with different instance names,
    when i enter my Name, Age and Country details in the input text
    fields and after entering those details if user clicks the submit
    button the data should be send to some mail address, is it possible
    Im not so good at action script, but i hope that any one can
    help me...
    Iam attaching the action script code also, please find the
    attachment below, the actions are given to button.
    Attach Code
    Btn.onPress = function ()
    mail_lv = new LoadVars();
    mail_lv.dummy1 = "";
    mail_lv.subject = "Details";
    mail_lv.message = "hi";
    mail_lv.username = "name_txt".text;
    mail_lv.age = "age_txt".text;
    mail_lv.country = "country_txt".text;
    mail_lv.onLoad = function ()
    trace("Sent successfully...");
    trace("mail_lv.subject = " + mail_lv.subject);
    trace("mail_lv.message = " + mail_lv.message);
    mail_lv.send("mailto:[email protected]", "_blank");

    The names of your variables, "name_txt", for instance, should
    NOT have quotes around them. Use:
    mail_lv.username = name_txt.text;
    mail_lv.age = age_txt.text;
    mail_lv.country = country_txt.text;

Maybe you are looking for

  • HELP, My SWF doesn´t work in latest versions of IE and Safari

    I have a swf made in Flash CS4. It works fine in firefox and older versions of flash player in IE, but it doesn't work in recent versions of IE and Safari In this case just I can hear the music. Could help me please, my URL is: http://www.quecolor.co

  • Xml data connection issue.

    Hi all, I have created an XML data connection in xcelsious that reads data from xml file and creates the stacked bar chart. Also used connection refresh button to refresh the data from xml file. For using xml data connection we have to give the fix s

  • Multi-level UPCs (I can do as pivot table in Access and Excel, but not SAP)

    I'm working for a shoe manufacturer. We've got inventory that can be grouped into "cases" as well as "open-case" in regards to UPCs. We're able to apply the UPC to individual items such as open-case stock OR case-only, but we can't figure out how we

  • Missing file after system restore

    Dear Sir, today i performed on a tecra M2 a system restore, but suddenly the message came that i had to re-install the following file : <windows root>\system32\ntoskrnl.exe : how do i do that : put in the recovery cd or just do a format of the disk w

  • SOLMAN 7.1 Managed system(Maintain RFC's Step)

    Hi All, I am performing Managed System Configuration for PI system. In the Maintain RFC's step I am facing below error. SOLMAN (7.1 sp12). Kindly help me by suggesting how to resolve this issue. I am attaching screen shots. If these can help Thanks a