No of days in a month

hi to all,
is there any functional module to find the no of days in the month
like 31 or 30 or 28 like that
thanks in advance
kiran kumar

just try this ..
try with a parameter also ..
data : date like sy-datum.
data:  v_mnt LIKE  T009B-BUMON,
       v_yr  LIKE  T009B-BDATJ,
       days  LIKE  T009B-BUTAG.
date = sy-datum.
write : date+0(4) to v_yr,
        date+4(2) to v_mnt.
CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
  EXPORTING
    par_month       = v_mnt
    par_year          = v_yr
IMPORTING
   PAR_DAYS       = days.
   write:/'Number of days',  days.
or ...
data : date like sy-datum.
parameter p_date like sy-datum.
data:  v_mnt LIKE  T009B-BUMON,
       v_yr  LIKE  T009B-BDATJ,
       days  LIKE  T009B-BUTAG.
date = p_date.
write : date+0(4) to v_yr,
        date+4(2) to v_mnt.
CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
  EXPORTING
    par_month       = v_mnt
    par_year        = v_yr
IMPORTING
   PAR_DAYS        = days.
   write:/'Number of days',  days.
regards,
vijay
Message was edited by:
        vijay k

Similar Messages

  • Report for current day and current month

    Hi gurus,
    i 've a report, where i 've to display the values for qty and cost of the material for the current day and current month
    HOw can i do this in BEx Query designer..If any document plz share
    thanks
    rakesh

    hi Kolli
    here i want to filter the data on system date,
    i wnt the report to pick the date dynamically based on the system date.
    but i think restricting on calmonth and calday is not going to solve my scenario..
    rakesh

  • How can I set an event to repeat on a week day rather than a numerical day of each month?

    How can I set an event to repeat on a week day rather than a numerical day of each month? I see an option at the bottom of the repeat window .... but I cannot use it. Actually, when I try it freezes up my Calendar.
    Lorrene Baum Davis

    These scrrenshots are from Snow Leopard - I would think that Lion wouldn't be too much different.

  • Defining last day of previous month in ABAP

    All,
    I am a BW guy and hardly know ABAP. I have a requirement where I have to calculate last day of previous month and use it in the routines of the transformations.
    I have decided to define the Last day of previous month in Start routine and then use the global variable in Transformations to calculate further.
    The logic that i have used is outlined below.
             Define G_DATE in global declaration for further use in Transformations.
    In the Routine section,
            Assign G_DATE to SY-DATUM
            G_DATE + 6(2) = '01' (Replace last to field of date with '01' to establish first day of the current month)
            G_DATE = G_DATAE - 1 (To get to last day of previous month)
    My dilemma is to implement this in ABAP in Start routine of transformations. Please include the exact ABAP code that would be needed in Declarations and Routine section.
    Thanks in advance.

    Hi..,
    Go with the function module: LAST_DAY_OF_MONTHS
    So, Just determine the last month from the sy-datum and then use above function module and pick the last date of the month.
    Thanks,
    Naveen Inuganti.

  • Successive dates with  last day of that month being added to succesive date

    Hi ,
    I have a piece of code that displays the succuessive dates from the given date to tilll date with a date interval of 30 days. My requirement goes some thing like this. since the given date is '26-nov-08' the next successive date should be the number of days in nov(30) added to '26-nov-08'. that will be around 26-dec-08. For this date it has to add the number of days in December(31) to '26-dec-08' and that turns out to be '26-jan-09'. and this must go on till date.
    In the below code i have used 30 for the interval of 30 days but the interval has to the last day of the successive date's month( for dec the interval has to 31 and for january the interval has to be 31 and for february 28)
    select to_date('26-nov-08', 'dd-mon-yy') + (level - 1) * 30
    from dual
    connect by level <= trunc((sysdate-to_date('26-nov-08', 'dd-mon-yy'))/30 )Please advice

    hi ,
    the query sent by you is correct and could it be in corporated for this query :
    SELECT TRUNC(inst_due_date) + (LEVEL-1 ) * (ilpa_term_type),iloan_code,LOAN_AMT,FEE_AMT,
    LOAN_DATE,LOAN_STATUS_ID
    FROM (
    SELECT inst_due_date,sm.iloan_code,LOAN_AMT,
    FEE_AMT,
    LOAN_DATE,
    LOAN_STATUS_ID,
    decode(sm.ilp_term_type, 26 ,14,24,15,12,(select to_number(to_char(last_day(inst_due_date),'dd')) from dual)) as ilpa_term_type
    FROM ST_IL_SCHEDULE sc,ST_IL_MASTER sm
    WHERE sc.iloan_code = sm.iloan_code
    AND sc.inst_num = (SELECT MAX(inst_num) FROM ST_IL_SCHEDULE b WHERE b.iloan_code = sc.iloan_code)
    AND sc.iloan_code =123456789)
    CONNECT BY LEVEL <= TRUNC((TRUNC(SYSDATE)-TRUNC(inst_due_date))/(ilpa_term_type) )
    Here we are using the decode concept if ilp_term_type = 26 then 14 but we need to implement the code of adding the number of days to that month in place of this code :
    select to_number(to_char(last_day(inst_due_date),'dd')) from dual:
    Please advice

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

  • How to calculate the number of days until your next birthday. Only using current month, day and birth month and day.

    I'm trying to calculate the number of days until your next birthday. Only using current month, day and birth month and day. I can get close but i'm way off. When i enter in the next day, the amount of days is supposed to be 364. This is where I am having problems. I know my code is way off. I just need some guidance please!
    Attachments:
    D5.7_1.vi ‏8 KB

    I just had a little fun with the Time Record...
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    D5.7_1_BD.png ‏19 KB

  • Current day and no of days in current month

    Hi all,
    can anbody tell me which object is used for current day and no of days in current month.

    Hi,
    USe /OSP/GET_DAYS_IN_MONTH Function Module, just give Date you will get No. Of days in that Month.
    Use SY-DATUM for current date.
    Ex:
    Data: dt type SY-DATUM.
    dt = SY-DATUM.
    so you get current date in dt.
    Thanks
    Reddy

  • How to create report which includes records of current month and last 7 days of previous month.

    Hi Experts,
    I need to create a report which includes records of current month and last 7 days of previous month.
    I will get records of current month by this formula :- month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)
    Please tell me how to add the records of last 7 days of previous Month for the same report.
    Thanks in Advance.

    Hi Ajay,
    If you have more than a year data in your database then your formula will return wrong results. ie. If your data consist of 2012,2013,2014 data then below formula will return all 8th month data irrespective of year. So, you need to check year also here
    month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)  and
    Year({PROBSUMMARYM1.OPEN_TIME})=Year(currentdate)
    Now add Abhilash second statement in OR so, your formula should look like :
    (month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)  and
    Year({PROBSUMMARYM1.OPEN_TIME})=Year(currentdate))
    OR
    Date({PROBSUMMARYM1.OPEN_TIME}) IN [DateAdd('d',-7,Maximum(LastFullMonth)), Maximum(LastFullMonth)
    -Sastry

  • Amount of days in a month

    Hi. How do I retrieve the amount of days in a month? Thanks.

    here is a long way....
    if the  month is January return 31
    if the  month is Feburay return 28 or was this year a leap year.......
    if the  month is March return 31
    ........ and so one..
    //but there is a better way just figure it out!!!!!David

  • How to get the last day of a month?

    HI,
    I want to know how to get the last day of a month.
    In my JClient form, I tried to get it by using oracle.sql.Date method, that is:
    lastday=oracle.sql.Date anydate.lastDayOfMonth();
    But it does not work. The result is lastday=anydate.
    Why?
    Stephen

    You can use the Calender class...
    Calendar c = Calendar.getInstance();
    and then something like...
    c.add(c.MONTH, 1);
    int dayOfMonth = c.get(Calender.MONTH);
    c.add(c.DAY_OF_MONTH, - (dayOfMonth-1) );
    other usefull functions are:
    System.out.println(" YEAR : " + c.get(Calendar.YEAR));
    System.out.println(" MONTH : " + c.get(Calendar.MONTH));
    System.out.println(" DAY_OF_MONTH : " + c.get(Calendar.DAY_OF_MONTH));
    System.out.println(" DAY_OF_WEEK : " + c.get(Calendar.DAY_OF_WEEK));
    System.out.println(" DAY_OF_YEAR : " + c.get(Calendar.DAY_OF_YEAR));
    System.out.println(" WEEK_OF_YEAR : " + c.get(Calendar.WEEK_OF_YEAR));
    System.out.println(" WEEK_OF_MONTH : " + c.get(Calendar.WEEK_OF_MONTH));
    System.out.println(" DAY_OF_WEEK_IN_MONTH : " + c.get(Calendar.DAY_OF_WEEK_IN_MONTH));
    System.out.println(" HOUR : " + c.get(Calendar.HOUR));
    System.out.println(" AM_PM : " + c.get(Calendar.AM_PM));
    System.out.println(" HOUR_OF_DAY (24-hour): " + c.get(Calendar.HOUR_OF_DAY));
    System.out.println(" MINUTE : " + c.get(Calendar.MINUTE));
    System.out.println(" SECOND : " + c.get(Calendar.SECOND));
    System.out.println();*/

  • Multi day events in Month View.

    Multi day events in month view only display on the first day. Checking all day event fixes this, but none of my multi day events are in fact all day. If I sync with my iphone, it does mark both days on the multi day event in month view.
    In week view they display correctly, but I like to have the month drawn out.
    I am surprised to come across this hang up. Other calendars I have used always displayed such events across the month view.
    Is this a bug or lack of feature?
    R

    Bug or design flaw?
    Try setting it as a recurring event (yeah, I know, it's not a great solution, but it gets the job done)

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

  • View Outlook Calendar on iPhone In Day, Week, Or Month Views--NOT As A List

    I apologize in advance if this has been asked already but couldn't find the answer after an extensive search.
    My question is, after syncing my Outlook calendar to the iPhone, how can I view my appointments other than as a list in the iPhone? I would like to view my appointments in either day, week, or month views as opposed to only knowing what my next two or three appointments are. To me it just seems like a simple setting I'm overlooking somewhere. I appreciate any help you can afford
    Thanks in advance,
    -V5

    *iPhone calendar views are a joke!*
    My 90's Palm Vx had far more usable views via Pimlico Software. The gray scale display with poor resolution was able to show one or even two weeks with appointment texts.
    What does iPhone have? List view is the best there is. One sees all appointments with only just scrolling. Day view is terrible. The whole day should be visible without scrolling for it to be at least somewhat efficient. Now one has to first select a day with arrows and after that scroll thru the day and after that select another day and scroll again. No way. Month view is very poorly designed! The grid takes way too much space and who decided to put the appointment list in the bottom of the screen when one's index finger blocks it if sliding thru days in the grid!!! Oh man!!! Unlock the landscape view and please make the grid a little bit smaller and please place the appointment list on the left or at least on the right side. And make its font way smaller! No point in seeing two appoinments without scrolling.
    iPhone's wonderful screen would be able to show one or two weeks with written appointments in a list like manner especially landscape. I mean seven columns titled Mo-Su and all appointments listed in that day's column.
    Hopefully SDK will let someone else do it if Apple won't.
    And we have to get to copy appointments and paste them to other days also. I am spending 30 min writing the same info one at a time to our monthly plan. Everyone else is already having a cup of coffee.

Maybe you are looking for

  • I want to set up new iPhone correctly when it arrives! Please advise

    I own a 4s. My husband's iPhone arrives in 2 days. We share a Mac book and have a family iPad. I have read all of the posts about the benefits of sharing an apple ID for purchases and apps but that it is best to use different IDs for the iCloud. Our

  • Error: ORA-16532: Data Guard broker configuration does not exist

    Hi there folks. Hope everyone is having a nice weekend. Anyways, we have a 10.2.0.4 rac primary and a 10.2.0.4 standby physical standby. We recently did a switchover and the dgbroker files automatically got created in the Oracle_home/dbs location of

  • File Manager slow and fails

    STA100-3 10.2.1.2991 I notice that sometimes the File Manager is slow or does seem to work. In particular, SMS Backup app (which has worked for over  a year) has started to fail when it calls the File Manager. The app developer doesn't see this, but

  • HTTP Connection For Proxies

    Hi all, Can anyone explain me how to create the http connection in SM59. Here iam getting a status error as HTTP_CONNECTION_FAILED here my scenario is File to Proxy Suggest me where i have to make this connection means in XI or SAP system regarding t

  • Will I lose my bookmarks if I have to reinstall Windows and then download Firefox again?

    I have to reinstall Windows XP. I will of course lose all of my programs and will have to reinstall Firefox. When I do that, will I lose my bookmarks, passwords, and other settings?