Find operation with range of dates in entity services

Hello,
I created an entity service called A with 3 attributes: description (string), startDate (date) and endDate (date). I need to have a find operation that retrieves all A instances where startDate and endDate are in specific ranges of date.
For example, operation needs to return all instances where startDate is between 01/03/2007 and 05/03/2007 and/or my endDate is between 10/03/2007 and 15/03/2007.
Is it possible to do using entity services operations ? If yes, how can I do that ?
Thanks in advance,

Hi Helder,
Create a findBy method (findbyDateRange) for the entity service with the fromDate and toDate as input parameters. In the app service create a method with four input parameters of type caf.core.timestamp/date (fromdateStart, fromdateEnd and todateStart and todateEnd). In the method implementation write :
//instantiate query filters
QueryFilter qfInputfromDate = new QueryFilter(fromdateStart, fromdateEnd);
QueryFilter qfInputtoDate = new QueryFilter(todateStart, todateEnd);
//get entity service instance
myEntityServiceLocal entityServiceInstance = this.getmyEntityService();
//call entity service method
List dataList = entityServiceInstance.findbyDateRange(qfInputfromDate, qfInputtoDate);
for(int i=0; i<dataList.size();i++)
   myEntityService data = (myEntityService) dataList.get(i);
  //do your custom processing
retValue = dataList;
Hope this helps.
Thanks,
Dipankar

