Number of days per period cumulated value

Hi,
I am using a keyfigure which gives me number of days per period cumulated.
example
001.2009  002.2009 003.2009
30             61            91
When i multiplying number of days keyfigure with a factor, Its caluculating using before aggregation values. i.e.
001.2009 = 30*factor
002.2009 = 31* factor
003.2009 = 30*factor.
The requirement is to multiply with cumulated values.
001.2009 = 30*factor
002.2009 = 61*factor
003.2009 = 91*factor.
Is this possible? If yes any help greatly appreciated.
Regards,
Suresh.

Hi...
It will answer following questions...
1. How many days for month Feb' In the year 2008?
2. How many days for the month Feb' in the year 2007?
Analyze this program...
data: var3(2) type n.
PARAMETERS: var1(2) type n DEFAULT '2',
            var2(4) type n DEFAULT '2008'.
call function 'NUMBER_OF_DAYS_PER_MONTH_GET'
  exporting
    PAR_MONTH       = var1
    PAR_YEAR        = var2
IMPORTING
   PAR_DAYS        = var3.
write:/ 'No. of days in the given month:', var3.
Thanks,
Naveen.I

Similar Messages

  • Create a field routine to calculate the number of days per month

    Hi Experts,
    I need to create a field routine to count the number of days per month based on 0CALMONTH. Could you give me some inputs on how to do it?
    Thanks!

    Hi,
    Create InfoObejct and then insert it in InfoSource/InfoCube/DSO then write simp,e code for that based on your  0CALMONTH values.
    You just copy and pas this in SE38 and see the result and implement for your requirements.
    REPORT  ztest1.
    Data: zsydt type sy-datum,
          zd(2) type n,
          zm(2) type n,
          zy(4) type n,
          zcmnth TYPE /bi0/oicalmonth,
          znds TYPE /osp/dt_day.
          zsydt = sy-datum.
          zd = '01'.
          zm = zsydt+4(2).
          zy = zsydt+0(4).
          CONCATENATE zy zm zd INTO zsydt.
          CALL FUNCTION '/OSP/GET_DAYS_IN_MONTH'
                EXPORTING
                  iv_date = zsydt
                IMPORTING
                  ev_days = znds.    "No.of days in month.
          write:/ zd.
          write:/ zm.
          write:/ zy.
          write:/ zsydt.
          write:/ znds.
    Thanks
    Reddy

  • SNP heuristic error maximum number of orders per period reached

    Hello All,
    I am getting one strange error "APO SNP heuristic error maximum number of orders per period reached (000000040)"
    Product XXX/ Location XXX: Maximum number of orders per period reached (000000040)
    For the problem : PPDS heuristic is working fine, while running the SNP heuristic I am getting this problem.
    Please let me know asap.
    Thanks in Advance,
    Kind Regards,
    Santosh

    There is a section in the IMG where you can change this behaviour.
    in SPRO - SAP SCM - IMG
    -> Advanced Planning and Optimisation
      -> Supply Chain Planning
        -> Supply Network Planning (SNP)
           -> Basic Settings
              -> Maintain Global SNP Settings
    You will see the field "Heu.: Orders per Bkt" which should have the value of 40 in there, e.g. the limit to the number of orders SNP can raise in any planning bucket.
    If you raise this number (to say 100) then hopefully your message will no longer be issued by the system.
    Alternatively, you can check the cause of why the system is rasing so many orders. For example, check the lot size that the Product has for that location (lot-for-lot will create an order for every demand for example).
    Hopr that helps
    Regards
    Ian

  • How do you show the number of days per month?

    How do you show the number of days per month?
    I am working on a budget.  I want to know how much to amortize each month to fund an investment.  Income comes monthly, but expenses leave in days, or weeks.  The number of days and weeks in months vary. 
    I want to figure out income and expenses per day, per month and per year, so I know how much can be invested each month, week or day.  For a start I would like a formula that shows how many days are in each month?

    thanks..
    I solve my problem as
    public class MyExample {
        public static void main(String a[]) {
            String stdate = "2009-03-01";
            java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());
            java.sql.Date preDate = java.sql.Date.valueOf(stdate);
            System.out.println(currentDate);
            System.out.println(preDate);
    //        int dateCom = preDate.compareTo(currentDate);
    //        System.out.println(dateCom);
            long diff = currentDate.getTime() - preDate.getTime();
            int days = (int) Math.floor(diff / (24 * 60 * 60 * 1000));
             System.out.println(days);
    }

  • Convert number of dayes per year to data

    Please i need help in Convert number of dayes to date
    I have ID's like id
    FT*09025*0000000001 date=20090125
    FT*01171*0000000002 date=20100620
    so should convert first five number after FT to date
    example *09025*
    09 map to 2009
    025 number of dayes per year map to 25 jan
    example *01171*
    01 map to 2010
    171 number of dayes per year map to 20 jun
    (jan+feb+mar+apr+may)=(31+28+31+30+31)=151
    171-151=20 for the next month
    Please need help so will added filter to informatica map with date
    Edited by: user8929623 on Jul 4, 2010 7:04 PM

    Well, I do not follow why when 09 maps into 2009, 01 maps into 2010, not into 2001. Assuming it should be 2001, use YYDDD format:
    SQL> with t as (
      2             select 'FT*09025*0000000001' id from dual union all
      3             select 'FT*01171*0000000002' from dual
      4            )
      5  select  to_date(substr(id,4,5),'yyddd') dt
      6    from  t
      7  /
    DT
    20090125
    20010620
    SQL> SY.

  • Determine the number of days in a False period in a Temporal Boolean

    Hi all,
    I need to determiine the number of days based on a condition that lies on the gaps between the periods.
    My input consists of multiple periods. The length of the gap is the condition to determine the start date for summation. However, there can be multimple gaps between my instances that satisfy this condition and I need the last one that satisfies it.
    For example:
    period 1: 1-1-1990 until 31-12-1992
    period 2: 1-1-1994 until 31-12-1996
    period 3: 1-1-1998 until 31-12-1999
    period 4: 1-6-2000 until 31-12-2009
    The condition for the start date is the last gap greater than 1 year. In this example, the start date should be the start date of period 3: 1-1-1998, because this is the period after the last gap >= 1 year. Period 2 also has a previous gap of >= 1 year, but this period should NOT be selected.
    My first idea was to use a TBR function: to determine relevant periods (based on the gaps before and after), calculate the amount of days per relevant period and add those up. However, if I want to do that I need to calculate the number of days in the gaps and I don't see how to do that, since I cannot determine a day difference across periods (end date period 1 until start date period 2).
    Any help/ other solution ideas?
    Kind regards, Els

    This was an interesting puzzle which you can solve from a couple of different angles.
    Firstly, you can use inferred relationships to infer a relationship "the following periods" (ie. the periods that follow the current one). My rules looked like this:
    the period (the other period) is a member of the following periods if
       the other period start date > the period start date
    the period’s next start date = InstanceMinimum(the following periods, the period start date)From here it should be easy to see if there was a gap of more than a year, and find the most recent period after a year-long gap. Of course you need to deal with the situation of the last period, when there is no 'next' period, presumably you would use the date of assessment in that case, but I'll leave that as an exercise for the reader.
    A completely different way of doing it is to use the TemporalConsecutiveDays function to find a date where a gap of 365 days exists, then select periods in which there is a gap immediately before the start of that period. Here are some rules that :
    there is a period that applies if
       ExistsScope(the periods)
          TemporalOnOrAfter(the period start date) and
          TemporalOnOrBefore(the period end date)
    there is a year-long gap if
       TemporalConsecutiveDays(365, 365, there is not a period that applies)
    the period starts after a year-long gap if
       ValueAt(the period start date, there is a year-long gap)
    the start date for calculation = InstanceMaximumIf(the periods, the period start date, the period starts after a year-long gap)Hopefully one of these is suitable for your needs.
    cheers,
    Steve.

  • How to limit number of logins per day?

    We have a custom web application (WebAS 6.20) used by people and automated systems. Each user has his own login, and some of these automated systems sometimes produce heavy load because they log into system too often.
    Is there an easy way to:
    1) limit number of logins to, say, 1000 per day and when this limit is reached - do not allow this user to login till midnight
    OR
    2) dedicate one of the processes to the specific user
    thanks in advance

    extend PlainDocument class to restrict the number of characters per line.
    Set this class as model to TextArea.
    Below is a class which does this. May be its useful
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    public class FixedNumericDocument extends PlainDocument {
    private int maxLength = 9999;
    private String max="";
    public FixedNumericDocument(int maxLength) {
    super();
    this.maxLength = maxLength;
    //this is where we'll control all input to our document.
    //If the text that is being entered passes our criteria, then we'll just call
    //super.insertString(...)
    public void insertString(int offset, String str, AttributeSet attr)
    throws BadLocationException {
    if (getLength() + str.length() > maxLength) {
    return;
    else {
    try {
    //check if str is numeric only
    int value = Integer.parseInt(str);
    //if we get here then str contains only numbers
    //chk if it is less than 65535 so that it can be inserted
    super.insertString(offset, str, attr);
    catch(NumberFormatException exp) {
    return;
    return;

  • Logic to calculate average number of employees per day...

    Hi,
    In an internal table, i have employee number, start date, end date.
    This table shows employee's start and end dates for a cost center.
    Now, the requirement is to calculate the average number of employees available per day for a given period...
    Lets asume that we would like to calculate average number of employees per day for a given period of 30 days (01.01..2009 to 30.01.2009)....
    The above table will have around 20 employees with their start and end date.
    Among these 20, some may be present between 1st to 10th Jan only..
    In such case, How to calculate average number of employees per day in such case?
    Can anyone help me out with a rough sketch of logic for this calculation?
    Thanks in Advance,
    Pavan

    My Logic:
    1) First choose dates from which date to which date you are planning to calculate. [Here i am trying to calculate from Jan 1st 2008 to till date - March 3rd 2009 = So total days = 427 days]
    2) First try to count number of days worked in organization by each employee. [Lets take employee a = 10 days, b = 182 days, c = 427 days].
    3) Then total all the number of days. [abc = 10182427 = 619 days].
    4) Total number days / Total number of days worked = 619 / 427 =  1.44 employees per day.
    Employee     Emp-Start Date     Emp-End Date     No. of days
    a             Jan 1st 2008     Jan 10th 2008     10
    b             Jun 1st 2008     Jun 30th 2008     182
    c            Jan 1st  2008     3rd March 2009     427
              Total No. of days                     619
         From Jan1st 2008 to Till date 3rd March 09          427
              619 / 427 =     1.449648712
    I tried take simple example to recheck the above scenario is correct or not. If 'n' number of employees worked for an organization in a year (365 days) is 730. then per day = 730 / 365 = 2 employees per day worked for organization.
    I am not sure my logic is correct or not ... just tried like above.
    Regards,
    ~Satya

  • How to calculate the number of days worked for a given period

    I need to calculate the number of days worked by contractor employees for a time period to be entered by a user. I am building a query on an infoset which contains employee information including contract start date and contract end date for the employee.
    Ideally I'd like the user to enter the time period which should be reported on e.g. 01.08.2009 to 31.08.2009
    The report should then identify all the contractor employees which were working during this period and to work out how many days they worked during this period. Obviously the contract start and end dates could fall both inside and outside the reporting period.
    Can this be done and if so, do you have any suggestions as to how to do it?
    Thanks.

    hi
    So here you will first have to load the master data table employee in one internal table and read this table with the variables entries.
    Your code in the reporting exit should look like that.
    bye
    data : wa_employee type /bi0/pemployee.
    When 'ZDATE1'
    if i_step = 2.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZDATE2'.
    clear l_s_range.
    clear wa_employee
    1- select the entries from table employees
    select single employee dateto datefrom
    from /bi0/pemployee
    into corresponding fields of wa_employee
    where dateto le loc_var_range-low
    and datefrom ge loc_var_range-high.
    if sy-subrc eq 0.
    CALL FUNCTION 'FIMA_DAYS_BETWEEN_TWO_DATES'
       EXPORTING
           i_datum_von  = wa_employee-datefrom
           i_kz_ult_von = 'X'
           i_datum_bis  = wa_employee-dateto
           i_kz_ult_bis = 'X'
           i_szbmeth    = '1'
       IMPORTING
          e_tage       = no_days.
           l_s_range-low  = no_days.
           l_s_range-sign = 'I'.
           l_s_range-opt  = 'EQ'.
          APPEND l_s_range TO e_t_range.
              ENDIF.
            ENDIF.
    endloop.
    ENDIF.
    Boujema

  • 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!!!

  • Help re: plan values posting per period

    Hi SDN forumers,
    I would like to seek assistance on this concern of ours re: input of Cost Center planning values. We are using t-code KP06 and activated Integrated Excel for our data upload. The upload works fine, except that I cannot think of a way to input the plan values on an annual basis.
    For example, I would like to input a 12,000 USD plan value for cost center A for fiscal year 2008. Instead of inputting it every month, I was thinking if I can just indicate periods 1-12 in the selection parameter in KP06 and indicate 12,000 USD so that the system would automatically designate 1,000 USD per period. I tried doing this but the system response is that it doesn't designate the amounts per period.
    Any help would be greatly appreciated. Thanks and God Bless

    Hi walter,
    Where can I find the distribution key in KP06? I checked the Menu Paths in KP06 but cannot locate where I can select the distribution key. Is it connected with the Planning Layout?
    Thanks

  • Since yesterday I'm unable to send emails alleging I have exceeded the maximum number of emails per day, but I had only sent out 24 and NO bulk emailing -  (much less than 1000 as per the website) and I'm STILL not able to send emails.Any advice?

    Since yesterday I'm unable to send emails on any of my Apple devices. The revert is that I have exceeded the maximum number of emails per day, but I had only sent out 24 with no bulk emailing -  (much less than 1000 recipients as per the website) and I'm STILL not able to send emails. Any advice on how to solve this?

    I have asked a moderator to provide assistance, they will post an invite on this thread.
    Once you get a reply, if you click on their name, you will see a screen like this. Click on the link as shown below.
    Please do not send them a personal message, as they may not be on duty for a long time, and your message will not be tracked properly.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • MDX- Getting Number of days in a selected period

    HI All,
    I need a help in MDX.
    Here I am calculating the number of days in a selected time period.
    In my date dimension we have the Month as the last level.
    But somehow I bring a column called "Days in Month" 
    Now my Date dimension table is like below:
    Id   year  Month
    DaysInMonth
    1 2014
    Jan 31
    2  2014
    Feb 28
    12  2014
    Dec 31         and so on.....
    So i created a hierarchy which contains three levels i.e. Year--->Month---->---->DaysInMonth
    Now I want to know the Total number of days in a selected time period.
    i.e. if I select 2014 then it should show 365, similarly if i select
    Aug-2014 then it should show 31.
    I have tried the below code i.e. 
    WITH MEMBER measures.X AS
          count( DESCENDANTS (
                [Time Accounting period].[Hierarchy].CURRENTMEMBER,
                [Time Accounting period].[Hierarchy].[Days In Month]))
    SELECT Measures.X ON 0,
    [Time Accounting period].[Hierarchy].[Year].&[2013] on 1 
    FROM [XXX]
    Here it is showing me the total members in that particular level,
    E.g. When I am selecting 2013, its showing me 12
    If I select Jan-2013, its showing me 1
    But I dont want this, if I would have the Dates in my Date Dimension, then this code would have worked perfectly.
    So i just want to know if somehow we can use the DaysInMonth
    column to accomplish this.
    Thanks
    Sudipta Ghosh
    Sudipta Ghosh Tata Consultancy Services

    HI David,
    If I would have the Day level data then my below code will give me the desired result.
    WITH MEMBER measures.X AS
          count( DESCENDANTS (
                [Time Accounting
    period].[Hierarchy].CURRENTMEMBER,
                [Time Accounting
    period].[Hierarchy].[Days]))
    SELECT Measures.X ON 0,
    [Time Accounting period].[Hierarchy].[Year].&[2013]
    on 1 
    FROM [XXX]
    But unfortunately I don't have the Day level in the dimension, So was wondering whether we can use the
    DaysInMonth column by any means.. :(
    Sudipta Ghosh Tata Consultancy Services

  • Number of days in a period of factory calendar

    Hi Experts,
    My requirement is to find out the number of days in a particular period of factory calendar. I have the current date and calendar ID as input .
    1. Is there any FM available to find out the number of days(including both working and holidays)?From my search i could find some FMs , but the input parameters requires start and end date of the period.Start and end dates are not available in my case.
    2. IF the first option is not possible , I want to find out the start and end dates of the current period from the factory calendar. Any standard FMs available for this?
    Thanks in advance
    Sanu
    Moderator Message: Asked and answered many times. Please search
    Edited by: kishan P on Sep 13, 2010 5:28 PM

    according to SAP F1 help, it is calendar days.
    Double click a key figure (not the characteristic like material number) . then put the cursor onto the desired key figure and press F1

  • Period Activity vs Cumulative value

    Hi Experts,
    I am running a report that has Period Activity and Cumulative value, the problem is that the Period activity figures and the cumulative value figures are the same. The cumulative value is pulling values = the month being reported ; what do i need to change so that the Cumulative value is not the same as Period Activity?? Thanks, points will be awarded

    Hi...i supossed that you have a cummulative value and one differente key figure for period activity....period activity must not be cummulative...
    Regards

Maybe you are looking for

  • Installing grub2 1.99rc1 on Linux Software RAID (/dev/md[0-x])

    Hello! In the last days I tried to install Archlinux x64 on my server. This server consists of 4 SATA drives. I'm using Linux software Raid with the following configuration: mdadm --create --verbose /dev/md0 --auto=yes --level=10 --raid-devices=4 /de

  • How to display the variable screen with report in the same page together

    our customers want to design a web application use BEx they want the variable screen can be displayed with the report result in the same web page together so they can modify the variable filters any time and refresh the report with new variable filte

  • Need help, cant verify how do i do that ?

    i set up my account cause i just for the iphone 3gs they said they sent me an email which is the last step in the process now i received the email and clicked on the link and downloaded itunes.. when i go to sign in either thru my phone or the comput

  • Release stragey for PR

    Hello, I configured the Release strategy for PRs. But i am getting error as " PR not subject to release" Could anybody please help. rgds ramesh

  • Desktop is blank

    After force quiting an application, I lost my usual desktop. The desktop background was there, and my dock was still there, but all of the files on my desktop are not there anymore. Can anyone help?