Deriving specific Date Fields

I am getting a date field from my source and it can be anywhere between 8 to 10 characters i.e M/D/YYYY or MM/D/YYYY or M/DD/YYYY or MM/DD/YYYY.
My Target object is 0DATE and for the case MM/DD/YYYY i am using the following routine and it works,
CONCATENATE SOURCE_FIELDS-/BIC/ZTIME+6(4)
  SOURCE_FIELDS-/BIC/ZTIME+0(2)
  SOURCE_FIELDS-/BIC/ZTIME+3(2) INTO RESULT.
How can I incorporate the other scenarios.
Thanks
Rashmi.

Hi Rahty,
I have coded this but its giving me an error in the format. The input date is 10/7/2008 and the output is coming       
      as 7 .00.0081.
This is the code i have written,
DATA: DAY TYPE /BIC/PZOBJ_ID-/BIC/ZBPCODE.
DATA: MONTH TYPE /BIC/PZOBJ_ID-/BIC/ZBPCODE.
IF SOURCE_FIELDS-/BIC/ZTIME+1(1) ='/'.
CONCATENATE '0' SOURCE_FIELDS-/BIC/ZTIME+0(1) INTO MONTH.
IF SOURCE_FIELDS-/BIC/ZTIME+4(1) ='/'.
CONCATENATE '0' SOURCE_FIELDS-/BIC/ZTIME+0(1) INTO DAY.
IF SOURCE_FIELDS-/BIC/ZTIME+3(1) ='/'.
CONCATENATE '0' SOURCE_FIELDS-/BIC/ZTIME+2(1) INTO DAY.
ELSE.
DAY = SOURCE_FIELDS-/BIC/ZTIME+2(2).
ENDIF.
ENDIF.
ELSE.
MONTH = SOURCE_FIELDS-/BIC/ZTIME+0(2).
IF SOURCE_FIELDS-/BIC/ZTIME+4(1) ='/'.
CONCATENATE '0' SOURCE_FIELDS-/BIC/ZTIME+3(1) INTO DAY.
ELSE.
DAY = SOURCE_FIELDS-/BIC/ZTIME+3(2).
ENDIF.
ENDIF.
CONCATENATE SOURCE_FIELDS-/BIC/ZTIME+6(4)
MONTH DAY INTO RESULT.
Could you please help
Thanks
Rashmi.