Similar Messages

  • Finding file with tomorrow's date in file name

    I have a workflow where pdf files are going through a process and they could end up in an error folder.  The files all have the day's date embedded in their names.  I would like to set up a cron job looking for files that have dropped in an error folder with tomorrow's date on them.  Looking for today's date is trivial:
    find . -name *_`date +%m%d`_*.pdf | grep "Error"
    And I have a cron job that runs after midnight looking for files and it will send me an email.  But most of the time the files have been in the Error directory for hours/days before -- how do I look for tomorrow-dated files the night before so that I can deal with them before I go to bed?
    -- edited to add:  I am running SL 10.6.8  I don't seem to have gnuDate which would let me do the --date="1 day" thingy -- or maybe it is there and I don't understand how to embed it in the find command...

    Well, once again, a whole morning of diligent searching doesn't get the answer, but the minute I hit post on the question, I find it.
    find . -name *_`date -v+1d +%m%d`_*.pdf | grep "Error"
    Well, hope this helps somebody else!

  • Operation with the current date in a query....

    Hi all,
    someone can give me some help.....
    Do I have a wild query like this:
    SELECT JOB_ID,
    FROM MY_TABLE
    WHERE ACTION = '....'
    AND STATUS = '....'
    AND DAEMONCODE = '....'
    AND (CURRENT_DATE - TIMEINSERT) > 10
    --> "10" represents the number of days
    The last condition of Where is the one that I can not write properly ......
    TIMEINSERT is a column of the table from which I run the query in FROM. TIMEINSERT is of type VARCHAR2 (17 CHAR) and the values are of the type that can take 20110217124105030
    The first thing I should do is to transform the reading into a date using TO_DATE TIMEINSERT (........) of Oracle, but does not seem possible .....
    And even if it is possible to solve this problem (current_date - timeinsert)> 10
    Hi.
    Flavio (from Venice)

    With a correct format mask, it works:
    SQL> select 1 from dual where current_date - to_date('15-MAR-11','DD-MON-RR') > 10;
    1
    1
    SQL> select 1 from dual where current_date - to_date('15-MAR-11','DD-MON-RR') > 20;
    no rows selected

  • Entity Services: readByCustomKeys operation mapped to External Service

    Hello *,
    in my CAF application I'd like to read a product from SAP PLM. Within my Entity Service materialNumber is my custom key and therefore a corresponding operation exists: readByCustomKeys.
    I map this operation to my External Service (Web service provided by XI).
    As I can't test this operation directly with the Service Browser (deosn't appear there), I wrap  my Entity Service with an Application Service where I use the readByCustomKeys operation from Entity Service.
    Now when I test the Application Service operation I get the following error message in Service Browser:
    ERROR. Invalid type value :
    In XI I can see that there was no error and I got well defined XML data as response. So the problem must occur anywhere in the mapping back from External Service data to Entity Service attributes.
    Wrong data type mapping can be excluded as I already tested this possibility.
    Does anyone know what could be the reason?
    Thanks for your answers and best regards
    Joschi

    Hello Joachim,
    I dont have a lot of experience with readByCustomKeys (one experience which failed) but uou can also use read itself. If you have defined materialNumber as a key in your entity service, then this field can be used in read operations as well (I have a lot of positve experiences with this approach). You will find materialNumber while mapping read with your external service and you need not map the key field generated by Entity Service.
    For testing entity services, we have had several positive experiences with the config browser, specially for a findBy, read and even update operation. It was very easy to have a prototype UI to check the entity services.
    I know this isnt the answer to your question, but just sharing my experiences.
    All the best!!!
    Regards,
    Parag.

  • Entity Services and Web Dynpro

    Hi,
    I want to implement a Web Dynpro with relation to a database (Entity Service and Application Services modeled with NWDS).
    I used the following tutorial
    , but when I want to add a "Used model", the selection list is empty and so its not possible to do that.
    Why is it empty, I implemented exactly after the tutorial?
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8b7059da-0c01-0010-e09c-9ecabaf58864">Example Tutorial (Page 16)</a>
    I really need help for that, because I want to implement a Info Callable Object, which shows Entries from the tables. The table should be filled within the actions, and so I need a relation to entity level.
    Thanks in advance
    Steve

    Hi Steve,
    In order to search the SDN forums effectively I suggest to:
    - Select 'Forums' (top menu bar)
    - Select topic of interest (in this case 'SAP NetWeaver > Developing Composites with CAF')
    - Enter your search keywords not in the upper left but in the upper middle search box 'Forum Search'
    This way the search is more likely to meet your expectations.
    Regards,
    Axel

  • How to find a specific day in a range of dates

    Hi !
    Can someone help me with this
    I would like to find if there is a Saturday in a range of dates:
    ex: OpenDate:2012-01-19 to CurrentDate,  should return  2012-01-21
          OpenDate 2012-01-23 to CurrentDate, should return null field
    Thank you

    Hi Diane,
    You can use this formula to find a Saturday in a date range:
    numbervar days := datediff("d",{Date_Field}, currentdate)+1;
    numbervar x;
    datevar array dates;
    redim dates[days];
    datevar sat;
    for x := 1 to days do
        dates[x] := {Date_Field}+(x-1);
        if weekday(dates[x]) = 7 then
        datevar sat := dates[x];
    sat;
    Hope this helps!
    -Abhilash

  • HT204266 My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

    My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

    My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

  • I am trying to find an app that will track the usage on my iphone with times and dates to see what was accessed on my phone when I was away from it and what if anything was done eg deleted messages viewed facebook etc?

    Hi! I am trying to find an app that with track everything that is done on my phone with times and dates? im not really woried about call usage and texts sent I need it to view what has been done - for example:
    Messages received
    Messages deleted
    Facebook viewed
    Messages viewed
    Internet viewed and what?
    I just have an issue with someone using my phone - I used to track this through double clicking the home button and roughly knowing in what order I had been on things but they have sussed this one!
    Thank you!!

    No way to do that on a non-jailbroken iPhone. Why don't you just passcode protect your phone? That way no one but you can use it...unless they know your passcode.

  • How to get XLR to show BPs with no transaction data for a given date range

    Hi -
    I am building an XLR report that does a comparison of net sales data across two periods for a given sales employee's BPs.
    The report has the row expansion:
    FACT BPA(*) SLP(SlpName = "ASalesPersonNameHere") ARDT(Code = "ARCreditMemo", "Invoice") Group by BPA.CardName
    and column expansions:
    FIG(SO_TaxDate = @StartDate:@EndDate)
    and
    FIG(SO_TaxDate = @StartDate2:@EndDate2)
    where @StartDate, @EndDate, @StartDate2, @EndDate2 are parameters that define the two ranges of dates.
    The column formulas are, from left to right:
    =ixDimGet("BPA", "CardName")
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for first date range
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for second date range
    The report works fine except for one problem, I would like it to include BPs for which no transaction occurred in either date range as well.
    Any help is greatly appreciated!
    Thanks,
    Lang Riley

    Really appreciate your feedback!  Those are good suggestions. I should have mentioned that I had already tried both those suggestions.
    Removing FACT on BPA in this case ends up returning all the BPs and not respecting the SLP(SlpName = "aName") part of the query. 
    Using **, i.e., * or #NULL, makes no change in the resulting data in this case.  I had thought that ** would be the solution, but it didn't change the outcome.  I still have BPs for which when their sales employee is used as the filter and they have no transactions for either date range, and yet they still do not appear. 
    I should further mention that the IXL query, as it now stands, does return BPs for which one of the periods has no data, just not both, and I have verified that applicable BPs with no transaction data for both periods do exist in my data set.  It seems that perhaps the IXL query needs to be restructured?  Please keep the suggestions coming including how this query might be restructured if necessary.

  • Payroll operation: comparison with a certain date

    Hello, everybody,
    I am trying to compare the employee's date of seniority from IT0041 with a certain date (ex: first of september 2001) so as to calculate my seniority bonus (because the calculation rule is not the same for the employees who have the seniority date before or after entrering the first of september 2001). I have tried to use the payroll function NUM=F... but this gives me only the number of years, or months till the current payroll period, and not the month and year from infotype 0041 and I do not know how to compare the given date and the date coming from the infotype.
    please help me
    thanks in advance
    natachalek

    You can compare the employee's date of seniority from IT0041 with a certain date in a customer operation %xyz (model E7) created in tcode PE04.
    The dates from IT0041 are available in an internal table DATUMSANGABE. Develop ABAP code as follows:
      FORM op%xyz.
        DATA: date TYPE d VALUE '20010901'.
        READ TABLE datumsangabe WITH KEY typ = '01'.
        IF datumsangabe-wert LT date.
          vargt = 'X'.
        ELSE.
          vargt = '*'.
        ENDIF.
        PERFORM fillvargt.
      ENDFORM.
    In the payroll schema where the seniority bonus is performed, create decision operation %xyz. For the variable key 'X' process the bonus WT for employees hired before 1st Sep 2001 and for others use the branch with variable key '*'.
    Regards,
    Renata

  • Filling a range with the same date in Numbers '09

    I know if you type a date in to a field and then drag the corner it will fill successive dates, but is there a way to fill a range of cells with the same date so I don't need to retype them each time?

    Create a pattern of what you want, then do "fill"
    Enter the same date in two or three cells, in a row or column, then drag to fill the range. Numbers should recognize the pattern you created and continue it.

  • How to select Months with in a date range

    Hi
    I am working on a report which will list out Month wise totals in each row.
    How should i select the Months with in a date range and do the sum ( User may select the date range for  N number of  years also. Example :  01/10/2000 to 01/01/2010 )
    Thanks in advance
    Thanks&regards
    Mrudula

    Hi
       Use the following code:
    data: l_date(8) value '03042007',
            l_mname   type   t247-ktx,
            l_c(25).
      select single ktx from t247
      into l_mname
      where spras = sy-langu
      and mnr = l_date+2(2).
      concatenate l_mname l_date+6(2)
      into l_c." SEPARATED BY space.
      data: g_date(10) type c. " Processing date of Report
      g_date = sy-datum.
      concatenate g_date0(4)  g_date4(2)  g_date+6(2) into g_date.
      data: g_date1(10) type c.
      g_date1 = so_verab-high.
      concatenate g_date10(4)  g_date14(2)  g_date1+6(2) into g_date1.
    Regards,
    Sreeram

  • What component is included with Microsoft SQL Servers that can be used to perform a broad range of data migration tasks?

    What component is included with Microsoft SQL Servers that can be used to perform a broad range of data migration tasks?
    a. Full Text Search service
    b. SQL Notification Server
    c. SQL Reporting Server
    d. SQL Server Integration Services

    d.
    Are you having a test and trying to cheat?
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Problem in selection from data base with RANGE-TABLE.

    Dear folks,
                   I am facing weird problem with range table in selection query.I have problem with bold part of code.Here when i give input to both ranges r_salesno,r_brandid then and the selection occurs ,when i put black in one of those it does not work.I haev passed Empty table to range if no inpiut in elements..although it does not work..I dont know why it is happening...By the i m using this code in Webdynpro ABAP.Please help points will be awarded..
    if  Stru_Cn_Selcrtr-ca_slsrl is not initial.
        wa_salesno-sign = 'I'.
        wa_salesno-option = 'EQ'.
        wa_salesno-LOW = Stru_Cn_Selcrtr-ca_slsrl.
        APPEND wa_salesno TO r_salesno.
        CLEAR : wa_salesno .
      else.
        wa_salesno-sign = 'I'.
        wa_salesno-option = 'EQ'.
        wa_salesno-LOW = space.
        APPEND wa_salesno TO r_salesno.
         CLEAR : wa_salesno .
      endif.
      if  Stru_Cn_Selcrtr-ca_brand is not initial.
        wa_brandid-sign = 'I'.
        wa_brandid-option = 'EQ'.
        wa_brandid-LOW = Stru_Cn_Selcrtr-ca_brand.
        APPEND  wa_brandid TO  r_brandid.
        CLEAR :  wa_brandid .
      else.
        wa_brandid-sign = 'I'.
        wa_brandid-option = 'EQ'.
         wa_brandid-LOW = space.
        APPEND wa_brandid  TO  r_brandid.
        CLEAR : wa_brandid  .
      endif.
    *If any of these are given then select data accordingly.
        <b>select * from ZNSLVWHDIMMD_LCL
                 into corresponding fields of table IT_VIEW
                 WHERE SALESRLNO in  r_salesno
    *             and   CREATEDBY in It_crtby_selopt
    *            and   STARTDATE in It_validfrm_selopt
    *             and   ENDDATE   in It_validto_selopt
    *             and  STATUS     in It_status_selopt1
                 and   BRANDID   in r_brandid.
    *             and   MODELNO   in It_model_selopt.</b>

    Hello Nirad
    Your coding is problematic. I assume that field SALESRLNO (of table ZNSLVWHDIMMD_LCL) probably means sales number (or sales order) and, thus, must not be empty. If this is correct then the first IF statement is probably wrong:
    if  Stru_Cn_Selcrtr-ca_slsrl is not initial.
        wa_salesno-sign = 'I'.
        wa_salesno-option = 'EQ'.
        wa_salesno-LOW = Stru_Cn_Selcrtr-ca_slsrl.
        APPEND wa_salesno TO r_salesno.
        CLEAR : wa_salesno .
      else.
        REFRESH: r_salesno.  " means: select all sales numbers
    " NOTE: If you fill the range like below this means that only sales order
    "            with no sales number (= ' ', space) should be select.
    " Thus, there will never be any sales order selected.
    *   wa_salesno-sign = 'I'.
    *   wa_salesno-option = 'EQ'.
    *   wa_salesno-LOW = space.
    *   APPEND wa_salesno TO r_salesno.
    *    CLEAR : wa_salesno .
      endif.
    The same logic applies to the second IF statement. If you want to select all BRANDID if none has been provided as selection criteria then code:
      if  Stru_Cn_Selcrtr-ca_brand is not initial.
        wa_brandid-sign = 'I'.
        wa_brandid-option = 'EQ'.
        wa_brandid-LOW = Stru_Cn_Selcrtr-ca_brand.
        APPEND  wa_brandid TO  r_brandid.
        CLEAR :  wa_brandid .
      else.
        REFRESH: r_brandid.  " means: select all BRANDID
    *    wa_brandid-sign = 'I'.
    *    wa_brandid-option = 'EQ'.
    *     wa_brandid-LOW = space.
    *    APPEND wa_brandid  TO  r_brandid.
    *    CLEAR : wa_brandid  .
      endif.
    Regards
      Uwe

  • Find method with dates

    Hellow ,
    I want to create a find-method that should represent following statement :
    select * from emp where date > to_date( '24/01/2002', 'dd/MM/yyyy' );
    I defined in my EJB-home-method something like this ...
    public Collection findByStukEname( String date ) throws RemoteException, FinderException;
    Then I deployed to a J2ee-server ...
    and in the orion-ejb-jar.xml I changed the finder-method into ...
    <finder-method query="select * from emp where date > to_date( $1 , 'dd/MM/yyyy' )" partial="false">
    <method>
    <ejb-name>EMP</ejb-name>
    <method-name>findByStukEname</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method>
    </finder-method>
    But i doesn't work ? Did I make a mistake ?? Is there a beter way to do it ?? ( maybe working with java.util.Date ?? )
    Greetz
    Steven

    Hi Steven,
    OC4J uses an instance of java.sql.PreparedStatement to execute your
    "finder" method. Now you have defined a member of your bean class that will be inserted into your query string in place of the "$1".
    I'm guessing that this member is an instance of "Date" (either
    java.util.Date or java.sql.Date). If that is the case, then you need
    to change your query string to
    select * from emp where date > $1
    Also, you may not be aware of this, but I always use java.sql.Timestamp
    when mapping EJB members to DATE columns in the Oracle database tables.
    (Not java.sql.Date)
    Hope this helps,
    Avi.

