Selectable ranges in datechooser from database

Hi guys!
I got a problem, I'm trying to set ranges in a datechooser. The code I use is this:
<mx:DateChooser horizontalCenter="0" bottom="0" top="0" width="75%" id="calendario_desde"  creationComplete="fecha_desde_inicio()"/>
protected function fecha_desde_inicio():void
fecha_desde.token =  database.fecha_desde();
anio= fecha_desde.lastResult.valor1;
mes = fecha_desde.lastResult.valor2;
dia = fecha_desde.lastResult.valor3;
dRanges.push({rangeStart:new Date(anio,mes,dia), rangeEnd: new Date (2011,2,1)});
calendario_desde.selectableRange = dRanges;
Could you tell me what's wrong?
Thanks

DateChooser.selectableRange accepts an object having startRange and endRange properties. In your version, you give it an array! containing an object containing the 2 properties
try this:
protected function fecha_desde_inicio():void
     fecha_desde.token =  database.fecha_desde();
     anio= fecha_desde.lastResult.valor1;
     mes = fecha_desde.lastResult.valor2;
     dia = fecha_desde.lastResult.valor3;
     var range:Object = new Object();
     range.rangeStart = new Date(anio,mes,dia);
     range.rangeEnd = new Date (2011,2,1);
     calendario_desde.selectableRange = range;
or this :
protected function fecha_desde_inicio():void
     fecha_desde.token =  database.fecha_desde();
     anio= fecha_desde.lastResult.valor1;
     mes = fecha_desde.lastResult.valor2;
     dia = fecha_desde.lastResult.valor3;
     calendario_desde.selectableRange = {rangeStart : new Date(anio,mes,dia), rangeEnd : new Date(2011,2,1)};

