How to get total number of days

Hi All,
how to get total number of days , for example if month eq 05 then need to get total number of days until MAY 31.
and how to get total number of days in a month.
Thank You,,
Sriii..

Hi Sridhar,
Pls Try to search before posting general questions.
Try this,
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
    EXPORTING
      i_datum_bis                   = p_lv_date1
      i_datum_von                   = p_lv_date2
   IMPORTING
     e_tage                        = p_e_date_difference
   EXCEPTIONS
     days_method_not_defined       = 1
     OTHERS                        = 2
  IF sy-subrc  0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
Regards,
Sunil kairam.

Similar Messages

  • How to get total number of days in current Fiscal period/year

    Hi,
    I need to get total number of days in current Fiscal period/year (current month) and assign it to an infoobject. I need a routine for this. Is there any function module to get this.If possible pls paste the ABAP code also for this task. Thanks in advance

    here is the FM:
    LAST_DAY_IN_PERIOD_GET
    KJ!!!

  • How to get total number of nodes in a JTree?

    Hi,
    I am trying to get total number of nodes in a JTree, and cannot find a way to do it.
    The current getRowCount() method returns the number of rows that are currently being displayed.
    Is there a way to do this or I am missing something?
    thanks,

    How many nodes does this tree have?
    import java.awt.EventQueue;
    import javax.swing.*;
    import javax.swing.event.TreeModelListener;
    import javax.swing.tree.*;
    public class BigTree {
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    TreeModel model = new TreeModel() {
                        private String node = "Node!";
                        @Override
                        public void valueForPathChanged(TreePath path,
                                Object newValue) {
                            // not mutable
                        @Override
                        public void removeTreeModelListener(TreeModelListener l) {
                            // not mutable
                        @Override
                        public boolean isLeaf(Object node) {
                            return false;
                        @Override
                        public Object getRoot() {
                            return node;
                        @Override
                        public int getIndexOfChild(Object parent, Object child) {
                            return child == node ? 0 : -1;
                        @Override
                        public int getChildCount(Object parent) {
                            return 1;
                        @Override
                        public Object getChild(Object parent, int index) {
                            return node;
                        @Override
                        public void addTreeModelListener(TreeModelListener l) {
                            // not mutable
                    JFrame frame = new JFrame("Test");
                    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    frame.getContentPane().add(new JScrollPane(new JTree(model)));
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
    }But for bounded tree model using DefaultMutableTreeNode look at bread/depth/preorder enumeration methods to walk the entire tree. Or look at the source code for those and adapt them to work with the TreeModel interface.

  • How to get the number of days in a month?

    hi all
    is there any way to get the number of days in a given month with a given year? for instance, if year is 2004 and the month is July or February, how can i get the number of days? thanks.

    Gee, I don't know ... Maybe this:
    Calendar cal = Calendar.newInstance();
    cal.set(Calendar.YEAR, 2004);
    cal.set(Calendar.MONTH, Calendar.FEBUARY);
    System.out.println("max days in month: " + cal.getActualMaximum(Calendar.DAY_OF_MONTH));
    Do you not bother reading what people have already posted? Read the API docs on the Calendar class.

  • How to get the number of days of February.....

    Hi ,
    how can I get the number of days (28 or 29) of February of the current year or the next...????
    Or is there any other way to find that a year is a leap or not (i mean the year has 365 or 366 days).??
    Thanks
    Simon

    select add_months(to_date('&v_year', 'YYYY'), 12) -
    to_date('&v_year', 'YYYY') from dual;Jens, it seems we have made the same mistake, trunc usage seems mandatory :
    SQL> ed
    Wrote file afiedt.buf
      1* select add_months(to_date('2007', 'YYYY'), 12) - to_date('2007', 'YYYY') from dual
    SQL> /
    ADD_MONTHS(TO_DATE('2007','YYYY'),12)-TO_DATE('2007','YYYY')
                                                             366
    SQL> ed
    Wrote file afiedt.buf
      1* select add_months(trunc(to_date('2007', 'YYYY'), 'YYYY'), 12) - trunc(to_date('2007', 'YYYY'), 'YYYY') from dual
    SQL> /
    ADD_MONTHS(TRUNC(TO_DATE('2007','YYYY'),'YYYY'),12)-TRUNC(TO_DATE('2007','YYYY')
                                                                                 365
    SQL> Just to clarify my past doubt.
    Nicolas.

  • How to get total number of result count for particular key on cluster

    Hi-
    My application requirement is client side require only limited number of data for 'Search Key' form total records found in cluster. Also i need 'total number of result count' for that key present on the custer.
    To get subset of record i'm using IndexAwarefilter and returning only limited set each individual node. though i get total number of records present on the individual node, it is not possible to return this count to client form IndexAwarefilter (filter return only Binary set).
    Is there anyway i can get this number (total result size) on client side without returning whole chunk of data?
    Thanks in advance.
    Prashant

    user11100190 wrote:
    Hi,
    Thanks for suggesting a soultion, it works well.
    But apart from the count (cardinality), the client also expects the actual results. In this case, it seems that the filter will be executed twice (once for counting, then once again for generating actual resultset)
    Actually, we need to perform the paging. In order to achieve paging in efficient manner we need that filter returns only the PAGESIZE records and it also returns the total 'count' that meets the criteria.
    If you want to do paging, you can use the LimitFilter class.
    If you want to have paging AND total number of results, then at the moment you have to use two passes if you want to use out-of-the-box features because LimitFilter does not return the total number of results (which by the way may change between two page retrieval).
    What we currently do is, the filter puts the total count in a static variable and but returns only the first N records. The aggregator then clubs these info into a single list and returns to the client. (The List returned by aggregator contains a special entry representing the count).
    This is not really a good idea because if you have more than one user doing this operation then you will have problems storing more than one values in a single static variable and you used a cache service with a thread-pool (thread-count set to larger than one).
    We assume that the aggregator will execute immediately after the filter on the same node, this way aggregator will always read the count set by the filter.
    You can't assume this if you have multiple client threads doing the same kind of filtering operation and you have a thread-pool configured for the cache service.
    Please tell us if our approach will always work, and whether it will be efficient as compared to using Count class which requires executing filter twice.
    No it won't if you used a thread-pool. Also, it might happen that Coherence will execute the filtering and the aggregation from the same client thread multiple times on the same node if some partitions were newly moved to the node which already executed the filtering+aggregation once. I don't know anything which would even prevent this being executed on a separate thread concurrently.
    The following solution may be working, but I can't fully recommend it as it may leak memory depending on how exactly the filtering and aggregation is implemented (if it is possible that a filtering pass is done but the corresponding aggregation is not executed on the node because of some partitions moved away).
    At sending the cache.aggregate(Filter, EntryAggregator) call you should specify a unique key for each such filtering operation to both the filter and the aggregator.
    On the storage node you should have a static HashMap.
    The filter should do the following two steps while being synchronized on the HashMap.
    1. Ensure that a ConcurrentLinkedQueue object exists in a HashMap keyed by that unique key, and
    2. Enqueue the total number count you want to pass to the aggregator into that queue.
    The parallel aggregator should do the following two steps while being synchronized on the HashMap.
    1. Dequeue a single element from the queue, and return it as a partial total count.
    2. If the queue is now empty, then remove it from the HashMap.
    The parallel aggregator should return the popped number as a partial total count as part of the partial result.
    The client side of the parallel aware aggregator should sum the total counts in the partial result.
    Since the enqueueing and dequeueing may be interleaved from multiple threads, it may be possible that the partial total count returned in a result does not correspond to the data in the partial result, so you should not base anything on that assumption.
    Once again, that approach may leak memory based on how Coherence is internally implemented, so I can't recommend this approach but it may work.
    Another thought is that since returning entire cached values from an aggregation is more expensive than filtering (you have to deserialize and reserialize objects), you may still be better off by running a separate count and filter pass from the client, since for that you may not need to deserialize entries at all, so the cost on the server may be lower.
    Best regards,
    Robert

  • How to get week number and day in my result?

    hi experts, i have given the data is ID and DATE(yyyymmdd),i want to get output like ID,DATE,WEEKNO,YEAR,MONTH,DAY. how to get this output.
    thanks & regards
    vijay

    In a routine transformation you can call function
    DATE_GET_WEEK
    to get the week number from the date.
    To determ the others, use the substring
    YEAR = DATE(4)
    MONTH = DATE+4(2)
    DAY = DATE+6(2)

  • How to get total number of pages from .doc file without using Office interop?

    Hi,
    Kindly help me in getting the total number of pages from a .doc file not .docx file using C#. I know how to get by using Office interop but I do not want to use Office interop.
    So, without office automation in C# let me know how to get the total number of pages from a .doc file.
    Regards,
    Ashok

    Hi Ashok,
    >> I know how to get by using Office interop but I do not want to use Office interop
    Could you tell us why you don't want to use Office interop?
    As far as I know, this is the easiest way to achieve.Hmmm,this is my answer
    http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.pagenumbers.startingnumber(v=office.14).aspx
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get total number of licenses

    Hi everyone,
    Who knows how to get the total number of licenses, I am using SBO 2005 PL07+VB.Net. from SDK help file I saw there is a SAP Business One License API, but I cann't find this API from object browse, who knows which file contents the license API.
    Thanks in advance!
    Kathy

    Hi Kathy,
    Since (un-?)fortunately the license server has been moved from DCOM to CORBA, this information is currently obsolete (I still hope we will get this information through the SDK some time in future...).
    As an interim solution you will have to get this information from the B1LicenseFile.txt file through some small application you write (you could have e.g. a service that writes the information you are interested in into some table in some database - and retrieve this information through a SQL statement).
    HTH,
    Frank

  • How to get Total Number of XML Nodes?

    Hello All,
    I have a Flash program I'm doing in Actionscript 3, using CS6.
    I'm using the XMLSocket Class to read-in XML Data. I will write some sample XML Data that is being sent to the Flash
    program below...
    I know with this line here (below) I can access the 4th "element or node" of that XML Data.
         Accessing XML Nodes/Elements:
    // *I created an XML Variable called xml, and "e.data" contains ALL the XML Data
    var xml:XML = XML(e.data);
    // Accessing the 4th element of the data:
    xml.MESSAGE[3].@VAR;          --->     "loggedOutUsers"
    xml.MESSAGE[3].@TEXT;         --->     "15"
         SAMPLE XML DATA:
         <FRAME>
    0               <MESSAGE VAR="screen2Display" TEXT="FRAME_1"/>
    1               <MESSAGE VAR="numUsers" TEXT="27"/>
    2               <MESSAGE VAR="loggedInUsers" TEXT="12"/>
    3               <MESSAGE VAR="loggedOutUsers" TEXT="15"/>
    4               <MESSAGE VAR="admins" TEXT="2"/>
         </FRAME>
    I'm new to Flash and Actionscript but I'm very familiar with other languages and how arrays work and such, and I know for
    example, in a Shell Script to get the total number of elements in an array called "myArray" I would write something like
    this --> ${#myArray[@]}. And since processing the XML Data looks an awful lot like an array I figured there was maybe
    some way of accessing the total number of "elements/nodes" in the XML Data...?
    Any thoughts would be much appreciated!
    Thanks in Advance,
    Matt

    Hey vamsibatu, thanks again for the quick reply!
    Ohhh, ok I gotcha. That makes more sense.
    So I just tried this loop below and I guess I could use this and just keep assigning an int variable to the output so
    when it finishes I will be left with a variable containing the total number of elements:
    for (var x:int in xml.MESSAGE)
         trace("x == " + x);
    *Which OUTPUTS the Following:
    x == 0
    x == 1
    x == 2
    x == 3
    x == 4
    So I guess I could do something like this and when the loop completes I will be left with the total number of elements/nodes...
    var myTotal:int;
    for (var x:int in xml.MESSAGE)
        myTotal = x;
    // add '1' to myTotal since the XML Data is zero-based:
    myTotal += 1;
    trace("myTotal == " + myTotal);
    *Which Prints:
    "myTotal == 5"
    Thanks again for you suggestions, much appreciated!
    I think that should be good enough for what I needed. Thanks...
    Thanks Again,
    Matt

  • FTP: how to get total number of files in directory

    Hello Folks,
    I prefer to use FTP from the command line but cannot figure out how--after having connected to a remote directory via ftp--to list the total number of files in that directory.
    In Unix, I would do this:
    % ls | wc -l
    But hopefully there is also some way in FTP to do the same--but darned if I know how! I do see that FTP clients such as Transmit have this listing, but maybe that's a feature of the software and not ftp.
    Thanks in advance for any suggestions/tips.
    Doug

    I've done a lot of ftp scripts 10 years ago, mostly because I could not guarantee my scripted telnet would be available everywhere. The best answer today though is listed throughout this thread and that is to use the ssh family of commands that include ssh for secure remote shell, scp for secure remote copy and sftp which is the ftp interface to scp.
    My point is neither telnet or ftp are considered safe or secure anymore because listening to communications is popular, it is referenced in most "wizard" magazines, and usernames and passwords are not encrypted.
    Set up your environment first with ssh-keygen. Version 2 is more secure than version 1 if both are still offered. Then use "ssh user@hostname ls | wc -l" to get your number of files. It is simple execution with one command and returns a status.
    If you are really looking for a solution using what you are familar with and want to ignore advice concerning security, here is a sample batch script (untested). You can change the filenames, usernames, and hostnames as desired.
    rm dir.out 2> /dev/null
    echo "user sampleuser samplepw" > script.ftp
    echo "dir sampledirectory dir.out" >> script.ftp
    echo "quit" >> script.ftp
    ftp -n sample.hostname < script.ftp
    if [ ! -r dir.out ] # file not created
    then
    echo login failed
    elif [ ! -s dir.out ] # file created but empty
    then
    echo directory is empty
    else
    nf=`wc -l dir.out | cut -f1`
    echo "There are $nf files in the directory"
    fi

  • How to get the number of days of a month belonging to a date interval

    Hi, i am getting mad around a problem, i have 2 dates and a month, i wanto to retrieve the number of days belonging to the month that are in the interval.
    eg:
    month january 2011 . begin_date = 11/JAN/2011, END_DATE 30/MAY/2011 result is 21
    month january 2011 . begin_date = 11/DEC/2010, END_DATE 10/JAN/2011 result 10
    month january 2011 .begin_date = 02/FEB/2011 , END_DATE 25/may/2011 result 0
    month january 2011. begin_date = 03/JAN/2011 , END DATE 05/JAN/2011 result 3
    and so on ...
    i appreciate any suggestion
    thank you
    Andrea

    Oh, I didnt see your result.
    SQL> with t as
      2  (select  to_date('11/01/11','dd/mm/yy') from_dt,
      3           to_date('30/05/11','dd/mm/yy') to_dt,
      4           'Jan-11' mnth from dual
      5           union all
      6           select  to_date('11/12/10','dd/mm/yy') from_dt,
      7           to_date('10/01/11','dd/mm/yy') to_dt,
      8           'Jan-11' mnth from dual
      9           union all
    10           select  to_date('02/02/11','dd/mm/yy') from_dt,
    11           to_date('25/05/11','dd/mm/yy') to_dt,
    12           'Jan-11' mnth from dual
    13           union all
    14           select  to_date('03/01/11','dd/mm/yy') from_dt,
    15           to_date('05/01/11','dd/mm/yy') to_dt,
    16           'Jan-11' mnth from dual
    17           )
    18  select from_dt,to_dt,mnth,
    19         greatest(
    20              least(last_day(to_date(mnth,'Mon-yy')),to_dt)
    21              -
    22              greatest(to_date(mnth,'Mon-yy'),from_dt)+1
    23                 ,0) cnt
    24  from t;
    FROM_DT   TO_DT     MNTH          CNT
    11-JAN-11 30-MAY-11 Jan-11         21
    11-DEC-10 10-JAN-11 Jan-11         10
    02-FEB-11 25-MAY-11 Jan-11          0
    03-JAN-11 05-JAN-11 Jan-11          3

  • How to get total number of products for the site?

    Hi,
    I want to know the total number of products available for the site. i checked in the dcs_product table, it shows 40849 unique products. is this the total number of products count which are used in the site?
    I have another table in CATA schema dcs_product_sites, when i run the CatalogMaintenanceService to populate the records in this table, getting only 26000 products. Please let me know why this difference when i run the service.
    Thanks

    dcs_product table gives all products in your catalog.
    dcs_product_site will give products for a particular site.
    If you have more than one site, then you need to query for that particular site.
    And the number of products you show also depends upon the start and end date on the products.
    And also some custom filters you have like Out of stock items etc.
    Peace
    Shaik

  • How to get total number of plants, employees, jobs and respective tasks

    Hi Gurus,
    I have requirement where in I need to give client information about root object. Information being sought is on the total number of plants, employees, jobs and respective tasks performed by employees.
    Is there any standard report available to fetch this information? Or please let me know how to collect all this information?
    Thanks in Advance.
    Rupali

    Total number of employees S_AHR_61016369
    Jobs S_AHR_61016497
    Tasks S_AHR_61016522, S_AHR_61016523 & S_AHR_61016524

  • How to get the number of days between 2 given dates

    Hi all,
    How can I find the number of days between any 2 given dates.
    Thanks

    Hi
    Here's a dirty way:
    If you've got two Date objects in Java, call getTime() on each one (which gives you a value in milliseconds), then subtract the two millisecond values, and divide the result by the number of milliseconds in a day (24 * 60 * 60 * 1000). There's more `elegant' ways to do this, but this method only requires one line of Java.
    Best wishes
    Kevin

Maybe you are looking for