Last date of the month

Hi All,
Can anyone tell me the logic to get the last date of the month for vbrk-fkdat. The date format is dd/mm/yyyy. i need the output on the same format.
for ex: if vbrk-fkdat = 17/12/2007 the output should be 31/12/2007.
Thanks,
Madhu

actually the FM only takes date like sy-datum. but my variable is
i had made the changes like -
data: gv_date(10) TYPE c,
        gv_date1(10) TYPE c.
CONCATENATE wa_vbrk-fkdat6(2) wa_vbrk-fkdat4(2) wa_vbrk-fkdat+0(4) INTO gv_date SEPARATED BY '/'.
  REPLACE ALL OCCURRENCES OF '/' IN gv_date WITH '.'.
      CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
        EXPORTING
          day_in            = gv_date
        IMPORTING
          last_day_of_month = gv_date1.
REPLACE ALL OCCURRENCES OF '.' IN gv_date1 WITH '/'.
but its showing the error as the variable declaration is different as it is in FM, i.e FM contains date type sy-datum.
please reply ASAP.
Thanks,
madhu

Similar Messages

  • Terms of Payment to determine due date as last date of the month

    Hi Experts,
    Does any one know how to configure a Terms of Payment to determine due date as last date of the month ?
    I tried by puting fixed date as 31 in the Terms of Payment in FI but when I am creating in FI-CA it gives me an error "_Term of payment Z003 is inconsistent/not planned_"
    Please advice.
    Thanks & Regards
    Satyajeet

    Hi Satyajeet,
    It seems the settings that you have maintained in FI are correct.
    When you are assigning the payment terms in FI-CA, you need to assign a factory calendar as well to the payment terms in the following config-
    IMG->Financial Accounting ->Contract Accounts Receivable and Payable->Postings and Documents->Document->Maintain Payment Terms
    If you have already assigned the factory calendar and still the problem persists, can you give the message ID and the message number of the error that you are getting?
    Thanks,
    Amlan

  • Want last date of the month as default basic finish date for the Proc order

    For forward scheduling type in process order, irrespective of the start date i want last date of the month as my  basic finish date.
    Ex start date can be 01/10/2009 or 15/10/2009, but the basic finish date should be 31/10/2009.

    Hi Sam,
    sorry to say , its not possible in standard SAP.
    1) If, on order creation, a planned order exists for the production order/ process order, the basic dates are copied from the planned order.
    2)If no planned order exists on order creation, you must specify at least one basic date.
    The scheduling type determines the basic dates that you must specify. and it useses timings from routings for scheduling.
    so may be you need some work around.
    explain your requirement why do you want to fix it for the last day of month and other constraints, may be we can find some way.
    Regards
    Ritesh

  • To display Last Date of the Month in Financial Reporting studio 9

    Hi
    I want to display last date of the month in header in Financial Reporting studio 9 . Is there any function which displays the last date of the month as per user selection .
    for example
    If user select month of Jan it should display Jan 31st, 2009
    If user select month of Feb it should display Feb 28th 2009
    Thanks

    Unless you name your Months like that you cannot do it. A large team from a major consulting firm told me for a year that it was not possible and convinced management that financial statements don't need dates.
    Management decided that we do need dates (because all financials need dates, look at any text book). I figured out a pretty sweet solution that is simple and easy to use and maintain. The users love it. Management loves it.
    I'm not giving it away though.

  • Please help.........how can i get the last date of the month?????

    Hello....
    I want to get the last date of the month.
    For example, the last date of Jan is 31.
    How can I get the last date of the particular month and year ????
    Thanks for help.
    Gloria

    Hi Gloria
    1. How can I compare the date???date1.compareTo(date2)
    where date1 and date2 is a java.util.Date Object
    will return 0 if it is the same date
    or
    date1.after(date2)
    where date1 and date2 is a java.util.Date Object
    will return true if date1 is after date2
    (the same for date1.before)
    2. How can I change the date format into yyyymmdd format???? I just want the year, month and date.try the java.text.SimpleDateFormat Object
    new SimpleDateFormat("yyyymmdd").format(yourdate)
    Hope this help.
    Please also have a look at a calendar I wrote, (maybe it help)
    demo & source :
    http://www.geocities.com/globe_software/java/components/
    globe_sa

  • ABAP code to derive last date of the month from month input.

    Hi ,
    how to derive the last date of of month for the for user exit variable
    Hussain Reddy

    Hi,
    See the following code.. .
    WHEN 'ZLDAY'.    " Customer Exit variable on 0CALDAY
      IF i_step = 2.
         data: fd type sy-datum,
               ld type sy-datum.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZDAY'.   " User entry date on 0CALDAY
            IF sy-subrc = 0.
              CLEAR: l_s_range.
              fd =  loc_var_range-low.
          CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
                  EXPORTING
                    day_in                  = fd
                 IMPORTING
                   last_day_of_month       = 
    *             EXCEPTIONS
    *               DAY_IN_NOT_VALID        = 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.
             l_s_range-low = ld.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
                APPEND l_s_range TO e_t_range.
           ENDIF.
      ENDIF.
    Simple Program.
    Just copy past in SE38 and test and use the logic for your requiremet
    REPORT  ztest1.
    data: fd type sy-datum,
             ld type sy-datum.
          fd = sy-datum.
          CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
            EXPORTING
              day_in                  = fd
           IMPORTING
             LAST_DAY_OF_MONTH       =  ld
    *       EXCEPTIONS
    *         DAY_IN_NOT_VALID        = 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.
    write:/ ld.
    further help on exitc you ca see the articles.
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    Thanks
    Reddy
    Edited by: Surendra Reddy on Dec 15, 2009 11:38 AM

  • How  we claculate the first and last date of the month

    hi,
    I have a requirement, if i have the any date of a month like today date 02/13/2008. So i want the first date of this month and the last date of this month.
    Is there any FM for this..or if you have nay prorgam pls send to me.
    thanks.

    Hi Vipin,
    Try
    HR_JP_MONTH_BEGIN_END_DATE FM will return both first day and last day
    LAST_DAY_OF_MONTHS  for getting last day of month.
    Reward if helpful.
    Regards,
    Mandeep

  • How to find FIRST and the LAST date of the month.

    Hello,
    I want to find the first and the last date of the current month through query. How is it possible please help.
    For example if the current month is july. The first date should be 01-JUL-2006 and the last date would be 31-JUL-2006.
    Please help me.
    Regards,
    Imran Baig

    Like this?
    SQL> select trunc(sysdate,'MM') "First_Day",
      2        last_day(sysdate) "Last_Day" from dual;
    First_Day Last_Day
    01-JUL-06 31-JUL-06
    SQL> select trunc(to_date('10-FEB-04'),'MM' ) "First_Day",
      2       last_day(to_date('10-FEB-04')) "Last_Day" from dual;
    First_Day Last_Day
    01-FEB-04 29-FEB-04

  • First and Last date of any Month.

    Hi Friends,
    I have 2 fields in my table
    FROM DATE & TO DATE
    User can enter any date in these two fields, but at time of commit i want to change the FROM DATE to the first date of the Month user have entered. And for TO DATE i want to change the last date of the month.
    For Example :
    User Enters-
    FROM DATE 12-Mar-2003
    TO DATE 27-Jun-2003
    I want to change these date to:
    FROM DATE 01-Mar-2003
    TO DATE 30-Jun-2003
    How can I write a database function or procedure to control this thing.
    Please help.
    Best regards,
    Imran Baig

    It depends on your requirements, but I usually use TRUNC(date, 'D')
    to get the first day(Sunday) of the week, because TRUNC(date, 'W')
    returns the same day of the week as the first day of the month.
    See http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a85397/function.htm#80101
    for more info on this.

  • 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

  • Mdx query to get the last date of every month if the month is current month need current date..

    i have a scenario where i need the data of last date of every month and if the month is current month need current date data...
    is it possible using MDX...

    Hi Shashi,
    According to your description, you want to return the last day for each month except current month, right?
    In MDX, we can use ClosingPeriod function to return the member that is the last sibling among the descendants of a specified member at a specified level, here is a sample query for you reference.
    with member [measures].[a]
    as
    ClosingPeriod ([Date].[Calendar].[Date],[Date].[Calendar].currentmember).name
    select {[measures].[a]} on 0,
    [Date].[Calendar].[Month].members on 1
    from
    [Adventure Works]
    And then use the IIF function to evaluate if the month is current month. Please refer to the links below.
    http://msdn.microsoft.com/en-us/library/ms145584.aspxhttp://msdn.microsoft.com/en-IN/library/ms145994.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to get the last date of that month after adding the two month.

    Hi,
    I have a requirement, My input is month/lastdate of the month/year after adding 2 months i want the same format mont+2/lastdate of the month/year.
    Please let me know the exact FM for this.
    I have check this FM RE_ADD_MONTH_TO_DATE.
    Input:                                           
    Import parameters               Value    
    MONTHS                          02       
    OLDDATE                         02/29/2008
    Output:                                           
    Export parameters               Value     
    NEWDATE                         04/29/2008
    But this wrong because i am expecting the last date of the April.
    2) I have checked another FM that also also shows the wrong output: RP_CALC_DATE_IN_INTERVAL                                                
      Import parameters               Value         
      DATE                            12/31/2008    
      DAYS                            00            
      MONTHS                          02            
      SIGNUM                          +             
      YEARS                           00                                                                               
    Export parameters               Value         
      CALC_DATE                       03/01/2009    
    Thanks In avance,
    Thanks & Regards,
    Venkata

    Hi,
    do the RE_ADD_MONTH_TO_DATE then
    Plug the result date into FM RP_LAST_DAY_OF_MONTHS
    Regards
    Stu

  • Last Date of the next month

    Hi,
    How to find the last date of the next month.
    Thanks in advance
    Sunitha

    Use the below mentioned FM
      call function 'LAST_DAY_IN_PERIOD_GET'
        exporting
          i_gjahr              = p_finyear
          i_periv              = 'X1'
          i_poper              = lv_popere
        importing
          e_date               = p_edate
        exceptions
          input_false          = 1
          t009_notfound        = 2
          t009b_notfound       = 3
          others               = 4.
      if sy-subrc <> 0.
      endif.
    Supply the proper parameters, u will get the last date in  the next month.

  • FM for the last date of the previos month

    Hi folks
    my requirement is if we enter the calendar month say YYYYMM in the selection
    screen. it has to get the previous month last date in the format DDMMYYYY
    For eg.,  selection screen input  200704
                required output : 31/03/2007
    Is there any standard function module.
    please urgent
    Thanks in Advance
    Rao

    Hi,
    Please try this.
    data: wa_idate like sy-datum,
          wa_odate like sy-datum.
    wa_idate(6) = p_date.
    wa_idate+6(2) = '01'.
    wa_odate = w_idate - 1.
    OR
    call function 'RP_CALC_DATE_IN_INTERVAL'
      exporting
        date      = wa_idate
        days      = 0
        months    = 1
        signum    = '-'
        years     = 0
      importing
        calc_date = wa_odate.
    write: / 'Last date of the previous month: ', wa_odate.
    Regards,
    Ferry Lianto

  • Object date - how to get the last day of the month?

    hi all,
    I have a date object in which I would like to get the last day of the month. any idea?
    eg AUG=31
    Feb = 28 (depends if a leap year)
    thanks

    Use java.util.Calendar
    Add 1 month to the day.
    Set the day of month to be 1.
    Subtract 1 day.
    Now you are on the last day of the month you wanted.

