Function module to get the same date of the previous month

Hi
Can anybody tell me how to get the
same date of the previous month.
example if i am entering date as 30 may 2007
i want the date as 30 april 2007

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = pa_end
days = '00'
months = '01'
signum = '-'
years = '00'
IMPORTING
calc_date = pa_end.
ENDIF.
nd try below FMs as well...
CCM_GO_BACK_MONTHS
HR_PT_ADD_MONTH_TO_DATE
RP_CALC_DATE_IN_INTERVAL
Hope it will solve your problem...
Reward points if useful..
Thanks & Regards
ilesh 24x7

Similar Messages

  • Functional module for Getting Material classification data.

    Please tell me Functional module for Getting Material classification data like class type , class, characteristics and characteristics values for material.

    Dear,
    FM:
    CLAF_CLASSIFICATION_OF_OBJECTS
    Table KLAH Class Header Data
    - KSML Characteristics of a Class
    Regards,
    R.Brahmankar

  • BAPI or Function Module to get MSEG table data based on PO Number (EBELN)

    Hi
    1. Is there any BAPI /  Function Module to get PO details based on Plant and PO date?
    2. Is there any BAPI / Function Module to get Material document details(MSEG data) based on PO number?
    Thanks
    Narendra

    Hi,
    check the Bapis Givem below
    BAPI_PO_GETITEMS
    http://abap.wikiprog.com/wiki/BAPI_PO_GETDETAIL1
    you will get the detail.
    Regards

  • All the dayname dates of a previous month

    i have a date '01/25/2015' which is sunday. how to get all the sunday dates of the previous month 
    so the result is
    07/12/2014,   14/12/2014,   21/12/2014,    28/12/2014

    Because you asked to see all Sundays in Previous Month. I am guessing you want the same day(Monday, Tuesday, ...) from previous month based on the day that you passed. 
    If so, please check:
    DECLARE @Today DATE = CURRENT_TIMESTAMP -- You can change to any date that you want
    DECLARE @myDate DATE = DATEADD(MONTH, DATEDIFF(MONTH, '01/01/1900', @Today) - 1, '01/01/1900')
    WHILE @myDate < DATEADD(MONTH, DATEDIFF(MONTH, '01/01/1900', @Today), '01/01/1900')
    BEGIN 
    IF DATEPART(WEEKDAY, @myDATE) = DATEPART(WEEKDAY, @Today) 
    BEGIN 
    PRINT(@myDate) 
    END 
    SET @myDate = DATEADD(DAY, 1, @myDate) 
    END 
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • Is there a Function module to get customer hierarchy data?

    Howdy,
    I'm writing a report where the user can, on the selection screen, enter a customer number or a hierarchy node and then the program has to get all the higher level nodes and  and lower level nodes for the selected Sales area.
    eg. for the following hierarchy:
    A
    ->B
    --|-> D
    --|-> E
    -> C
    ---|-> F
    ---|-> G
    if node b was selected it would pull back:
    KUNNR     HKUNNR
    A         blank
    B         A
    C         A
    D         B
    E         B
    F         C
    G         C
    Anyone know if there is a Function module that can do this?
    Thanks

    Hi Victoria,
    even i was using the same FM "RSNDI_SHIE_STRUCTURE_GET3"
    my code goes like this...
    i am passing hierarchy name and  node name...this is for cost element hierarchy.
    please check the code and tell if i am missing anything.
    o/p i am getting is all 0's.
    report ztest5.
    tables : ZREPCODMAP.
    data: itab type standard table of ZREPCODMAP with header line.
    TYPES: BEGIN OF STRUC,
             RESULT type RSSH_S_NODEBYNAMEWOL,
            ZREPCODMAP-REPDSELM,
            END OF STRUC.
    DATA: itab1 type standard table of struc with header line.
    data: w_hiesel like RSNDI_S_HIESEL.
    w_hiesel = '1000KES'.
    *data: w_nodebyname type RSNDI_T_NODENM.
    data: tab type standard table of RSNDI_S_HTAB with header line.
    data: lsubrc type SY-SUBRC.
    select * from ZREPCODMAP into table itab where PROFIT_CTR <> ' '.
    loop at itab.
    concatenate itab-CO_AREA itab-REPDSELM INTO itab1-RESULT.
    *write: itab1.
    break-point.
    CALL FUNCTION 'RSNDI_SHIE_STRUCTURE_GET3'
    EXPORTING
    I_S_HIEKEY =
    i_s_hiesel = w_hiesel
    i_s_subtreesel = itab1-result
    I_T_NODENAME =
    I_NO_NODENM_TABLE = w_flag
    IMPORTING
    E_S_HIEDIR =
    e_subrc = lsubrc
    TABLES
    E_T_HIEDIRT =
    e_t_hierstruc = tab.
    E_T_MHIERNODE =
    E_T_THIERNODE =
    E_T_HIERINTVL =
    E_T_NODENAMES = tab.
    E_T_NODEATTR =
    E_T_LEVEL =
    E_T_MESSAGE =
    write: tab.
    *write: lsubrc.
    endloop.
    Thanks & Regards,
    Vijaya

  • Function module for getting periods for date range

    Hi,
    Can anybody tell me the function module which will return the periods along with the year, when we give a date range.
    e.g
    01011999 to 120112000
    so it shoud return peroids between these date with year. Its possible thru programatically, but i m checking if there is any FM, so i can use FM.
    Thanks,

    Hi,
    You can use function module which works exactly what you are expecting FIMA_DAYS_AND_MONTHS_AND_YEARS.
    please reward points to useful answers.
    Thanks,
    Sriram Ponna.

  • Function Module for getting Payroll start date and end date

    Hi Gurus,
      If I give one date then is there any function module to find the payroll period start date and enddate for that given date?
    Points will be awarded
    Thanks
    Ravi

    Hi,
      Try these FMs
    HR_PAYROLL_PERIODS_GET
    HR_BEN_PAY_GET_PAYROLL_PERIODS
    HR_PAYROLL_PERIOD_GET
    HR_P06I_GET_PAYROLL_PERIOD
    Regards,
    PRashant

  • Functional module which get triggered after posting of the document F-22

    Hi,
    I am posting the documents using the transaction F-22. I need to update some table after the documet will get post.
    I try to find out the BTE'S in the transaction FIBF but unable to find it out.
    Can anyone help me to find out the relvant functional module which will get triggered after the posting of the documents.
    Please help me with this.
    Thanks in advanced.
    Regards,
    Darshana

    Hi Harini,
    It is also not get triggered while i am posting the documents.
    Can you please suggest me some more functional modules.
    Thanks in advanced.
    Regards,
    Darshana

  • Function module for getting teh last working day of a month.

    Hi GURUS,
    this is criteria,please help me 
    if V_T001B- FRYE1 < month entered in selection screen
              Then throw the error message
                Else
    Find the previous period and its last working day from the function module
          (i..e Assume entered date as June 2 2009 then
                   Period 6 -1 = 5.
         Pass the month 05 to function module then
                   Find last working day.
                   Keep it in a variable (V_LAST_PRD_WRKDAY)
                           Proceed further.
    thanks in advance,
    Rajeev

    Hi Rajeev,
    You can use Function Module LAST_DAY_IN_PERIOD_GET.
    Ex:
          CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
            EXPORTING
              i_gjahr = p_gjahr
              i_periv = lwa_t009b-periv
              i_poper = lwa_t009b-poper
            IMPORTING
              e_date  = s_audat-high.
    Regards,
    Ravi K

  • ICal displays twice the same date on the calendar

    Ater upgrading to 10.6 and 10.6.1, iCal messed up previous calendars, duplicating a day in the calendar. Specifically, in my case, "Saturday, 17th October" appears twice, one after the other (in portuguese). This affects all future events, which now are shown one day earlier than they should.
    I've seen this bug in iCal before, some time ago, so perhaps it is not something specific to this version. Anyway, it is hard to believe that such errors can occur... embarrassing.
    The image to the problem is on http://files.me.com/marinho.barcellos/8ux17j
    Marinho.

    I think I got it (at least for me)! The time zone comment from "The Cowboy" got me thinking . . .
    I set my System Preferences, Date & Time to another time zone with the same offset from GMT as where I live, but a place without Daylight Savings (Lima). I then exported a VCAL from Palm Desktop and imported into iCal. It worked!! The single all-day events were not 2-day events no matter when they were on the calendar (DST or not). The single day events at a specific time were all correct for their time of day, again no matter what month they were in.
    Next step, the iPod. I set my Settings, "Mail, Contacts, Calendars," Calendars, Time Zone Support, ON, Time Zone of Lima. Then synced m iPOD with Info, Calendars, Sync iCal set, and voila, everything shows up exactly as I want.
    I think I might have "turned off" the Daylight Savings processing and I don't know what else it might do, but for now, it works. What a way to run a railroad, though.
    I never have liked iCal with its impossible colors and too-small display. This DST thing puts a nail in the coffin for iCal for me.
    Thanks, El Gaucho, for the tip on time zones. Never in a million years would I have tried anything like that.

  • The successor activity begins on the same date as the predecessor finishes.

    How do I extend the working hours for each activity. I am currently encountering this problem.
    My calender is set as 8 hours day, 0800hr - 1700 my activity are as follow -
    Activity ID     Activity Name               Start      Finish
    A1020     1     16-May-12 08:00     16-May-12 17:00
    A1010     2     17-May-12 08:00     17-May-12 17:00
    A1000     3     18-May-12 08:00     18-May-12 17:00
    But when I change the calender to a 10 hour work day, it becomes
    Activity ID     Activity Name          Start     Finish
    A1030     1     16-May-12 08:00     16-May-12 17:00
    A1040     2     16-May-12 17:00     17-May-12 15:00
    A1050     3     17-May-12 15:00     18-May-12 12:00
    Is there anyone to change is such that my all my activity starts at 0800hr and finishes at 1900hr (10hour work day)?
    I have changed my settings in 'Admin Preference' ->'Time Period' ->'Hours per Time Period' to 10 hours/day and selected the "Use assigned calender to specify the number of work hours for each time period". But its still the same.
    Edited by: 934917 on May 17, 2012 5:01 PM

    Simply change your "Original Duration" from 8 hours to 10 hours. If it is a lot of activities, perform a global change that says: If(Original Duration = 8h) Then(Original Duration = 10h), or if you prefer Then(Original Duration = Original Duration + 8h)

  • Function module to get Pricing conditions of billing document

    Hi All,
    Please help me getting the pricing condition values for a billing document.  I got values from KONV table against perticular Condition type. but i need to get the values against step number maintained in Conditions for my billing item. is there any function module to get all condition data maintained in document with totals and discounts aswell.
    Please help me.  if required i will give tou full details what i required.
    Kumar.

    Hi Kumar,
    Please check below mentioned Function Module for details:
    RV_PRICE_PRINT_GET_BUFFER
    RV_PRICE_PRINT_GET_MODE
    RV_PRICE_PRINT_HEAD    (Header)
    RV_PRICE_PRINT_HEAD_BUFFER
    RV_PRICE_PRINT_ITEM       (Item)
    RV_PRICE_PRINT_ITEM_BUFFER
    RV_PRICE_PRINT_REFRESH
    Regards,
    Tutun

  • Getting the same day of the week from a previous year in a Power Query calc column

    Hi Power Query users,
    Would like to get your suggestions on this problem. I have a customer that wants to see the previous year's sales for the same day of the week. So today is Friday July 25, 2014. Customer would like to see sales for the closest Friday on the previous year,
    which was Friday July 26, 2013. Next year on Friday July 26, 2015, customer would see the sales for Friday July 25, 2014 and so on. Customer operates 7 days a week, all days of the year including holidays.
    What is the most elegant way to do this? I am assuming the best thing to do is to add this date as a calculated column in the date table, but I am not quite sure the best way to write the formula (including handling of edge cases - leap years, providing
    null when the previous year is not part of the date table, etc).
    I am starting with the
    date dimension as presented by Matt Masson.
    Please help if you have any formula suggestions for this.
    Thanks

    Okay, I'm making a couple of assumptions, so please let me know if these assumptions are incorrect:
    1) Instead of all sales data being in a single column, current year and last year sales are provided in different columns,
    2) The previous year sales column shows the sales occurring on the same
    date as the current year sales (so in your example, 43214 is the sales figure for 6/1/2013.
    If the above assumptions are true, we need to modify how the lookup is done. Let's assume that you created a custom column named SameDayOfWeekLastYear. Create another column called Previous Year Date, using the following function (Date_PreviousYear)
    (date) =>
    let   
        PreviousYearDate = Date.AddYears(date,-1),
        PreviousYearDateAdjusted = if (Date.Day(date)=29 and Date.Month(date) = 2) then
                                       #date(9999,1,1)
                                   else PreviousYearDate
    in
        PreviousYearDateAdjusted
    Incidentally, I created this function the week before your query, for a different purpose. In that case, it was to get the previous year sales occurring on the same
    date as the current year sales. It actually gets to your starting point, but with all the sales data in a single column to start with. However, when the current year is a leap year and you apply the Date.AddYears function, February 29th is calculated
    as February 28th of the previous year. If you then do a lookup for previous year sales, you get February 28th sales looked-up twice (the real Feb 28th and the bogus one resulting from taking February 29th back one year). The PreviousYearDateAdjusted identifier
    puts a truly bogus date instead of a duplicated Feb 28th - one that will always return null when looking up the sales value.
    This new date column will then be used to lookup the row of the previous year sales column that corresponds to the dates in the SameDayOfWeekLastYear column.
    Assuming that the last step in your query is InsertedCustom1, create another custom column (Previous Year Net_Same Day?), which returns the sales on the same day as the current year (the result that you're after). The formula would be:
    LookupValue(InsertedCustom1[Previous Year Net], InsertedCustom1[Previous Year Date], [SameDayOfWeekLastYear])
    where LookupValue is the custom function mentioned previously. After creating this new custom column, you can then remove all of the columns you don't need.
    Hope that the preceding is somewhat clear.

  • When i try to reload the same data what will happen in my ods?

    Hi all,
    Someone has already loaded the data from flat file into the respective ods.
    for instance:
    customer number customer name cust address
       10001          xav          123
       10002          xac           234
    And this has been loaded by some one else.
    If i am going to load the same data in the ods. will it create 2 entries nor just going to be only one entry.
    i meant will it be like this
    customer number customer name cust address
       10001          xav           123
       10002          xac           234
       10001          xav           123
       10002          xac           234
    nor like this
    customer number customer name cust address
       10001          xav          123
       10002          xac           234.
    Thanxs
    Haritha

    Hi,
    If two Records of same key combination is there then over writing will happn in ODS. Within the request overwriting is done in the updation(from change log table to active data table). Within different request overwriting is done during activation(new data table to change log table) Zero record mode is doing this.
    read this along with other replies
    Thanks and regards
    Obily

  • Why have all my emails now got the same date in Mail?

    All incoming and outgoing emails show the same date in the list of mailboxes and the "sort by" columns. The date is 01/05/2012. How can I change this to show the "real" dates? This has only happened in the past 2 weeks.
    I'm no able the start a discussion in the Mail community, so I hope this is the appropriate alternative.
    Thank you very much.

    Go to Settings/Messages/Receive at/ and disable the mail address or phone number for the device that your sister is using.
    Also have a look here: iMessage on iPad and iPhone Explained and De-Mystified

Maybe you are looking for

  • Problems creating an order document

    Hi, I'm creating an order document via DIAPI. My problem is with document lines, the data I want to introduce is ItemCode, Discount, Quantity and Price. The thing is that my price is the price before discount, but in DIAPI there is no way to add data

  • Not allowing to create field starting with underscore and numbers

    Hi All I'm trying to create a datatype in PI 7.1 with element starting with underscore and numbers like _Name , 1.0.Name. when I'm trying to activate the dataype. I'm getting the error Activation of the change list canceled.please help me out Thanks

  • DB13 - Scheduled Update Statistics not run - Error

    Hello gurus, I´m faccing with an error in DB13, I scheduled Update statistics every day but it did not run due an error. I think this may resulted because an authorization problem. In /usr/sap is with this permissions: drwxr-xr-x  15 orad01 dba   409

  • Error ORA-06533: Subscript beyond count - Please help

    Hi All, Please help me on below error I Created two Objects and two Type like below CREATE OR REPLACE TYPE P_IN_OBJ AS OBJECT A1 VARCHAR2(5), A2 VARCHAR2(5), A3 VARCHAR2(30)); CREATE OR REPLACE TYPE P_IN AS TABLE OF P_IN_OBJ; CREATE OR REPLACE TYPE P

  • Pro 2011 getting error message and freeze? Advice please

    I have a 15" macbook pro 2011. First I want to say that this is the 2nd one, the first one froze 7 times in the first 7 days I owned it and I made a appt to have it looked at and they replaced it. Now this one which is about 2 weeks old has done the