Similar Messages

  • Selecting and Printing Labels from Database

    I have tried to print address labels from a database in which I chose four lines, one of which (a company name) is often blank because there is no information. This line appears as a blank line on the label. Is there a way to eliminate this blank line?
    I am also having trouble selecting records to print. Can you suggest where to look to get help?
    Thank you.

    Hello
    Here is a script I passed last year about this kind of problem.
    I hope that embedded comments would be sufficient because at this time, I am unable to work on such a script.
    --[SCRIPT DB calcToSlideGUI v6]
    Ce script récupère dans un champ une valeur calculée
    et la dépose dans un champ texte classique.
    Cela permet de bénéficier du retour à la ligne automatique
    indisponible pour les champs calculés.
    Si un champ contient des pseudo returns consécutifs,
    ils sont remplacés par un unique pseudo return.
    Si un champ contient des pseudo espaces consécutifs,
    ils sont remplacés par un unique espace.
    La fonction Chercher-Remplacer est utilisée
    pour remplacer ces pseudo return par de VRAIS return.
    Exemple de formule pour concat-calc
    'prénom'&"◊"&'prénom2'&"◊"'nom'&"¶"&'rue1'&"¶"&'rue2'&"¶"&'code'&" "&'city
    • This script grab the value calculated in a field
    and drop it in a simple text field.
    This permit to take benefit of the auto wrap feature
    which is unavailable with calculated fields.
    If a field contains adjacent pseudo returns,
    they are replaced by single ones.
    If a field contains adjacent pseudo spaces,
    they are replaced by a single space.
    The Find-Replace feature is used to replace
    these pseudo returns by TRUE ones.
    Sample formula for concat-calc:
    'firstName'&"◊"&'firstName2'&"◊"&'lastName'&"¶"&'street1'&"¶"&'street2'&"¶"&'co de'&" "&'city'
    Yvan KOENIG, Vallauris (FRANCE)
    27 août 2004
    complété le 31 août
    modifié le 5 décembre
    modifié le 8 décembre
    modifié le 4 février 2005
    property champsRequis : {"concat-calc", "concat-text"}
    (* les noms des deux rubriques manipulées
    vous pouvez modifier ces noms mais PAS leur ordre
    • the names of the two used fields
    you may change them but don’t change the order of them *)
    property french : true (* true = messages français
    • false = english messages *)
    property fauxReturn : ASCII character 166 -- "¶"
    (* use it in the database formula as Return indicator *)
    property fauxEspace : ASCII character 215 -- "◊"
    (* use it in the database formula as Space indicator *)
    property fauxReturn2 : fauxReturn & fauxReturn
    property fauxEspace2 : fauxEspace & fauxEspace
    property msg0 : "" -- globale
    property msg1 : "" -- globale
    property msg2 : "" -- globale
    property msg4 : "" -- globale
    property msg6 : "" -- globale
    property msg7 : "" -- globale
    property msg71 : "" -- globale
    property msg72 : "" -- globale
    property msg81 : "" -- globale
    property msg82 : "" -- globale
    property msg98 : "" -- globale
    property msg99 : "" -- globale
    on run
    try
    if msg0 is "" then my prepareMessages()
    my controlesDivers()
    my modeUtilisation()
    my afficheToutes()
    my preparation()
    set metsReturn to my alimente()
    my pourRemplacer(metsReturn)
    on error MsgErr number NroErr
    if NroErr is not -128 then
    beep 2
    (* «constant afdregfp» est la forme canonique de frontmost application *)
    -- tell application (path to «constant afdregfp» as string)
    tell application (path to frontmost application as string)
    display dialog "" & NroErr & " : " & MsgErr ¬
    buttons {msg99} with icon 0
    end tell -- to application
    end if
    return
    end try
    end run
    -- ================== routines
    on controlesDivers()
    tell application "AppleWorks 6"
    activate
    -- Test version
    if "6." is not in (version as text) then ¬
    error msg0 number 8000
    if (count each document) = 0 then ¬
    error msg1 number 8001
    if (document kind of document 1 ¬
    is not database document) then ¬
    error msg2 number 8002
    select document 1 (* Utile si dialog recherche est au 1er plan
    • Useful if the Search dialog is at front *)
    end tell -- AppleWorks
    end controlesDivers
    -- ==================
    on modeUtilisation()
    tell application "AppleWorks 6"
    tell document 1
    select menu item 1 of menu 5 (* mode Utilisation¬
    • Browse mode *)
    end tell -- to document 1
    end tell -- to AppleWorks
    end modeUtilisation
    -- ==================
    on afficheToutes()
    tell application "AppleWorks 6"
    tell document 1
    select menu item 1 of menu 6 (* Afficher toutes les fiches
    • Show all records *)
    end tell -- to document 1
    end tell -- to AppleWorks
    end afficheToutes
    -- =====================
    on preparation()
    tell application "AppleWorks 6"
    tell document 1
    if (count of records) = 0 then error msg6 number 8006
    set nomsChamps to name of every field
    set {missing, msg8} to {0, ""}
    set cnt_champsRequis to count of champsRequis
    repeat with ky from 1 to cnt_champsRequis
    set Rbrq to (item ky of champsRequis)
    if Rbrq is not in nomsChamps then
    set missing to missing + 1
    set msg8 to msg8 & Rbrq & ", "
    (* construit une chaîne avec les noms des rubriques absentes
    • build a string with the names of missing field(s) *)
    end if
    end repeat
    if missing is not 0 then
    (* prépare un beau message d'erreur
    • build a pretty error message *)
    if missing = 1 then
    set msgmiss to msg7 & msg71 & return & ¬
    msg8 & msg81
    else
    set msgmiss to msg7 & msg72 & return & ¬
    msg8 & msg82 -- pluriels
    end if -- missing = 1
    error msgmiss number 8078
    end if -- missing is not 0
    end tell -- to document 1
    end tell -- to AppleWorks
    end preparation
    -- =====================
    on alimente()
    tell application "AppleWorks 6"
    tell document 1
    set {champSource, champDestination} to champsRequis
    set metsReturn to false
    set nbrec to count of records
    repeat with ky from 1 to nbrec
    set {champky, mets_Return} to ¬
    my slide((value of field champSource of record ky) as text, metsReturn)
    set value of field champDestination of record ky to champky
    end repeat
    end tell -- document 1
    end tell -- Aworks
    return mets_Return
    end alimente
    -- =====================
    on remplace(Texte, avant, apres)
    set AppleScript's text item delimiters to avant
    set aListe to (text items of Texte)
    set AppleScript's text item delimiters to apres
    return (aListe as text)
    end remplace
    -- =====================
    on slide(Texte, mets_Return)
    repeat while Texte contains fauxReturn2
    set Texte to my remplace(Texte, fauxReturn2, fauxReturn)
    end repeat
    repeat while Texte contains fauxEspace2
    set Texte to my remplace(Texte, fauxEspace2, fauxEspace)
    end repeat
    if Texte contains fauxEspace then ¬
    set Texte to my remplace(Texte, fauxEspace, " ")
    set AppleScript's text item delimiters to ""
    if Texte contains fauxReturn then set mets_Return to true
    return {Texte, mets_Return}
    end slide
    -- =====================
    on pourRemplacer(metsReturn)
    if my quelOS() is not less than "1030" then
    (* Mac OS X 10.3 ou plus *)
    if metsReturn is true then ¬
    my chercheRemplaceGUI(fauxReturn, return)
    else
    error msg4 number 8004
    end if -- my quelOS() (GUIdispo)
    end pourRemplacer
    -- ==================
    on chercheRemplaceGUI(avant_, apres_)
    beep 2 (* Attire l'attention *)
    tell application "AppleWorks 6"
    --activate
    select document 1
    tell document 1
    select menu item 1 of menu item 16 of menu 3 (* Rechercher/Remplacer…
    • Find/Replace… *)
    end tell
    set the clipboard to avant_
    paste
    end tell -- to AppleWorks
    tell application "System Events"
    if UI elements enabled then
    tell process "AppleWorks 6"
    keystroke tab
    end tell -- to process
    else
    tell application "System Preferences"
    activate
    set current pane to ¬
    pane "com.apple.preference.universalaccess"
    display dialog msg98
    end tell -- to System Preferences
    end if
    end tell -- to System Events
    tell application "AppleWorks 6"
    set the clipboard to apres_
    paste
    end tell
    tell application "System Events"
    tell process "AppleWorks 6"
    keystroke tab -- back to field "Search"
    end tell -- to process
    end tell -- to System Events
    end chercheRemplaceGUI
    -- =====================
    on quelOS()
    try
    (* «event fndrgstl» = forme canonique de system attribute *)
    -- set hexData to «event fndrgstl» "sysv"
    set hexData to system attribute "sysv"
    set hexString to {}
    repeat 4 times
    set hexString to ((hexData mod 16) as string) & hexString
    set hexData to hexData div 16
    end repeat
    set OS_version to hexString as string
    on error
    set OS_version to "0000"
    (* retournera "0000" si "system attribute" n'est pas reconnu *)
    end try
    return OS_version
    end quelOS
    -- =====================
    on prepareMessages()
    if french is true then
    set msg0 to "Ce script n'est pas compatible" & return & ¬
    "avec cette version d‘AppleWorks." & return & ¬
    "Veuillez utiliser une version 6.0" & return & ¬
    "ou plus récente..."
    set msg1 to "Aucun document ouvert"
    set msg2 to "Ce document n'est pas une base de données."
    set msg4 to "Pensez à remplacer" & return & ¬
    "«" & fauxReturn & "» par «\\p»."
    set msg6 to "Impossible d’exécuter ce script" & return & ¬
    "sur une base vide."
    set msg7 to "Désolé, "
    set msg71 to "la rubrique:"
    set msg72 to "les rubriques:"
    set msg81 to "est absente."
    set msg82 to "sont absentes."
    set msg98 to "Le scriptage des éléments d’interface est désactivé. " & ¬
    "Cochez «Activez l’accès pour les périphériques d’aide»"
    set msg99 to " Vu "
    else
    set msg0 to "This script is not compatible" & return & ¬
    "with this version of AppleWorks." & return & ¬
    "Please use version 6.0" & return & "or higher..."
    set msg1 to "No open doc"
    set msg2 to "This document is not a database."
    set msg4 to "CAUTION, don’t forget to replace" & ¬
    "“" & fauxReturn & "” by “\\p."
    set msg6 to "Can’t apply this script" & return & ¬
    "on an empty DB."
    set msg7 to "Oops, the field"
    set msg71 to ":"
    set msg72 to "s:"
    set msg81 to "is missing."
    set msg82 to "are missing."
    set msg98 to "UI element scripting is not enabled. " & ¬
    "Check “Enable access for assistive devices”"
    set msg99 to " Oops "
    end if
    end prepareMessages
    --[/SCRIPT]
    Yvan KOENIG (from FRANCE jeudi 15 juin 2006 09:07:25)

  • Processing selected range of record from a flat file.

    Hi,
    I am having a requirement like, I have a flat file as source with large number of records and oracle table as target. But i will be using 3 interfaces to process those records.
    Each interface will process 100 records. How to achieve this part? How to count records and add filter to the source so that I can achieve this part?
    Thanks.
    Regards.

    Yes. I assume that the header lines and the lines with the data are formatted differently. If so, you can process the file a line at a time and use a regualr expression to match the data lines. If the regular expression matches use that line. If it doesn't match then simply ignore that line of text.
    You can either read the file a line at a time or read the entire file and process the text a line at a time. If you may be processing large files I recommend reading the file a line at a time. Reading very large files in one read can be very slow. Reading the same file in chunks will be much faster.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Selecting a range of data from a file

    Is it possible to only display a selected range of data from a binary file? I can read in my binary files but I would like to only send data within a user defineable range to the data portal for viewing. This range may be over multiple binary files also. I can concatenate these files already but I need to select a range to insert into the data portal.
    Thanks,
    AJL

    OK AJL,
    This sounds good. It's convenient to have the start and stop time of each segment file in the name of that file. By the way, you want to check that in the DataPlugin and "Call RaiseError()" if the data file is not named that way, otherwise you will try to read DIAdem *.DAT files with your custom DataPlugin. DIAdem will try each DataPlugin that is registered with the file's extension (i.e. *.DAT) one after the other, until one of them does not give an error. So you should always check for some identifying characteristic in your data file and "Call RaiseError()" if you don't find it, in order to abort DIAdem using that DataPlugin for files it was never intended for.
    Now to your point. How do you know which series of segment files to read from? Does your VBScript ask the user to select a particular directory that contains all these segment files? I'm going to assume so. My recommendation is that your VBScript also create a time slice configuration file in that directory that contains the information about the time slice you want to read in (start and stop times). Then your DataPlugin can look for that file name in the directory passed to it-- if it finds none it will just load the file path it was passed outright, but if it does find the time slice file it will load any and all *.DAT files in that same directory which correspond to that time slice. This includes loading only parts of one or more of the existing binary files.
    It is straightforward enough to pick out the section of the binary file you want to load with the DataPlugin, once you know the time slice information inside the DataPlugin's callback. Use the File.Position property to move the file cursor to the position of the first data point in the time slice, and use the Block.BlockLength property to specify the number of values to read in each of the channels from that starting point (to exclude the values after the desired time slice). I assume that your binary data is stored interleaved and that you are using DirectAccessChannels to read the values in your DataPlugin.
    Finally, for time slices that span multiple segment files, you will need to load these to separate groups in the Data Portal with the DataPlugin. Then the VBScript can consolidate these channels into long concatenated channels in a new group and delete the temporary segmented groups. In a future version of DIAdem the DataPlugin API will have the ability to do this mapping for you, but not yet. I also have VBScripts that do this concatenation already-- you can download them from www.ni.com/support/diasupp. They're designed for concatenating channels from multiple ASCII/Excel/DAT files.
    Let me know what else you need,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • JDBC adapter missed data from database

    Hello Experts
    We have a repeatative issues in JDBC sender adapter .While it is reading data from database sometimes we are facing the problem tat all the data is not read by adapter but PI read date is generated for all the records.
    Some times the issue happened like PI processed first three and last three data but missed 2-3 records from the middle portion.
    Please help me to know the reason for this error and how to resolve this types of error.
    Thanks in advance .
    Somenath

    Hello Stefan ,
    Thanks a lot for your reply .
    We have used the below  Select and update statement
    I am not expert in select query .Please suggest if the query is okay or it can be the error.
    SELECT * FROM [database].[dbo].[table]  WHERE [Delivery_Number] = (SELECT TOP 1 [Delivery_Number] FROM [database].[dbo].[table] where [PI_Read_Date] IS NULL ORDER BY [Delivery_Number] ASC) AND [PI_Read_Date] IS NULL ORDER BY [Transaction_ID] ASC
    UPDATE [database].[dbo].[table] SET [PI_Read_Date] = getdate() WHERE [Transaction_ID] in ( SELECT [Transaction_ID] FROM [database].[dbo].[table] WHERE [Delivery_Number] = (SELECT TOP 1 [Delivery_Number] FROM [database].[dbo].[table] where [PI_Read_Date] IS NULL) AND [PI_Read_Date] IS NULL)
    Please let me know what new features we can get if we set the the advanced parameter serializable.
    Hello Navin,
    We are using toad at data base side .If the lock occurs in the database side is it possible to generate tHe PI read date as the data is not read by PI?
    Thank you once again for you help.
    BR.
    somenath

  • Populate Datagrid from database

    Using Adobe Flex Builder 3 Beta 2, I have successfully used
    the Data Source Explorer window to connect to the Northwind and
    Pubs database on my SQL 2005 server. I can see the schemas and
    tables, etc. I understand that currently I cannot simply drag and
    drop the fields into the datagrid (which would be nice) so how do I
    'wire up' a table to the data grid? Is there an example which you
    can refer me to (with source) that would explain that? I've
    successfully wired up a webservice, but not to a database listed in
    the Data Source Explorer. If there were an example that showed a
    CRUD data grid, that would help.

    Just to give you an update as to where I am and where I'm
    hung up, I was able to make a little bit of progress but not too
    far.
    1. I created a Flex Project (Web application) and specify
    Applcation Server Type: ASP.net.
    2. Next, I have the choice of specifying 'Use ASP .NET
    Development Server' or 'Use Internet Information Services (IIS). At
    the 'Usa ASP .NET Development Server', the error message at the top
    of this wizard window says (X) You don't have ASP .NET Development
    Server Installed. [Well, it may not be running but I do have it
    installed as part of the .NET 2.0 Framework.. it does exist]. So,
    because of the error, I have no choice but to use the alternate
    option, 'Use Internet Information Services (IIS).
    3. I specify my Web Application Root: d:\Flex3
    Projects\TestProj3 (I manually have to create the folder).
    4. I speciy my Web Application URL:
    http://localhost
    5. I click the Finish button.
    Note... I've already selected my Connectivity using the Data
    Source Explorer (which is available by selecting the following in
    Flex Builder: Windows, Otherviews, Connectivity, Data Source
    Explorer, and then adding in a database connection at my MS SQL
    2005 server, specifying username and password).
    6. Next, from Flex Builder, I select: Data, Create
    Application from Database, and specify the current project,
    connection (in my case, Northwind) and the employee table, etc. I
    click NEXT.
    7. I can select C# with web services or Visual Basic with Web
    Services, so I select Visual Basic.
    8. Select Finish.
    OK at this point, a lot of code (action script, webservices,
    etc. is auto-generated for me - kewl.. just like Dreamweaver :-)
    Now I'm ready to run the application.
    But wait - I know it won't run because I note that the ASP
    .NET Development Server is not running. However - I can start it
    from the windows command line.
    First thing I do is stop my local IIS server which is using
    Port 80.
    Next thing I do is open a windows command line and navigate
    to my .Net 2.0 Framework directory:
    cd \WINDOWS\Microsoft.NET\Framework\v2.0.50727
    and then I run the ASP .NET Web server at the same path that
    my application (above) is written to (again, typed in the command
    line window).
    start /b webdev.webserver /port:80 /path:"D:\Flex3
    Projects\TestProj3\bin"
    Finally, from the Flex Builder window, I right-click on the
    auto-build Employee.mxml table and select 'Run application'.
    After a few moments an Internet Explorer window comes up. I
    believe it says:
    http://localhost/bin/Employees.html
    and I change it to read:
    http://localhost/Employees.html
    and it runs.. well it runs, but with 'An unexpected error
    occured and it has been logged.'
    So that's as far as I have gotten but it does write the code.
    So am I to assume that whether I do this by hand or use the
    'auto-generated code' that I will be using WebServices to read and
    write from the MS SQL 2005 database?
    I would much rather my Flex Application open a connection to
    the database directly and send SQL statements. I'm guessing that
    might not be possible without some driver? Perhaps thats were Adobe
    Live Cycle comes in?
    Any insight (frm anyone) would be helpful. Thank you.

  • To select from database table based on date range

    hi
    i have a selection screen in which date range is being given
    say eg 23/06/07  to 23/12/08
    based on this date i want to select data from a ztable
    eg i want to select a field amount from table
    and three is a field date range on the table
    for this particular field i want to select all records for amount field  and factual field falling wiithing this date range and sum it
    eg
    based on date range as in selcetion screen
    select amount( field1)  factual ( field2) from ztable into it_ztable where date = ?....
    please give me code for it  and how to sum all values as i will get from the ztable into internal table the two values as fetched from the ztable
    please suggest asap
    regards
    arora

    hi
    i am using
    sELECT field1 field2 FROM Ztable  INto it_matu
                       where DATE GE sl_dat-low    
                        AND  DATE LE sl_dat-high.   
    i am getting data in internal table but
    say i have twelve records now i want to sum it the both the columns into and use that sum final amount to display
    let me know how to use sume in the intrranal tabl do i need to use control statement
    how to use the sum for two columns and take into a serperate variable to display
    regards
    aRora

  • How to select rows from database like 10 to 20 etc

    Hi Experts,
    I want to select rows from database like row number 10 to row number 20.How could it be done?

    HI,
       First get the data into the INTERNAL TABLE from the FLAT FILE and read the internal table using the index.
        ex: 1) Read table ITAB index 10.
              2) Read table ITAB index 20.
    or use as said by  Srinivas Gurram, to get the range of records using where condition to the loop.
    <REMOVED BY MODERATOR>
    Edited by: Ravi Kumar on Jun 9, 2008 4:01 PM
    Edited by: Alvaro Tejada Galindo on Jun 9, 2008 3:16 PM

  • Select data from DataBase

    Hi;
    I try to select data from DataBase, But I get the following error, Could anyone help? thanks.
    Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.
    OracleDriver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at Lookup.main(Lookup.java:12)
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class Lookup {
        public static void main(String[] args)
            throws SQLException, ClassNotFoundException {
            String dbUrl = "jdbc:oracle:thin:@augur.scms.waikato.ac.nz:1521:comp319";
            String user = "group029";
            String password = "group029";
            // Load the driver (registers itself)
            Class.forName("oracle.jdbc.driver.OracleDriver");
            Connection c = DriverManager.getConnection(dbUrl, user, password);
            Statement s = c.createStatement();
            //SQL code:
            ResultSet r =
                s.executeQuery("SELECT * " +"FROM movie");
         StringBuffer results= new StringBuffer();
            ResultSetMetaData metaData = r.getMetaData();
         int numberOfColumns = metaData.getColumnCount();
         for(int i=1; i<=numberOfColumns; i++)
             results.append(metaData.getColumnName(i)+"\t");
         results.append("\n");
         while (r.next()){
             for( int i=1; i <=numberOfColumns; i++)
              results.append(r.getObject(i)+"\t");
             results.append("\n");
         s.close();
    }

    It's a classpath problem. Either you mistyped the class name, or you don't have the class in your classpath. I think Oracle's drivers come in db12.zip or db12.jar or some such. Whatever that jar or zip file is, it has to be in your classpath, but it's not.
    Or it is in your classpath, but you're in an appserver context where the classloader that the container provides for your app uses something other than the classpath variable. For instance, in tomcat, the jar file would be uder webapps/yourApplication/WEB-INF/lib I think.

  • Selecting the last record from a database table

    In my ABAP Program, I have to use a select statement to retrieve the last record from the database table with the same key.  In other words, the Program will get more than one hit on the database table for the selected keys and I need to retrieve values from only the last record and not the first.  I know I can use an internal table to sort the records first and then retrieve the right value.   But to make things easier, is there a SELECT statement keyword than I can use to do this in one single step?  Thanks!

    hi,
    tables:mara.
        data: begin of it_mara occurs 0,
                matnr like mara-matnr,
                meins like mara-meins,
                mtart like mara-mtart,
                end of it_mara.
    select-options:s_matnr for mara-matnr.
    select matnr
              meins
              mtart
    from mara
    into table it_mara
    where matnr in s_matnr.
    if not it_mara[] is initial.
    sort it_mara by matnr descending.
    read table it_mara index 1.
    endif.
    then you get the last record of the select statement.
    reward points if useful,
    venkat.

  • Select list in JSP (Options from database)

    I am developing a web application on struts.
    I am having problem with my JSP.
    I have a form from where users input the keywords for search
    and when they click on a database query is performed and
    result is shown on the screen.
    Where i am stuck is that in the display screen, i wanna have one
    set of result in the drop down list (same as select in html).
    If the result from the database search is 1 i want the first option of
    select to be Yes and if its 0 then i want the first option of select to be
    No.
    what i have in JSP is following
    <select name="attt" size="2"><option value="<bean:write name="sList" property="att"/>">Yes
    <option value="<bean:write name="sList" property="att"/>">No
    Where I am stuck is that I dont know where to perform whether the
    result from database is 1 or not. Can someboday help me on how
    to solve this or get this done? Am i right so far?
    thanx in advance

    The best I could come up with was to use the second layout I mention and then add some Javascript on the page to do something like
    <style type="text/css">
    label.l {position:absolute;top:100px;left:210px;}
    input.i {position:absolute;top:100px;left:200px;}
    </style>
    <script type="text/javascript">
    var f=$x('P1_RADIO');
    var l=f.getElementsByTagName('label')[1];
    var i=f.getElementsByTagName('input')[1];
    l.className += "l";
    i.className += "i";
    </script>Basically, it takes that "Radiogroup Option 2" and the form input field and uses absolute CSS positioning to place it to the right of the Select list.
    Works great in FF (as usual), but the usual IE inconsistencies with CSS box model rear their ugly head. Looks terrible in IE, totally mis-aligned.
    Any other ideas?
    Thanks

  • Urgent......  how to select few fields, from database table, (dynamic ita.)

    Dear all experts,
    I am able to populate all fields data from database table, using dynamic table creation.
    eg,
    SELECT *    FROM (w_tabname)    INTO    TABLE <t_itab>.
    where w_tabname is the table name given by the user, and t_itab is field symbol.
    but some requirement is like that i need to pick up only few fields, <b>which user will give at the runtime.</b>
    <b>I can</b> take those fields from file into any internal table,
    but the problem is that instead of <b>select *</b>, i need to put selected the fields given by user.
    i have tried with field symbol, it is not working (as per my knowledge.)
    do i need to create any structures dynamically ?
    Can anybody please help in this regards ?
    Your help will be surely rewarded with points.
    Waiting for reply..
    Regards
    Vinay

    Hi Vinay ,
    Adding to the below code , you can use some more fields in the select stmt as below:-
    REPORT ychatest.
    PARAMETERS : p_field1 LIKE dd03l-fieldname,
                             P_field2 LIKE dd03l-fieldname,
                             p_table LIKE dd03l-tabname.
    FIELD-SYMBOLS : <fs> TYPE STANDARD TABLE.
    SELECT (p_field1) (p_field2) ( FROM (p_table) INTO TABLE <fs>.
    Now p_field1 & p_field2  belong to the same table since you have give the user to enter only one table name.
    This should work fine.
    please try & let me know .
    Thanks & Regards,
    Daniel

  • LTR - Error occurred when selecting from database

    Hi,
    We created couple of configurations using LTRC in our SLT systems. When i try to check these in transaction LTR, they are not displayed, just getting the error - Error occurred when selecting from database (Attached screenshot). All the required SICF for SLT has already been activated. Any suggestions how to fix this issue?
    Thanks,
    Saravanan

    Hi Experts,
    Did anybody get the solution of this error ,if yes please reply?
    I am getting below error when I am refreshing the current config or creating a new one in LTR
    " Error occurred when selecting from database"
    Thanks for your help,
    Balwant

  • Exporting selected range only from Excel / Calc

    Hi,
    I would like to know if it is possible to create a PDF that contains only a selected range of cells, when working in MS Excel or OO.o Calc.
    I don't mean just checking the Print only Selection option -- that prints those cells, but into a letter-sized PDF.
    What I would like to do is to have the selection and only the selection - with no surrounding white space (except perhaps a small margin) - in the PDF. That is, the PDF would be resized to match the dimensions of the selection.
    I guess what I have in mind is similar what you would get if you created the PDF as usual, then cropped out the surrounding white space - but done automatically.
    Many thanks in advance.
    PS - I am using Adobe Acrobat 9.3 with MS Office 2007 or OO.o 3.2 on Windows 7.

    I'm not sure this is relevant but I mistakenly wrote above that I was using Excel 2007. Actually, it's Excel from Office 2010 Beta. However, I remember trying this as well in Office 2007 so I don't think that's related.

  • Select only numbers from database

    Hi All,
    I need to retrieve numerical data's from the database. Data base table has both numerical and text values. now I want to retrieve only numerical data's.
    Can any one help me on this,
    Thanks and helps will be appreciated.

    Hi,
    did you try like this ?
    SELECT * FROM database INTO t_inter WHERE field1 = crit1.
    LOOP AT t_inter into w_intern WHERE field1 CO '0123456789'.
    ENDLOOP.
    or
    LOOP AT t_inter into w_intern.
    CHECK w_intern-field1 CO '0123456789'
    ENDLOOP.
    Regards,
    David

Maybe you are looking for