Fm for previous date

Hi,
Is any FM is there which can calculate the previous 1 year date or more.
Suppose I have today's date & based on that date I wanted to calculate the previous 1 year date.

Hi,
<b>DATE_CHECK_PLAUSIBILITY</b>- Check to see if a date is in a valid format for SAP. Works well when validating dates being passed in from other systems.
<b>DATE_COMPUTE_DAY</b>- Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.
<b>DATE_GET_WEEK</b> -will return the week that a date is in.
<b>DATE_IN_FUTURE</b>- Calculate a date N days in the future.
<b>DAY_ATTRIBUTES_GET</b> - Return useful information about a day. Will tell you the day of the week as a word (Tuesday), the day of the week (2 would be Tuedsay), whether the day is a holiday, and more.(provided by Francois Henrotte)
F4_DATE displays a calendar in a popup window and allows user to choose a date, or it can be displayed read only.
Pls find any FM useful to u.
Pls reward helpful points.
Regards,
Ameet

Similar Messages

  • How tio restrict the generation of Calib.Maint Order for Previous dates

    Dear PM Guru's
    i required one restriction option to prevent the generation of calibration  maintenance orders for previous dates.please under stand the full information in following example.
    one of my gauge frequency was every 6months. for every 6months user wants one calibration order. in between these 6months frequency user checks the gauge for every 1month as a Inspection / verification of gauge. while uploading the data in SAP, user enters the dates 02.02.2011 as  a start of cycle, but we upload the data in sap 02.05.2011. on 05.05.2011 we will go for live. here system should generate the order every month as 02.03.2011,02.04.2011,02.05.2011,02.06.2011,02.07.2011,02.08.2011. As per out condition 02.08.2011 has Inspection / verification and calibration remaining months are inspection / verification. Now here how i can restrict the order generation for 02.03.2011,02.04.2011,02.05.2011dates. Please give me the suggestion and solution to avoid the order generation. if i left same as it is somany orders should be generated.
    please help me. thanks so much in advance to all PM gurus.
    regards
    PM

    First method:
    You can define offset in strategy so that first call will be created after the offset period (in your case, it is 4 months).
    Second method:
    You can define the start date of cycle as 02.05. instead of 02.02, as system is going live only by 05.05.

  • Warranty maintenace for previous date.

    Hello,
    Scenario: We have asset materials like PC'S, we need to mainatain warranties for these materials from previous date(eg:01/01/2006).
    Warranty check has to be carried out for these asset material with serial numbers
    We have maintained material with serial numbers ( material type-aset),& Equipment master data are getting generated automatically by system for each serial number.
    We have maintained counter(charecterstics-CT04) with measurement point,posn for these euipment master.& then measurement document (IK11)is created for the measurement point with reading.
    Master warranty is maintained for the only material (No provision for maintaining serial number) with counter & value.(eg 12 Months).
    But when we try to run warranty check using A200 (Warranty check) when creating warranty claim (T-code WTY),No results are displayed.
    Is there any any direct transaction for warranty check for material with serial numbers?
    Suggestions on this are helpful
    Thanks & warm regards.
    Basavaraj Patil

    hi,
    after  creation of equipment master u must be maintaining the master warranty in that.
    Once u done it ,in the WTY transaction in the item overview screen enter ur material .
    in the object tyoe field choose object type as equi and enter /search ur suitable equipmetn pertaining to ur material and serial number.
    Now click on the action and select the warranty check button.
    I am sure that system will give u pop up about the warranty related dates .
    Thanks

  • How to add details of absences in absences Infotype 2001 for previous dates

    Hi Experts...
    In  my clients company....  one of  Personnel subareas employees leave records are not updating in
    2001 Infotype.
    Now they wish to have to update in 2001 Infotype.
    What is the implication for this new changes in absences records.
    What are the different methods to upload these absence data to the employees.
    How can we upload these data with in a short span time.
    Please advice.
    Thanking you.
    Regards,
    sai

    HI Dilek....
    Thanks for the reply.
    Here it s not possible to change payroll period every time.
    As because the employees leave records are there from year 2007 in different months.
    I will put the status as Release dfor correction.
    What changes to be done with payroll status infotype.
    there is no need of running retro for the above changes we made.
    What could be the optimum solution.
    Regards,
    Sai.

  • KKF6N for previous period

    Hi
    Can i run KKF6N for the previous period.I.e i m in 9 period i want to run the KKF6N for 8period...can i do so.if so how?
    Reards
    SAP4ME

    Preliminary cost estimates for product cost collectors cannot be created for a validity date that is in the past.
    At the costing date feild, choose either the current date or a date in the future.
    The system will throw an error if you try to do it for previous dates.
    PS:Use MF30 for preliminary cost estimate of product cost collector.

  • How to get Item-Code wise stock quantity and value for a previous date

    Dear Sir,
    As per the government legal requirement , we are required to furnish a list for items having stock as on a date ( date is not the current date but it is some past date)  and  in the list we need to provide material wise stock quantity and value .
    We can generate a list  for the current date , but do not know how to get it for a previous date .
    We request you to kindly guide us about such a list .
    With Thanks and Regards
    Sonia Agarwal

    hi,
    might be this reports will be help full for your requirement.
    MMBE
    MB53
    MB52
    MB5M
    MB5B
    MB5T
    MBLB
    MBBS
    MB54
    ME56
    Thanking you

  • SAP XI runtime workbench doesnot display data for previous months

    Hi,
    We are experiencing an issue in our XI system. When we try to extract messages from the Integration engine we recieve data only for two months including the present month and not for previous months.
    Can you pleaes suggest which SAP job or any set parameter is creating such a scenario.
    Thanks in advance and suggestion are welcome.
    Regards,
    Subhram

    You should check the archiving/deletion jobs in the PI Admin Check guide..
    Kind regards,
    Mark

  • Missing records for any date, take previous date.

    Hi ,
    I had done it thourgh PL SQL but need advice on whether this can be done through SQL and in a better way,
    Requirements,
    1. I have a table which hold daily data.
    2. I have a date range. It can be anything. For example between 1st Jan 2013 to 23rd Jun 2013.
    Now I have a table. This table have daily records. In case missing for any date it should take the previous dates data.
    Sample Data:
    {code}
    with data as
    (select '01-JAN-2013' as report_date , 45 as report_value from dual
    union all
    select '02-JAN-2013' as report_date , 49 as report_value from dual
    union all
    select '03-JAN-2013' as report_date , 51 as report_value from dual
    union all
    select '04-JAN-2013' as report_date , 54 as report_value from dual
    union all
    select '05-JAN-2013' as report_date , 55 as report_value from dual
    union all
    select '06-JAN-2013' as report_date , 59 as report_value from dual)
    select * from data;
    {code}
    Sample Output:( when date range passed as 01-Jan-2013 to 08-JAN -2013
    {code}
    01-JAN-2013    45
    02-JAN-2013    49
    03-JAN-2013    51
    04-JAN-2013    54
    05-JAN-2013    55
    06-JAN-2013    59
    07-JAN-2013    59
    08-JAN-2013    59
    {code}

    Something like this...
    WITH data AS
            (SELECT '01-JAN-2013' AS report_date, 45 AS report_value FROM DUAL
             UNION ALL
             SELECT '02-JAN-2013' AS report_date, 49 AS report_value FROM DUAL
             UNION ALL
             SELECT '03-JAN-2013' AS report_date, 51 AS report_value FROM DUAL
             UNION ALL
             SELECT '04-JAN-2013' AS report_date, 54 AS report_value FROM DUAL
             UNION ALL
             SELECT '05-JAN-2013' AS report_date, 55 AS report_value FROM DUAL
             UNION ALL
             SELECT '06-JAN-2013' AS report_date, 59 AS report_value FROM DUAL)
    SELECT NVL (TO_DATE (report_date, 'DD-MON-YYYY'), t.dt) report_date,
           NVL (report_value,
                (SELECT MAX (report_value)
                   FROM data
                  WHERE report_date = (SELECT MAX (report_date) FROM data)))
              report_value
      FROM    data
           RIGHT OUTER JOIN
              (    SELECT TO_DATE ('01-JAN-2013', 'dd-Mon-YYYY') + ROWNUM - 1 dt
                     FROM DUAL
               CONNECT BY ROWNUM <=
                               TO_DATE ('08-Jan-2013', 'dd-Mon-YYYY')
                             - TO_DATE ('01-Jan-2013', 'dd-Mon-YYYY')
                             + 1) t
           ON TO_DATE (report_date, 'DD-MON-YYYY') = dt;
    REPORT_DATE REPORT_VALUE
    1/1/2013      45
    1/2/2013      49
    1/3/2013      51
    1/4/2013      54
    1/5/2013      55
    1/6/2013      59
    1/8/2013      59
    1/7/2013      59
    Cheers,
    Manik.

  • Need for customer exit code to go to previous date

    In the ODS there is a date which is a user entry on my report. I need to write a customer exit which goes to previous date.
    In other words let's say user entered 07/07/07 at the user entry, and there is no activity for the entered date. The previous activity date in ODS data is 07/05/07. The report should run based on the previous date. ( Date is the key by the way )
    I will appreciate any help with points,
    Regards,
    Mike

    I just wrote this quickly and I limited to 10 loops because something is wrong if it is further back than that and I think another solution should be done.  This is also assuming the volume of data is not too large.  If so you may want to take the year off the date and add that to the select statement.
    Can the previous date be any date?  So lets say the user entered 07/07/07 and the last activity was 01/01/07?  Is date the only key? 
    If so you can do something like this.
    date_ 1 like <date_ field in ODS>
    date_ 2 like <date_ field in ODS>
    counter(2) type n
      DATA:    BEGIN OF data_all OCCURS 0,
                 Date_ 3 like date_ 1
               END OF data_all
    date_ 1 = user enter
    counter = 10
    Select <date_ field> from <ods backend table> into data_all
    Sort ascending
    While counter > 0
       Read data all where data_all-date_3 = date_1
    If sy-subrc <> 0
      Date_ 1 = date_ 1 – 1
    Counter = counter - 1
    Continue.
    Else
    date_2 = date_1
    Exit.
    Endif
    End loop
    Return date_2

  • BW data load for previous fiscal year depending upon sy-datum

    Hello All,
    In SAP BW, while loading data using date, I have requirement to load the datat for previous fiscal year.
    Fiscal year run from Oct to Sept.
    I have given example of Nov 2012. Becuase I am going to add this info-package in process chain which will run Nov of every year for full data load.
    For Ex: I am loading data in calander year/month Nov 2012. Its previous fiscal year is 2011.
    So for fiscal year 2011, my dates for data load would be : 10/1/2010 to 9/30/2011.
    So my code or functional module should retun me 10/1/2010 to 9/30/2011 this value.
    Kindly give your inputs for the same.
    Thank You.

    Hello All,
    I have wriiten below code and it has solved my problem:
    REPORT  ZTEST_PK.
    data:
    month_last type n length 2,
    year_last type n length 4,
    year type n length 4,
    month_first type n length 2,
    month type n length 2,
    year_first type n length 4,
    day_in type sy-datum,
    day_out type sy-datum,
    v_date type n length 6,
    select_period_low(8) type c,
    select_period_high(8) type c.
    year = sy-datum(4).
    month = sy-datum+4(2).
    concatenate year month into v_date.
    Data: fisyr type n length 4,
    fiscper type n length 3.
    *Fiscal years run from Oct to Sep
    *For Ex: Nov2012 load of the previous FY itu2019s FY 2011, the dates would be Oct 10 (10/1/2010) to Sep 11 (9/30/2011).
    CALL FUNCTION 'Z_XCONVERT_CALMONTH_TO_FISCAL'
      EXPORTING
        IV_CALMONTH       = v_date
    IMPORTING
       EV_FISCYEAR       = fisyr
       EV_FISCPER3       = fiscper.
    year_last = fisyr - 1.
    year_first = year_last - 1.
    month_first = '10'.
    month_last = '09'.
    concatenate year_first month_first '01' into select_period_low.
    concatenate year_last month_last '01' into day_in.
    *calcualte last day of  a given month
    CALL FUNCTION 'SN_LAST_DAY_OF_MONTH'
      EXPORTING
        DAY_IN             = day_in
      IMPORTING
        END_OF_MONTH       = day_out.
    concatenate day_out(4) day_out4(2) day_out6(2) into select_period_high.
    write:/ select_period_low.
    write:/ select_period_high.

  • Check 3G data usage for previous months?

    Where do I go to check my 3G iPad2 data usage for previous months?
    I look in the Settings / Cellular Data / View Account - but only see the current month.
    I tried to create a My Verizon account on the verizon wireless web site using my iPad phone number but I get the error "We're sorry, but at this time you cannot register your account for My Verizon. Please access your account information on your device."
    I installed the "My Verizon" app for ipad from the App Store but I get "System under maintenance.  Please Try again." all the time.
    Is there someplace else I can see previous months data usage?  I would like to get a sense how much I have used in the past.
    Thanks
    Joe

    Dear AdamE+VZW and AntoniioC_VZW
    Have you actually tried the advice you gave?  I'm 6 days into my billing cycle.  The furthest back I am able to see data traffic is 6 days.
    The specific navigation path "View Bill --> I Want To...  --> Month ---> Usage Details --> Data"  does not currently exist.
    As far as I can tell, AdamE's claim that "You can easily see the past six months of data usage on our website " is untrue.
    The report generated by the "Account Analysis" is plainly false as well.  It reports that both of my data phones used exactly 1024.00 MB in February, March, and April. (sic: 2 decimal points!!).  That is an exceedingly unlikely coincidence, and flatly contradicts the current month summary which reports that one of my phones has used only 23 MB, and the other line even less.  The "Account Analysis" has a bug so serious as to render its data traffic output absolutely useless.  Since it is providing false output, it should be removed from the site until it can be fixed to generate accurate reports.
    I can't even find a way to see my prior month's summary bill, though I can't be sure it is unavailable since the site is large.  But I can say that when a customer spends 15 minutes clicking around a site trying to find their prior month's bill (not merely the bill's dollar amount, but the bill's usage summary) and fails, the site navigation should be improved!!

  • Report for Project Stock Balances as on a previous Date

    Hi PS Gurus !!
    We need to have a Report that gives the Project Stock Balances and Values as on a Past Date. The system gives a Current Status Report, but is there a Report that gives the Values for Past Date. This is a report for the Auditor's Interest.
    Secondly, we would also need a Report on the Movement of Project Stock in the past periods. Is this possible ??
    Thanx !!
    Ravi

    Hi Everyone !!
    I would once again request all of you to kindly answer to my question, as I need a solution to this urgently.
    Thanx & Regards,
    Ravi Kumar

  • Syntax for previous months data

    For some reason I cannot get the syntax of the previou month correct. Here is what I have used.
    ("Date"."Calendar Month" IN (SELECT case when 1=0 then "Date"."Calendar Month" else timestampadd (sql_tsi_month, -1, current_date) end FROM "RProBIEE"))
    However it doesn't like this. I get an error.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 22027] Union of non-compatible types. (HY000)
    SQL Issued: SELECT s_0, s_1, s_2, s_3, s_4 FROM ( SELECT 0 s_0, "RProBIEE"."Date"."Calendar Month" s_1, "RProBIEE"."Stores"."Store Name" s_2, "RProBIEE"."Sales Amounts"."Local Revenue" s_3, REPORT_SUM("RProBIEE"."Sales Amounts"."Local Revenue" BY "RProBIEE"."Stores"."Store Name") s_4 FROM "RProBIEE" WHERE (("Date"."Calendar Month" IN (SELECT case when 1=0 then "Date"."Calendar Month" else timestampadd (sql_tsi_month, -1, current_date) end FROM "RProBIEE"))) ) djm
    I think it is saying that the it doesn't like (sql_tsi_month, -1, CURRENT_DATE) however If I use CURRENT_MONTH it doesn't like that either.
    Any help is appreciated.

    Hello... The data type for the "Date"."Calendar Month" value is TINYINT. So i assume you are right that i need to CAST this so that it matches CURRENT_DATE. Or perhaps maybe instead I need to CAST current DATE as TINYTINT to match? Do you happen to know the syntax? This is what I have but it's not working. I get syntax errors.
    "Date"."Calendar Month" IN (SELECT case when 1=0 then "Date"."Calendar Month" else (cast (timestampadd (sql_tsi_month, -1, current_date))))

  • Retro master data change for previous cost center

    HI All,
    Could any one please reply on how I can unblock 'blocked cost center' to make retro changes for Master data.
    Thank you in advance. 
    Abhay

    Hi Abhay,
    1. Unblock the cost center for the period to apply the Master data changes. Unblock it via transaction KS02.
    2. Once the legacy cost center is unblocked, immediately proceed with master data updates.
    3. Once master data is updated, proceed with restoring the blocked status of the cost center that was used (Unblock).
    Thanks,
    Dhiraj

  • Opening stock will be the closing stock of previous date

    Hi All,
    Good day. I am developing an ALV report that will show opening stock(LABST) as well as closing stock(Calculated) for a range of date and materials. Problem here is that from MARD table I am getting only the last opening stock, because it has no common date field with MSEG table. So, I have to calculate the opening stock as the closing stock of previous date. How can I calculate this? Is there any FM to get the opening stock ?
    Date          Material            Opening St       Closing St
    27.03.2009     2100002          91.000          191.00
    28.03.2009     2100002          191.000          123.00
    29.03.2009     2100002          123.000          103.00
    With regards,
    Tripod.
    Edited by: Tripod on Aug 23, 2011 12:13 PM

    Try not only to use MARD and MKPF/MSEG but also MARDH which contains closing stock of period preceding periods where movements happened. (ie. there is a record for May if a movement happened in June, and none for June if there was no movement in July, and no record exists for August as this is current period) - First look for MARD, MARDH records; and then only read MKPF/MSEG from last MARDH record found. (created back to 4.5A - [Material Master (Industry/Retail): Enhancements to Period Closing|http://help.sap.com/saphelp_45b/helpdata/en/35/b0e7ef87a62488e10000009b38f9b7/content.htm])
    Regards,
    Raymond

Maybe you are looking for

  • Problems with using special characters in Interactive Report Search

    Hi! I am currently developing an Application on Application Express 3.1.2.00.02 including a page with an Interactive Report, facing the problem that I cannot use special german characters in the Searchbar. So if i try to find a name like 'Schröder' t

  • Transferring apps from iPhone to Z2

    Hello all. I have a new Z2 and was told I could transfer my apps to it from my iPhone 5. I have been able to transfer all my other stuff, but the apps are a big fail. I have managed to transfer a couple of apps, but they are just the cheap/free ones,

  • Need help Playing/Formatting videos!!

    I have several music videos saved as Quick Time files, but my iPod is not recognizing them, or downloading them? any suggestions???

  • 2004Q2 POP3 misbehaviour under load

    Hi, while running some tests on 2004Q2 I've encountered a strange behaviour of the POP3 server, which looks like a bug. Setup is the following: Sun Java(tm) System Messaging Server 6.1 (built Apr 28 2004) libimta.so 6.1 (built 13:10:36, Apr 28 2004)

  • TREX on WINDOWS

    hi experts, where to get the documents and downloads regarding TREX installation on WINDOWS? how to execute the files if it is in SAR format? what are the procedures to be followed to install TREX on WINDOWS? thanks, kannan