Days of the month in Fox

Hi,
I need to convert one key figure into other one with the following formula.
if the month is JANUARY keyfigure1 / 31, if is february keyfigure1 / (28 or 29, depends of the year).
How can I do that? how can I obtain the days of the month in a fox formula?
I would appreciate your help.
Regards,
Hi,
I need to convert one key figure into other one with the following formula.
If the month is January keyfigure1 / 31, if is February keyfigure1 / (28 or 29, depends of the year).
How can I do that? How can I obtain the days of the month in a fox formula?
I would appreciate your help.
Regards,
Victoria Leó

Victoria,
0CALMONTH2 is not supported with the C2DATE expression.
However, if you have 0CALMONTH, you can still do it using the C2DATE expression...
You would need to do something like this:
First make sure your date 0CALMONTH is included in the fields to be changed so that you can access it in your formula.  NOTE: This means you have to specify it when you are writing/reading a Key Figure.  In addition, you would probably have to include it in your foreach parameters, like below:
DATA MONTH TYPE 0CALMONTH.
DATA END TYPE D.
DATA BEG TYPE D.
DATA DAYS TYPE I.
*Executed for each month restricted by planning package
FOREACH MONTH.
  END = C2DATE (MONTH, E).
  BEG = C2DATE (MONTH, S).
  DAYS = END - BEG.
  {0AMOUNT2,MONTH} = {0AMOUNT1,MONTH} / DAYS.
ENDFOR.
If you do not have 0CALMONTH available, then you will not be able to do it this way.  Depending on the release of your system, you can call a function module from FOx as long as it is built in a specific way.  Use the 'i' (information) button for specific details on how to implement a function module in FOx, however at this point I would say you should evaluate whether or not to do this function in ABAP alltogether using a Function Module of type User Exit.
Hope this helps.
Regards,
Zane