Maybe you are looking for

  • Nokia N70 and iSync 2.4 fails

    I've for some time been iSyncing my Nokia N70between my G5 and my PC/Outlook. Everything worked fine untill the 10.4.9 update. After the update the bluetooth sync does no longer work. My Mac and phone connects for a short moment after which they are

  • How do I recover a download I saved but will not open so that it opens?

    I downloaded a file from my yahoo mail messages yesterday that appeared as "read-only" so I went through the trouble of right-clicking the file in the containing folder and unchecking the "read only" and spent 2 hours adding writing to the document b

  • "System Resource Exceeded" for simple select query in Access 2013

    Using Access 2013 32-bit on a Windows Server 2008 R2 Enterprise. This computer has 8 GB of RAM. I am getting: "System Resource Exceeded"  errors in two different databases for simple queries like: SELECT FROM .... GROUP BY ... UPDATE... SET ... WHERE

  • After effects error, please tell me how to fix

    Whenever I open after effects it says "After effects error: Warning: Frame Size Input Error, Layer base size must be the same, time for some precomp maybe? (512)      ( 25 :: 241 )" And when I try to ram preview, it says "After effects error: RAM Pre

  • Program failure in Photoshop

    My Photoshop says that there is a program failure. Shall I uninstall the whole package CS6 and then install it again?