Similar Messages

  • Create Multiple Signature and Date fields with a custom Toolbar Button

    First off, thanks in advance!  I am a scripting newbie and I am trudging my way through with very little experience with scripting of any kind.  I am good at taking other's scripts and forming them into something I need, but I can't seem to find anything to do what I want.
    Using Adobe Acrobat X, I am trying to create a toolbar button that I can press to create multiple signature and date fields with predetermined locations.
    Below is the script I have that is working to create just a single signature box, but I can't seem to figure out the exact syntax to have that same button create multiple fields.  In total it is 9 signature fields and 9 date fields need to be created.  If you can just give me an example of what the button would look like with multiple scripts?  I was assuming I would set up multiple variables and then in the cExec property of the toolbar button I could just call out all of those variables? 
    var sigswm = "addField('sigSWM', 'signature', '0', [108, 198, 494.64, 72])"
    app.addToolButton({cName: "dotbutton", cExec: sigswm, cLabel: "Place Signature and Date Blocks",});
    Thanks in advance for any help you can provide.
    Billy Sweeney

    Thanks!  That was probably the only thing I didn't try.
    I do have one more question.  What I want is when the signature field is clicked it fills out a specific date field. I beleive the script I want would be:
    var currentTime = new Date()
        var month = currentTime.getMonth() + 1
        var day = currentTime.getDate()
        var year = currentTime.getFullYear()
        var signingTime = day +"/"+month+"/"+year
        var f = this.getField("dateSWM"); 
        f.value = signingTime;
    I found this on another thread that mentioned it could be placed in the Signed tab of the signature properties dialog.  I am assuming it would be placed in my button script file as a setAction script for each signature, but I am not real sure exactly where or how?

  • Exporting one specific pdf form field data to a specific webpage field

    Hello there.
    I am currently creating a form in which I need to export one specific pdf form field data to a specific webpage field to avoid typing it again or hitting ctrl+c and then ctrl+v to the webpage, as there are several records that need to be copied and pasted.
    I read that there is no access to the clipboard within pdf therefore, would like to know if there is any way to do that without accessing the clipboard.
    I am a newbie and have been learning by searching the forums and Google, therefore, would appreciate any insight on whether or not this is possible using javascript or the "submit form" funcion.
    Any help is greatly appreciated!

    Hi George, thanks for your response!
    The main issue I have is that this web page is in fact a government page in which I have to manually copy and paste information.
    I have no idea how to automate this process - I have access to the scripts on the page to see what I am able to do, but since I do not have much experience (only very basic javascripting), any other insight would be great!

  • Incrementing Date field in Variable based on a specific calendar

    Hello All,
        I am currently setting up a schedule that includes Mass activities. I am running into a problem when i want a particular date field an activity to increment by one day based on a specific calendar i.e. Factory calendar (M-F open).
    EX)
    The due date field for on any given day the mass activity runs should be system date plus 2 business days.
    While the posting date field on the same transaction should increment by 2 day.
    Result would be:
    On System date = 02/17/11
    Due Date Field = 02/21/11
    Posting Date = 02/19/11
    I am currently using expression similiar to this: =Time.expression(Time.now('GMT'), 'add 2 days') but cannot find documentation how to include calendars in this as you would with =Time.isTimeWindowOpen(Time.now('GMT'), 'Factory Calendar').
    Can someone please point me in right direction?
    Thanks
    Dan

    Hi Gerben,
       I tried this and it yielded unacceptable(expected) results. Here is why i think this is the case.
    =Time.expression(Time.nextTimeWindowOpening(Time.now('America/Regina'), 'System_Week_WorkDays'), 'add 7 days') suppose to only be open m-f
    Time.now() should evaluate to today lets say 02/21/11
    then Time.nextTimeWindowOpening should return the next open day, after but including today, it checks and finds today is open so = 02/21/11
    and the time expression will add n= 7 days to that. 02/21/11 + 7 = 02/28/11 this is wrong.
    According to this calendar it should be 03/01/11
    Problem is that the add function is just adding n days indiscriminate of the calendar as the calendar is not part of the addition argument.
    Edited by: Daniel Austin on Feb 21, 2011 9:31 PM

  • Deriving Time Characteristics from Date fields in ODS View

    Hi,
    I am creating ODS Views using HANA calculation views.
    is there any direct approach to derive time characteristics like cal week, cal quarter, cal month, calmonth 2, fiscal year, cal year etc from date fields?
    work around:
    Deriving them in HANA view in calculated columns and mapping them to IO created with respective time characteristics as reference.
    is there any standard and easy to use approach for this??
    Thanks in advance.

    Hi Ravi,
    Insteod deriving them in the ODS view you can derive them in tha Calculation View in SAP HANA itself using Time Dimention concept.
    Regards
    Jagan

  • How to create a Date field with specific date limitations

    Hello, im new to creating forms in Acrobat.
    My question is, how do i create a date field and at the same time have a restriction on which dates to put.
    ie; i want the date field to only enter dates from Jan 01 2015 - Dec 31 2015.
    Thanks for your help.

    Thanks!
    I tried and it worked.
    but what are these numbers after the 2015?
    var minDate = new Date(2015, 0, 1, 0, 0, 0, 0); 
    var maxDate = new Date(2015, 11, 31, 23, 59, 59, 999); 

  • Query the date field for specific time

    I need to be able to run a query on a date field that retrieves specified times.
    Any ideas???

    You could do something like
    SELECT *
      FROM someTable
    WHERE to_char(date_column, 'HH24:MI:SS') = '17:01:04';Justin

  • Count of fields for a specific date

    Hi.
    I have a report that is running on parameter field of  date range.  I have the report grouped by that same date range.  The dates showing up on my report are payroll dates.  So since there are two payrolls in one month I see both.  For example:
    5/8
    5/18
    I then have another group below the above date for "Type" of check "amount" and "count".  So the report looks something like this when I run it:
    5/8
    Type#1      $5000.00               / 100 people
    Type #2 -   $6000.00              / 85 people
    5/18
    Type#1       $5300              /102 people
    Type#2       $6600             /60 people
    Grand Total:                     $22900
    So far, everything works great and this is all good.
    I now want to add two fields to the report (without changing my main report data (above) and since the fields are from the same table, I created a subreport for each field.  I have an "added to payroll date" and a "taken off payroll date" field.  And since I just want a count per payroll date of the number of people added/taken away, I created a subreport for each date (they exist in the same table).
    I linked the subreports to the main report by checkdate since that is what it is grouped on... and I did a "count" formula to provide me with the count of people. (I also added a group to the subreports so the records are grouped by checkdate.
    The total number for MAY is correct, but it is not putting the correct # of added and taken off in the respective check date?
    Confused yet?
    Its doing this:
    5/8             added 50 / taken away 60
    Type#1      $5000.00               / 100 people
    Type #2 -   $6000.00              / 85 people
    5/18         added 100/taken away 20
    Type#1       $5300              /102 people
    Type#2       $6600             /60 people
    Grand Total:                     $22900
    The total # of Added "150" in this example is correct, but it is distributed incorrectly... same for the taken away.  What am I doing wrong?
    Also, can anyone think of another way of doing this outside of the two subreports I just created since my report runs really really slow now?
    Your help is much appreciated
    Thanks
    Using Crystal-8

    Please re-post if this is still an issue

  • Date Field in Hierarchical ALV

    Hello Friends,
    I have a few fields in my Hierarchical ALV output which are initially hidden.
    When I choose to display these fields by changing the Layout the date fields come out in the form
    MMDDYYYY
    I need those fields as 
    MM/DD/YYYY
    The date fields which are NOT hidden initially  are in the format MM/DD/YYYY. No problem there.
    When I go to settings and choose column width optimize I am then able to see these date fields as MM/DD/YYYY.
    In My code I already set this col width to optimize. It is also working . But for fields which are hidden initially I have to explicitly set the width optimize again .
    This problem is not there in GRID ALV.
    Why is the HIER ALV not putting the date fields in MM/DD/YYYY format.

    Hi,
    Just pass the Edit option of the fieldcatalog for those specific fields...
    fcat-edit = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-cprog
          i_callback_pf_status_set = 'PF_STATUS_SET'
          i_callback_user_command  = 'USER_COMMAND'    "<----  pass this
          i_callback_top_of_page   = 'TOP'
          is_layout                = it_layout
          it_fieldcat              = it_fcat
          i_default                = 'X'
          i_save                   = 'A'
          it_events                = it_event
        TABLES
          t_outtab                 = it_final
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    *&      Form  USER_COMMAND
    *       text
    *      -->R_UCOMM      text
    *      -->RS_SELFIELD  text
    FORM user_command USING r_ucomm LIKE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&DATA_SAVE'.                "<-------check this
          PERFORM save_data.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND

  • Is it possible to change the way SAP stores a DATE field ?

    Hi,
    I have a scenario here where I have to read from a file and then upload the contents to a custom table.
    The file is comprised of several lines, each line being formatted to accomodate several fields, according to their length specifications. It's the "standard" string style to import/export files from one system to another.
    My question is: one of these fields is a date field, and I am required to order the table, afterwards, by this date field. I notice it comes as DDMMYYYY, and my SORT is not working. If I use, on the other hand, dates in YYYYMMDD format, the SORT works perfectly.
    Does SAP expects the date to come as YYYYMMDD ? Is there a way I can change this "default" format ?
    Thanks,
    Avraham

    Hi,
    Yes, SAP expects the date to come as YYYYMMDD, this is the internal format.
    I am not sure you will be able to change the default DATS format to something else.
    Other internal date format : GDATU as in table TCURF.
    Sugestion : use offsets to convert original date to internal date format and keep doing your SORT as you already did.
    Hope this will help you find de good solution.
    Issa

  • Date fields in the Maintainence View.

    Hello friends,
                   I created a maintanence view which of 2 steps. This view contains a DATE field of data element type 'DATS". Now the problem is -"
    1. In the first screen  of the viewI am not able to see only the DATE field(Over view scr).
    2. But I able to see the same field in the 2nd screen(Maintanence Screen).
    Not only to my View I maintained ' Table Maintanence Generator" to some more tables.There also I am not able to see the date field in the first screen, unless it is a key field.
    Thanks in advance.

    Hi
    Step 1: Create & Maintain Table (SE11)
    Screen 101: ABAP Dictionary: Initial Screen
    Screen 102: Maintain Table -> Delivery and Maintenance
    Screen 103: Maintain Table -> Fields
    [] SE11: Enter Table Name -> Create
    Enter Table Description (Mandatory Field)
    Select Delivery Class
    Set maintenance level
    Enter Fields, Assign Data Elements
    Save Entries
    Check Inconsistencies
    Activate Table
    Go To Technical Settings (SCREEN 104)
    Delivery Class: The delivery class controls the transport of table data when
    installing or upgrading, in a client copy and when transporting between customer
    systems. The delivery class is also used in the extended table
    maintenance.
    There are the following delivery classes:
    A: Application table (master and transaction data).
    C: Customer table, data is maintained by the customer only.
    L: Table for storing temporary data.
    G: Customer table. The customer namespace must be defined in table TRESC. (Use
    Report RDDKOR54 here).
    E: System table with its own namespaces for customer entries.
    S: System table, data changes have the same status as program changes.
    W: System table (e.g. table of the development environment) whose
    data is transported with its own transport objects (e.g. R3TR PROG, R3TR TABL,
    etc.).
    Data Browser/Table View Maint.: This indicator specifies
    whether it is possible to display/maintain a table or view using the maintenance
    tools Data Browser (transaction SE16) and table view maintenance (transactions
    SM30 and SM31).
    MANDT field is mandatory for Client dependant tables
    Technical Settings: The technical settings control, for example, table buffering.
    Indexes: To speed up data selection, you can create secondary indexes for the table
    Append Structure: Append structures are used for enhancements that are not included in the standard.
    Screen 104: Maintain Technical Settings
    Select Data Class (Mandatory) [APPL0]
    Select Size Category (Table size - No. of records - Mandatory) [1 to 6]
    Specify Buffering [allowed / not allowed]
    Save
    Check Inconsistencies
    Activate & Go Back to “Maintain Table Screen”
    Data Class: The data class defines the physical area of the database (for ORACLE
    the TABLESPACE) in which your table is logically stored. If you choose a data
    class correctly, your table will automatically be assigned to the correct area
    when it is created on the database.
    The most important data classes
    are (other than the system data):
    APPL0 Master data
    APPL1 Transaction data
    APPL2 Organizational and customizing data
    Size category: The size category determines the probable space requirement for a table in the database.
    Buffering: The buffering status specifies whether or not a table may be buffered.
    Screen 105: Maintain Table
    Screen 106: Maintain Enhancement Category (ECC 6.0 onwards)
    -> Extras -> Enhancement Category
    Select Enhancement Category
    Enhancement Category: Structures and tables that were defined by SAP in the ABAP
    Dictionary can be enhanced subsequently by customers using Customizing includes
    or append structures. The enhancements do not only refer to structures/ tables
    themselves, but also to dependent structures that adopt the enhancement as an
    include or referenced structure. Append structures that only take effect at the
    end of the original structure can also cause shifts - in the case of dependent
    structures - even within these structures.
    Screen 107: Maintain Table -> Table Maintenance Generator
    Screen 108: Generate Table Maintenance Dialog: Generation Environment
    -> Utilities -> Table Maintenance Generator OR [] SE54
    Specify Authorization Group [&NC&]
    Select Maintenance type [One Step/Two Step]
    Mention Screen Numbers [1/2]
    Save & Go Back
    Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.

  • How to add a mm-dd-yyyy date field type in a Planning Data Form

    Hi John,
    pls, I have one question regarding the possibility of adding a date field type for example 03-03-2009 in a cell of Planning Data Form application.
    for example, I created:
    - 2 members in Period dimension: StartProject and EndProject and I need to enter and track date for these fields;
    - one Account member called Project;
    - and a simple form with these collumns and row;
    Trying different settings for my members - seems that I cannot input date in the cell and rcvd errror: "you have entered invalid value".
    Pls, can you confirm me if it's possible to enter date type in a form?
    If yes, what is the specific setup for the Account and Period properties: Data storage, Time Balance, Data type, Account type etc
    many thanks,
    Robert

    Many thanks John!!! that's it!!!
    I had to change it in Data Type evaluation Order because I'm using EPMA and it's working now!!
    Thanks again!!!
    Rgds,
    Robert

  • How can I use Automator to extract specific Data from a text file?

    I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
    How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
    Example of File Contents:
    Link Time =
    DD/MMM/YYYY
    Random
    Text
    161 179
    bytes of CODE    memory (+                68 range fill )
    16 789
    bytes of DATA    memory (+    59 absolute )
    1 875
    bytes of XDATA   memory (+ 1 855 absolute )
    90 783
    bytes of FARCODE memory
    What I would like to have as a final file:
    EXCEL COLUMN1
    Column 2
    Column3
    Column4
    Column5
    Column6
    MM/DD/YYYY
    filename1
    161179
    16789
    1875
    90783
    MM/DD/YYYY
    filename2
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    MM/DD/YYYY
    filename3
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!

    Hello
    You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
    set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
    use strict;
    use open IN => ':crlf';
    chdir $ARGV[0] or die qq($!);
    local $/ = qq(\\0);
    my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
    local $/ = qq(\\n);
    #     CSV spec
    #     - record separator is CRLF
    #     - field separator is comma
    #     - every field is quoted
    #     - text encoding is UTF-8
    local $\\ = qq(\\015\\012);    # CRLF
    local $, = qq(,);            # COMMA
    # print column header row
    my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
    print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    # print data row per each file
    while (@ff) {
        my $f = shift @ff;    # file path
        if ( ! open(IN, '<', $f) ) {
            warn qq(Failed to open $f: $!);
            next;
        $f =~ s%^.*/%%og;    # file name
        @dd = ('', $f, '', '', '', '');
        while (<IN>) {
            chomp;
            $dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
            ($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
            ($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
            ($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
            ($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
            last unless grep { /^$/ } @dd;
        close IN;
        print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    EOF
    Hope this may help,
    H

  • Editable ALV - how to throw an error message for a specific line & field

    Hi all,
    I've implemented an editable ALV and also the ON_DATA_CHECK event to check the values, entered in the ALV. So this works fine and I can check the values.
    But now, I want to throw an error message corresponding to the field in the ALV, where the error occured.
    How can I throw this error message corresponding to a specific line/field in the ALV?
    I was using REPORT_ATTRIBUTE_ERROR_MESSAGE and REPORT_ELEMENT_ERROR_MESSAGE but without success.
    I'm also using a loop over the "CHANGES" in the ALV and within this loop, I use
    elem_alv = node_alv->get_element( index = <change>-element_index ) 
    to get the element for the message.
    CALL METHOD lo_message_manager->REPORT_ELEMENT_ERROR_MESSAGE
      EXPORTING
        MESSAGE_TEXT              = 'my message'
        ELEMENT                   = elem_alv
    *    ATTRIBUTES                =
    *    PARAMS                    =
    *    MSG_USER_DATA             =
    *    IS_PERMANENT              = ABAP_FALSE
    *    SCOPE_PERMANENT_MSG       = CO_MSG_SCOPE_CTXT_ELEMENT
    *    MSG_INDEX                 =
    *    CANCEL_NAVIGATION         =
    *    IS_VALIDATION_INDEPENDENT = ABAP_FALSE.
    2.) is it right, that for an editable ALV, I can't use the WDDOBEFOREACTION to do the checks?
    If I try to use this, I can't get the values of my ALV table to check it.
    Thanks,
    Andreas

    Hi Andreas,
    I have tried to replicate your problem and I am getting the desired output. I have a row by name TEMP_NEW in my ALV and I want to throw an error message whenever the user enters a value of 4 for that particular field. Please find my coding as below. The important thing is where we perform the actual comparison between the r_value and 4. r_value is defined in SALV_WD_S_TABLE_MOD_CELL as reference to type DATA. So suppose the user enters a value of say 3 in the TEMP_NEW field of the ALV then r_value would contain 3 but if you observe its type in debugging mode it would be as TYPE REF TO I and not TYPE I. So you cannot directly say something like:
    "if ls_modified_cells-r_value = 3" as this would lead to a syntax error. Define a field-symbol say <temp> and then use it to get the actual value into it by saying like:
    ASSIGN ls_modified_cells-r_value->* TO <temp>.
    Then you can use this <temp> for comparison in your IF statement like:
    IF  <temp> = 3.
    Find the entire coding as below:
    METHOD check_data.
      DATA: lr_node TYPE REF TO if_wd_context_node,
            lr_element TYPE REF TO if_wd_context_element,
            ls_modified_cells TYPE salv_wd_s_table_mod_cell.
      FIELD-SYMBOLS <temp> TYPE data.
    " get message manager
      DATA lo_api_controller     TYPE REF TO if_wd_controller.
      DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
      lo_api_controller ?= wd_this->wd_get_api( ).
      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager.
      lr_node = wd_context->get_child_node( name = 'NODE' ).
      LOOP AT r_param->t_modified_cells INTO ls_modified_cells.
        lr_element = lr_node->get_element( index = ls_modified_cells-index ).
        IF ls_modified_cells-attribute = 'TEMP_NEW'.
    " Get the value extracted into the field symbol from the reference variable
          ASSIGN ls_modified_cells-r_value->* TO <temp>.
    " Use the value present in this field-symbol for your comparison
          IF  <temp> = 4.
    " report message
            CALL METHOD lo_message_manager->report_attribute_error_message
              EXPORTING
                message_text   = 'Sample message text'
                element        = lr_element
                attribute_name = ls_modified_cells-attribute.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDMETHOD.
    Hope this helps resolve your problem.
    Regards,
    Uday

  • Using a date field in a JDOQL query crashes

    Hello:
    I am trying to use a date field in a JDOQL filter. It appears from the
    log file that the date is not being substituted into the SQL.
    It is not clear from the JDOQL spec how to do date queries.... doing date
    queries in SQL involves several special operators, yet the
    JDOQL defines the ">" and "<" operators as working on dates....and there is
    no mention of date specific operators so I am hoping that I
    can do a filter where I compare a date to an input parameter date using the
    ">" and "<" operators...
    I have enclosed a copy of my driver code, followed by an except of my class
    that contains the date, followed by the kodo exception log
    I can't see where I am doing anything that violates the JDOQL spec and I
    don't see any other way of doing date comparisions.
    Brian
    Here is the driver code that I am attempting:
    public void getDateRange ()
    PersistenceManager pm = JDOFactory.getPersistenceManager ();
    String filter = "leafDates.contains (cdate) & cdate.statusName ==
    myStatus & cdate.datePhaseStarted > myDate";
    Date date = new Date ();
    Calendar calendar = new GregorianCalendar (TimeZone.getDefault ());
    calendar.set (2002, Calendar.DECEMBER, 26);
    date=calendar.getTime();
    Extent extent = pm.getExtent (LeafBase.class, false);
    Query query = pm.newQuery (LeafBase.class, filter);
    query.declareImports ("import aqueduct.*; import java.util.Date");
    query.declareVariables ("aqueduct.LeafDate cdate; Date myDate");
    query.declareParameters ("String myStatus");
    System.out.println ("dated used = " + date);
    Collection results = (Collection) query.execute ("closed", date);
    Iterator iter = results.iterator ();
    while (iter.hasNext () ) {
    LeafBase myLeaf = (LeafBase) iter.next ();
    System.out.println ("My leaf = " + myLeaf);
    pm.close ();
    Here is the class:
    public class LeafDate implements Serializable
    // *******The Attributes***************
    private Date datePhaseStarted = null;
    private boolean isEstimatedDate = false;
    //mark this as non-persistent in the JDO metadata
    private StatusType status = null;
    //put here to enable one-to-many mapping using a single table in JDO
    private LeafBase parent = null;
    Here is the error I am getting:
    C:\bcs\jdo\kodo-jdo-2.4.0\aqueduct>java aqueduct.DealMaint dated used = Thu
    Dec 26 08:47:33 CST 2002
    Exception in thread "main" javax.jdo.JDODataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX,
    t0.DEALPARENTX, t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAME FROM
    JDO_DATE t1, JDO_LEAF t0 WHERE ((t1.STATUSNAME = 'closed' AND t1.DATESTARTED
    *variable*) AND t0.ID = t1.PARENTX) PRE=SELECT DISTINCT t0.ID,
    t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX, t0.DEALPARENTX, t0.PARENTX,
    t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAME FROM JDO_DATE t1, JDO_LEAF t0 WHERE
    ((t1.STATUSNAME = ? AND t1.DATESTARTED > *variable*) AND t0.ID =
    t1.PARENTX)
    ORA-00936: missing expression
    [code=936;state=42000]
    NestedThrowables:com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX,
    t0.DEALPA RENTX, t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAME FROM
    JDO_DATE t1, JD O_LEAF t0 WHERE ((t1.STATUSNAME = 'closed' AND
    t1.DATESTARTED > *variable*) AND t0.ID = t1.PARENTX)] [PRE=SELECT DISTINCT
    t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX, t0.DEALPA RENTX,
    t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAME FROM JDO_DATE t1, JD
    O_LEAF t0 WHERE ((t1.STATUSNAME = ? AND t1.DATESTARTED > *variable*) AND
    t0.ID = t1.PARENTX)]
    ORA-00936: missing expression
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwDataStore(SQLExcep
    tions.java:23)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:742)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java
    :92)
    at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
    at com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:668)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:623)
    at aqueduct.DealMaint.getDateRange(DealMaint.java:523)
    at
    aqueduct.DealMaint.main(DealMaint.java:35)NestedThrowablesStackTrace:java.sq
    l.SQLException:
    ORA-00936: missing expression
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1819)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
    :2015)
    at
    oracle.jdbc.driver.OraclePreparedStatement.doScrollPstmtExecuteUpdate(Oracle
    PreparedStatement.java:3021)
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
    ment.java:416)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare

    Oh, thanks for pointing this out.... I got caught up in trying to figure out
    the date issues, I missed the obvious.
    Brian
    "Patrick Linskey" <[email protected]> wrote in message
    news:[email protected]...
    Brian,
    The problem is that you're declaring myDate as a variable instead of a
    parameter. Yes, we should be doing better error checking. But that's the
    problem.
    So, change your declareVariables() and declareParameters() statements
    accordingly, and all should work out.
    -Patrick
    Brian Smith wrote:
    Here is the driver code that I am attempting:
    public void getDateRange ()
    PersistenceManager pm = JDOFactory.getPersistenceManager ();
    String filter = "leafDates.contains (cdate) & cdate.statusName ==
    myStatus & cdate.datePhaseStarted > myDate";
    Date date = new Date ();
    Calendar calendar = new GregorianCalendar (TimeZone.getDefault
    >>
    calendar.set (2002, Calendar.DECEMBER, 26);
    date=calendar.getTime();
    Extent extent = pm.getExtent (LeafBase.class, false);
    Query query = pm.newQuery (LeafBase.class, filter);
    query.declareImports ("import aqueduct.*; importjava.util.Date");
    >>
    query.declareVariables ("aqueduct.LeafDate cdate; Date myDate");
    query.declareParameters ("String myStatus");
    System.out.println ("dated used = " + date);
    Collection results = (Collection) query.execute ("closed", date);
    Iterator iter = results.iterator ();
    while (iter.hasNext () ) {
    LeafBase myLeaf = (LeafBase) iter.next ();
    System.out.println ("My leaf = " + myLeaf);
    pm.close ();
    >
    Here is the class:
    public class LeafDate implements Serializable
    // *******The Attributes***************
    private Date datePhaseStarted = null;
    private boolean isEstimatedDate = false;
    //mark this as non-persistent in the JDO metadata
    private StatusType status = null;
    //put here to enable one-to-many mapping using a single table in JDO
    private LeafBase parent = null;
    >
    Here is the error I am getting:
    C:\bcs\jdo\kodo-jdo-2.4.0\aqueduct>java aqueduct.DealMaint dated used
    = Thu
    Dec 26 08:47:33 CST 2002
    Exception in thread "main" javax.jdo.JDODataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX,
    t0.DEALPARENTX, t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAMEFROM> > JDO_DATE t1, JDO_LEAF t0 WHERE ((t1.STATUSNAME = 'closed' AND> > t1.DATESTARTED> >> > >*variable*) AND t0.ID = t1.PARENTX) [PRE=SELECT DISTINCT t0.ID,
    >
    ORA-00936: missing expression
    [code=936;state=42000]
    NestedThrowables:com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX,
    t0.DEALPA RENTX, t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAMEFROM
    JDO_DATE t1, JD O_LEAF t0 WHERE ((t1.STATUSNAME = 'closed' AND
    t1.DATESTARTED > variable) AND t0.ID = t1.PARENTX)] [PRE=SELECTDISTINCT
    t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX, t0.DEALPA RENTX,
    t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAME FROM JDO_DATE t1,JD
    O_LEAF t0 WHERE ((t1.STATUSNAME = ? AND t1.DATESTARTED > variable) AND
    t0.ID = t1.PARENTX)]
    ORA-00936: missing expression
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwDataStore(SQLExcep
    tions.java:23)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:742)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java
    :92)
    atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
    >>
    at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:668)
    >>
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:623)
    at aqueduct.DealMaint.getDateRange(DealMaint.java:523)
    at
    aqueduct.DealMaint.main(DealMaint.java:35)NestedThrowablesStackTrace:java.sq
    l.SQLException:
    ORA-00936: missing expression
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at
    oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)
    >>
    at
    oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1819)
    >>
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
    :2015)
    at
    oracle.jdbc.driver.OraclePreparedStatement.doScrollPstmtExecuteUpdate(Oracle
    PreparedStatement.java:3021)
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
    ment.java:416)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