Maybe you are looking for

  • Oracle 11i forms crash when run on Windows 7 using IE 8 or IE 9

    I am trying to run oracle apps form on my windows 7 pc using ie 8 or ie 9. But the browser crashes whenever I try to open the form. I am using Oracle EBS version 11.5 and Jinitiator version 1.3.1.18. I tried replacing the jvm.dll file in Jinitiator w

  • Sound Freeze during AI processing

    I'm having problems with the background music freezing and stuttering when heavy recursive operations or even large matrix data processing are being performed on Macs. I am using MX 2004. It doesn't happen at all on the Windows projector version wher

  • Scheduling Report  through  Command Line

    Post Author: gunjesh CA Forum: Administration Hi All,           I would like to know how to schedule a  Webi (infoview) report of Bussiness Objects XI Release2    through Command line , Not through CMS. Command line options 1. To schedule a report fr

  • USB Protection Help

    Hello Apple Communities. I hope I'm not asking too much of you all here, but here is the dilemma. I have a 8GB SanDisk Cruzer Edge flash drive. I'd like to set it up to where there are two separate logins for two partitions of the drive. I want one p

  • Can a case structure execute multiple cases?

    So I have a VI set up with a mutiple option case structure to select which input a voltage is read from (there are 32 options). Now that I have it made, I realize that sometimes I may want to read from multiple inputs at once.. Is there an easy way t