Similar Messages

  • Display a metric differently only on last day of the month.

    Have a Daily transaction fact where unit cost of product is stored at a day/part num /business unit level.
    When we drag and drop date column and unit cost in the report like below we will have
    Date      cost
    Sep29     $10
    sep30     $12
    Oct1       $12
    Oct2       $14
    ..........ans so on
    The source sustem program runs on last day of the month around 8pm for setting up cost to reflect on 1st of every month
    But the nighly OBI load ( Runs at 2am every day) when incrementally updating Sep30 data picks up $12 from the erp and populates in OBI.
    But actually speaking, on Sep30 the cost was $10.
    There is no way of running the ERP program to run afer OBI load. Hence we need an expression in the RPD (not answers) saying
    when last day of the month (any month) the standard cost must be a previous day value.All other days the same value should be returned.
    Is this possible without impacting report performance ?
    So, when we drag and drop date and cost value the above report should change as
    Date        Cost
    sep29     $10
    sep30     $10
    Oct1       $12
    Oct2       $14
    Oct30     $12.5
    Oct31     $12.5
    Nov1      $13.5

    You can achieve the above requirement for current month alone with below steps:
    The solution requires to have a union report
    First part of the report will have Date and Cost fields with a report level date filter, Date NOT IN (TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_MONTH , 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))))
    Second part of the report will have Date and Cost fields with a report level date filter Date IN (TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_MONTH , 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))))In the second part of the report,
    Change the column formula for Date to display only Current_Date
    Change the column formula for Cost field with FILTER(Cost USING Date = Current_Date-1)
    Pls mark if correct/helpful.

  • BIP eBusiness Suite Dates - How to include the last day of the month?

    How can I get my report to include the last day of the month 'without' forcing my users to enter the non-intuitive first of the next month as a parm?
    I have a report that will generally be run for a month but can be run for any pair of dates representing the first and last date to be included in the report.
    When we pass the dates from Oracle Apps to the report it is truncating the date to midnight. This results in the last date entered 'NOT' being included in the report as the second date is marked as "midnight". When I attempt to simply add "=1" to the end date it fails due to formatting issues in apps (only). I have gotten this to work on our Enterprise edition server that we use for testing (only) but it fails in our apps environment.
    In APPs we input the date in the format "01-AUG-2007", and this is how it shows in the parm line before the report is submitted as well as in the "View Details" after the report is executed: http://home.swbell.net/grog1//work/req_details_5607586.jpg
    However it is odd in that we in the "View Log" entry it shows the date formatted as "2007/08/01 00:00:00": http://home.swbell.net/grog1/work/view_log_5607586.jpg
    Even odder is that under diagnostics, "View XML" the date is formatted third way as: "2007/08/01 00:00:00.0" (note it now includes tenths of a second): http://home.swbell.net/grog1/work/view_xml_5607586.jpg
    This of course makes it difficult to perform conversions and calculations on the date in the SQL.
    Is APPs doing some sort of 'timestamp' conversion?
    How can I get my report to include the last day of the month 'without' forcing my users to enter the non-intuitive first of the next month as a parm?
    Any feedback is appreciated,
    Scott

    No. The problem/error occurs long before the data is formatted into xml for presentation to the format template.
    The error occurs in the SQL in the 'data' template when I attempt to add a day to the date. It either does not like the implicit conversion with the "+1" and then the use of the "between" with another date or if I attempt to manually convert it has problems with the format mask.
    Scott

  • How to: Schedule a job to run on the first business day of the month

    In Oracle 10.2.0.3, is there a way to schedule a repeating job to run on the first business day of the month? For example, if the first of the month falls on a weekend (such as Saturday, 11/01/2008), I would like the job to run automatically on Monday (for example, 11/03/2008) instead.

    set serveroutput on
    begin
      print_dates('FREQ=MONTHLY;BYDAY=MON,TUE,WED,THU,FRI;BYSETPOS=1;',
          to_timestamp_tz('01-JAN-2008 12:00:00','DD-MON-YYYY HH24:MI:SS'), 12);
    end;
    Gives:
    TUE 01-JAN-2008 (001-01) 12:00:00 -07:00 -07:00
    FRI 01-FEB-2008 (032-05) 12:00:00 -07:00 -07:00
    MON 03-MAR-2008 (063-10) 12:00:00 -07:00 -07:00
    TUE 01-APR-2008 (092-14) 12:00:00 -07:00 -07:00
    THU 01-MAY-2008 (122-18) 12:00:00 -07:00 -07:00
    MON 02-JUN-2008 (154-23) 12:00:00 -07:00 -07:00
    TUE 01-JUL-2008 (183-27) 12:00:00 -07:00 -07:00
    FRI 01-AUG-2008 (214-31) 12:00:00 -07:00 -07:00
    MON 01-SEP-2008 (245-36) 12:00:00 -07:00 -07:00
    WED 01-OCT-2008 (275-40) 12:00:00 -07:00 -07:00
    MON 03-NOV-2008 (308-45) 12:00:00 -07:00 -07:00
    MON 01-DEC-2008 (336-49) 12:00:00 -07:00 -07:00
    and the print_dates function is (10.2):
    create or replace procedure print_dates
      cal_string in varchar2,
      start_date in timestamp with time zone,
      nr_of_dates in pls_integer
    is
      date_after timestamp with time zone := start_date - interval '1' second;
      next_execution_date timestamp with time zone;
    begin
      dbms_output.put_line('  -->');
      for i in 1 .. nr_of_dates
      loop
        dbms_scheduler.evaluate_calendar_string
         (cal_string, start_date, date_after, next_execution_date);
        dbms_output.put_line(to_char(next_execution_date,
                        'DY DD-MON-YYYY (DDD-IW) HH24:MI:SS TZD TZH TZR'));
        date_after := next_execution_date;
      end loop;
    end;
    [\pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How do I add a recurring event to repeat on the fifth recurring day of the month, for example, an event that only happen on the fifth Sunday of the month for those months that have a fifth Sunday?

    How do I add a recurring event to repeat on the fifth recurring day of the month, for example, an event that only happen on the fifth Sunday of the month for those months that have a fifth Sunday?

    Create one on the first Tuesday, select repeat/monthly and take the option at the bottom.

  • Day of the week and the day of the month out of sync

    I'm not sure this is the right forum to post this, so I apologize in advance.
    When I open iCal on my iPhone 4 in day view I see Oct 29 with a W for Wednesday on top of it although below the days of the month it reads: Tuesday, October 29, 2013.
    Is anyone experiencing this problem? Any solution?
    TIA

    Thanks for replying, ChrisJ4203. It's defintely a problem with Brazilian users. Here's a workaround a countryman posted:
    I've managed to fix it:
    Go to Settings / Mail Contacts and Calendars / Start the week on
    Change from Sunday to Monday.
    It appears people in Brazil are the only ones affected.
    It's a good work-around  while apple does not fix this bug.
    Mesmo problema aqui. Como consertar:
    Ajustes / Mail contatos e calendários / Iniciar a semana em:
    Mude de "Domingo" para "Segunda"
    Parece que somente pessoas no Brasil foram afetadas.
    É uma boa forma de contornar enquanto a Apple não repara a bug.
    iPhone 5 - iOS 7.0.3

  • Schedule Executed weekly except for a specific day of the month

    Hi all,
    I need to create a schedule that run weekly every sunday at 9 PM, except for 2nd day of the month it will run at 7 AM.
    I have created 2 schedules:
    1. One to run weekly every sunday at 9 PM, but i don't know from where i can specify the days of the month the schedule will be inactive on it.
    * I have tried By Month Day option, and choose all days of the month except second day of the month to run on it.
    FREQ=WEEKLY; BYMONTHDAY=1,3,4,5,..,31; BYDAY= SUN; BYHOUR=21;
    But, on the schedule preview window as i have designed the schedule from oracle warehouse builder, shows sunday, 02, July for example.
    as an execution date for this schedule.
    which is not appropriate.
    2. Another job is created to run monthly on the 2nd day of the month,
    FREQ=MONTHLY; BYMONTHDAY=2; BYDAY= SUN; BYHOUR=7;
    So, please advice how to create schedules daily or weekly and neglect some days of month from it.

    Hi,
    You can use the exclude clause introduced in 10gR2 for this by creating a schedule when your job should not run and excluding it. An example is given below.
    Hope this helps,
    Ravi.
    create or replace procedure print_schedule_dates
       schedule in varchar2,
       start_date in timestamp with time zone default dbms_scheduler.stime(),
       number_of_dates in pls_integer default 10
    is
      date_after timestamp with time zone := start_date - interval '1' second;
      next_date timestamp with time zone;
    begin
      for i in 1 .. number_of_dates
      loop
        dbms_scheduler.evaluate_calendar_string
         (schedule, start_date, date_after, next_date);
        dbms_output.put_line(to_char(next_date,
                        'DY DD-MON-YYYY (DDD-IW) HH24:MI:SS TZH:TZM TZR'));
        date_after := next_date;
      end loop;
    end;
    begin
      dbms_scheduler.create_schedule('monthday2',
        repeat_interval=>'freq=monthly;bymonthday=2');
    end;
    exec print_schedule_dates('FREQ=WEEKLY;BYDAY=SUN;BYHOUR=21;exclude=monthday2',sysdate+1,30);
    exec print_schedule_dates('FREQ=WEEKLY;BYDAY=SUN;BYHOUR=21',sysdate+1,30);

  • How to create a recurrent event on the first or last work day of the month

    The lightning calendar allows selection of the first and last day of the month for recurrent events but for business I need to use the first and last WORK day of the month (Monday - Friday) to schedule particular tasks. In the calendar preferences under 'View' I can select the days that make up the work week but this does not transfer to an option in recurrent events. Is there another way to do this or is it just not available?

    Hi there,
    do know for the UlltimateBootCD4Win? This from CD bootable WinXP-BartPEedition with additional tools gives you the ability to make such things like partitioning, backup or formatting your HDD.
    It has many more applications which help you to maintain your system without booting your original OS.
    So I think that this CD will solve your partitioning issues.
    Heres a link: www.ubcd4win.com/
    Just try it and tell me your opinion.
    Nice weekend and greetings from the sunny south ;)

  • ICal 3.0: Last day of the month repeating event

    I am migrating back to iCal after a few years using Entourage. I am trying to set up calendar events and reminders for the last day of every month, but I can't figure out how to do it. In Entourage this was easy. Any advice? Thank you.

    I would like this to be an easy feature included in iCal as I get paid on the 16 and second to last day of the month. I want iCal to show the event in the calendar, not for me to set the event and have an alarm for 24 hours before. I tried the trick found at http://www.macworld.com/article/47872/2005/11/trickical.html but that does not work with iCal 3.0.
    Any help would be appreciated or maybe Apple adding this in the repeating section of the ical event seeing it is apart of the icalendar specification.
    tim

  • I want the minimum of the horizontal axis to be the first day of the month.

    I have a situation where I want the minimum of the horizontal
    axis(with date time axis) to be the first day of the month. I
    attempt it like so:
    var max:Date = new Date();//current date is our max from
    which we will calculate the min
    var min:Date = new Date(max.fullYear,max.month,1);
    dateTimeAxis.minimum = min;
    However this first date on this axis is the last day of the
    previous month for example 31 August instead of 1 September. Any
    ideas how to fix?

    Nikos, the only thing I can think of (off hand) is that it's
    defaulting to "zero" hour on that date, if you tried:
    var min:Date = new Date(max.fullYear,max.month,1,13);
    Would that make it work? That would set the date to 1pm.
    Have you considered defining the axis with the data you are
    binding to?
    Cheers,
    David

  • Month end accrual posting date- Last day of the month

    Hi Experts,
    I have set up month end accruals for PY US by configuring posting dates, LDCD, WageType accrual processing class, Schema changes. I have also set the closing dates as the end of the month.
    Now after I do the posting , there are three documents getting generated.
    1. Accrual posting document with first day of the current month
    2. Normal Payroll posting  document with payroll period posting date
    3. Accrual reversal document with first day of the following month.
    My Question is:  As per standard SAP configuration, the month end accrual will have first day of the month. Can we customize this to end of the month for doc#1 - accrual document?
    Please do let me know your suggestion and ideas.
    Thanks,
    Amosha

    Hello,
    I have a similar question and I hope to have more details on how to change the posting date.
    The point is that I have an amount of 1200 and I have to post 100 for each month.
    Key Date for Accruals: 31.01.2011
    I posted 100 with Document date: 31.01.2011 and Posting date 31.01.2011
    Key Date for Accruals: 28.01.2011
    I posted 200 with Document date: 28.02.2011 and Posting date 28.02.2011
    Also I reversed the amount posted in the previous month (100) with Document date: 31.01.2011 Posting date 28.02.2011
    And so on...
    The problem are the dates because I need to post the amount at the end of each month (28/02) and to reverse the previous amount at the beginning of the next month (01/02).
    How can I change these dates?
    Thanks a lot in advance
    Kind Regards,
    E.

  • Getting last day of the month

    hi ,
    is there an existing date funtion to get last day of the month ?
    pls advise
    else
    i'll try to add_month + 1 to current month and format to the first day and minus 1 day from that new month
    tks & rdgs

    last_day function
    <br>
    jeneesh

  • Is there a way to repeat an activity in the calendar monthly on the same day, i.e., the 2nd Wednesday of each month?  I can repeat on the date but not the day of the month.

    Is there a way to repeat an activity in the calendar monthly on the same day, i.e., the 2nd Wednesday of each month?  ( I can repeat on the date but not the day of the month.)

    Not with the stock calendars app.

  • How do I set a recurring event for the last day of the month on iphone 4s calendar?

    I want to set a recurring event for the last day of every month - regardless of the date/number of days in the month. I'd prefer not to have to use an app to do this.

    Hi,
    You can do this using the custom repeat in iCal. You'll need two events to cover the second and fourth Mondays.
    Create the event on the second Monday of the month. In Repeat select Custom... > Frequency: Monthly > On the: second Monday.
    Do the same for the Fourth Monday.
    Best wishes
    John M

  • How to get the first day in the month from a domain date ?

    Hi,
    I like to know how to get the first day in the month from a domain date?
    Thanks
    Stephen

    Hi Gokul...
    Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.
    Its similar to the above one but instead of writing case statement you can achive the following.
    data : w_res type i,
             w_data type d,
    w_res = w_date mod 7.
    w_date = w_date - w_res.
    write w_date.
    This works.
    Regards,
    Siddarth

Maybe you are looking for

  • Equalizer app that works with pandora?

    Is there an equalizer app that works with pandora?  I just got a new Rav4 w/ a sucky sound system & I'm hoping to juice it up a bit.  Thanks,

  • System Time Stamp Indicator?

    I'm trying to use the "System" theme for my front panel, and my controls and simple numeric indicators converted over (from "Modern"). However, I noticed that there is no simple "Time Stamp Indicator" apparent on the System > Numeric (or elsewhere).

  • Printing from websites using Internet Explorer

    I use Internet Explorer and have an HP Photosmart 7350 printer.  Whenever I print a page from a website, the print is extremely small.  Is there a solution to this other than to copy and paste the page to Word and adjust the font there? 

  • My Macbook is running very slowly...

    It runs very slowly sometimes, even when I quit programs to reduce workload etc. Any ideas about how to tell what's going on?

  • How to cancel a phone?

    We have two phones with Verizon Wireless, and called the national customer service number to cancel one of them, but keep the other. We called the day before the two-year contract was up. The customer service rep was very helpful and polite, and assu