Maybe you are looking for

  • Call transaction 'LS33' and skip first screen.

    This doesn't work: set parameter id 'LEN' field '04018091'. call transaction 'LS33' and skip first screen. I've found this: <a href="https://www.sdn.sap.com/irj/sdn/message?messageID=3715690">https://www.sdn.sap.com/irj/sdn/message?messageID=3715690<

  • Can't open itunes or quicktime

    About a month ago I tried to copy a dvd on my computer, turned out the dvd was in very bad shape and I couldn't do it. A few days later, I tried to open my iTunes and I got the message, "iTunes has encountered a problem and needs to close." I can't r

  • Sorting and filter option missing in table view

    Hi, I am having search and result view in my component and i need sorting option for all the columns in result view. I thought that it is standard functionality, do i need to add something to html file or anyother place to see the sorting options? Re

  • Keyboard and mouse working weird

    hello, for some reason my keyboard wont let me type "r". SHIFT+r works though. if your wondering how ive been typing the "r"s above, i used copy and paste. my mouse will work fine 75% of the time, but once in a while it will flip out and randomly go

  • How to use power not battery?

    Just got new Mac Book Pro--my first laptop.  I am confused about the power cord and the power adapter.  How do I run the laptop using power connection instead of battery?  The power cord only plugs into the adapter, not the machine.  I'm off to a gre