Required function module to get date one year in the past.

Hi,
Required function module to get date one year in the past.
Thanks and regards,
M.R.Reddy.

Hello,
You can check this:
DATA:
V_DATE1 TYPE D,
V_DATE2 TYPE D.
V_DATE1 = SY-DATUM.
TRY.
    CALL METHOD CL_HRPAD_DATE_COMPUTATIONS=>SUBTRACT_YEARS_FROM_DATE
      EXPORTING
        START_DATE = V_DATE1
        YEARS      = 1
      RECEIVING
        DATE       = V_DATE2.
  CATCH CX_HRPA_VIOLATED_POSTCONDITION .
ENDTRY.
WRITE:
/ V_DATE1, / V_DATE2.
Hope this helps.
Br,
Suhas

Similar Messages

  • Function module to get 'Date one year in the past' in APO

    Hi,
    Required function module to get date one year in the past in APO.
    Thanks and regards,
    M.R.Reddy.

    Hi Reddy,
    Try these function modules
    /SAPAPO/DATE
    /SAPAPO/FISCAL_BDATE
    /SAPPO/MAPI_MAP_CREATDATE
    /SAPPO/MAPI_MAP_POSTDATE
    /SAPAPO/LCP_CALC_DATE
    /SAPAPO/VS_ORDER_GET_DATES
    /SAPAPO/PERIOD_CONVERT_DATE
    /SAPAPO/PERIOD_DATE_GET_FROMTO
    /SAPAPO/PERIOD_GET_DATE_RANGE
    /SAPAPO/PERIOD_GET_FOR_DATE
    /SAPAPO/PERIOD_GET_FROM_TODATE
    Regards
    R. Senthil Mareeswaran.

  • Function module for getting month and year of the previous month (say -6)

    Hi,
    Is there a function module that will get you the month and year of say, a month before, and as far as 11 months ago.
    For example, say today is 6/2007. I want 7 months ago.
    How do i get this value?
    What function module or method is available?
    Points will be rewarded and responses will be appreciated.
    Thank You,
    John

    Hi
    lv_period gives the month and year which is two months earlier now as we have specified lv_months as -2.
        DATA: LV_PERIOD LIKE S001-SPMON,
              LV_MONTHS(2) TYPE C VALUE '2-',
              LV_DATUM LIKE SY-DATUM,
              LV_NEWDT LIKE SY-DATUM,
            P_SPMON LIKE S001-SPMON VALUE '200601'.
        CONCATENATE P_SPMON '01' INTO LV_DATUM.
        LV_PERIOD = P_SPMON+0(6).
        CALL FUNCTION 'MONTH_PLUS_DETERMINE'
             EXPORTING
                  MONTHS  = LV_MONTHS
                  OLDDATE = LV_DATUM
            IMPORTING
                 NEWDATE = LV_NEWDT
             EXCEPTIONS
                  OTHERS  = 1.
         IF SY-SUBRC = 0.
           LV_PERIOD = LV_NEWDT+0(6).
         ENDIF.
    WRITE :/ LV_PERIOD.
    OR
    Use the following FM for getting the year and the month based on date
    CACS_DATE_GET_YEAR_MONTH
    or
    Call Function 'CCM_GO_BACK_MONTHS '.
    Funny module: 03/31/2002 - 1 month = 02/31/2002
    OR
    RE_ADD_MONTH_TO_DATE ( Add / substract month to/from date )
    Need ur reward points.
    Best regards,
    Ravi

  • Function module to get data into internal table from Excel file sheets

    Hi,
    I have to upload customers from excel file.
    we are donloading customer data excel file sheets.
    Customer data in 1 sheet, tax data the other sheet of same excel file, Customer master-Credit data in other sheet of same excel file.
    so i have 3-4 sheet in one excel file.
    now my requirement is to get the data from excel file into internal table.
    is there any function module.
    Thanks & Regards

    I am sending you the idea with an example how you can upload data from an EXCEL file into an internal table. I am not sure if you can take data from different sheet in the same EXCEL file. I think that this is not possible (try it )
    Upload the data into an internal table, like the way that I am describing in the above:
      DATA: L_MAX_COL_NB TYPE I.
      DATA: l_file_name LIKE RLGRAP-FILENAME.
    Just to be sure that is the correct type for the FM.
      l_file_name = P_FILE_NAME.
      L_MAX_COL_NB = 58.  "Maximum nb of colums that the FM can read.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                FILENAME                = l_file_name
                I_BEGIN_COL             = 1
                I_BEGIN_ROW             = 2
                I_END_COL               = L_MAX_COL_NB
                I_END_ROW               = 9999
           TABLES
                INTERN                  = PT_EXCEL
           EXCEPTIONS
                INCONSISTENT_PARAMETERS = 1
                UPLOAD_OLE              = 2
                OTHERS                  = 3.
      IF SY-SUBRC <> 0.
      ENDIF.
    Now you should upload the data into your own itab. The Function Module will return to you all the an itab
    from all fields and columns. Define the structure of the uploading file into SE11 - Data Dictionary. Then read the fieldcatalog of this structure. In the code that I am sending to you, I am insearting an empty line into the internal table and then I am assigning this line into a corresponding field-symbol. Then I am able to change the working area - so and the line of the itab. Propably you could you the statement APPEND INITIAL LINE TO (your_table_name) ASSIGNING <your_field_symbol>, but the example was written in an old SAP version.
      FIELD-SYMBOLS:
                     <F_REC> LIKE WA_UPLOAD_FILE,      "working are of the uploading file
                     <F_FIELD> TYPE ANY.
      DATA: COLUMN_INT TYPE I,
            C_FIELDNAME(30) TYPE C.
      PERFORM GET_FIELDCATOLG TABLES FIELDCAT
                               USING 'ZECO_CHARALAMBOUS_FILE'.
      LOOP AT PT_EXCEL.
        AT NEW ROW.
          ASSIGN WA_UPLOAD_FILE TO <F_REC>.
        ENDAT.
        COLUMN_INT = PT_EXCEL-COL.
        READ TABLE FIELDCAT INTO WA_FIELDCAT INDEX COLUMN_INT.
        CONCATENATE '<F_REC>-' WA_FIELDCAT-FIELDNAME INTO C_FIELDNAME.
        ASSIGN (C_FIELDNAME) TO <F_FIELD>.
        <F_FIELD> = PT_EXCEL-VALUE.
        AT END OF ROW.
          APPEND WA_UPLOAD_FILE TO GT_UPLOAD_FILE.
          CLEAR WA_UPLOAD_FILE.
        ENDAT.
      ENDLOOP.
    With Regards
    George
    Edited by: giorgos michaelaris on Mar 4, 2010 3:44 PM

  • Any Function Module to get date by passing week and year

    Hi,
       Is there any Function Module available to get date by passing week and year. For example, Week 24, Year 2005 and you get the date.
    Regards,
    Mira

    WEEK_GET_FIRST_DAY
    pass 'YYYYWW' (200524) to WEEK parameter it will give you the week start date
    Raja

  • Function module to get data from VARI table

    Hi All,
    thank you for viewing this thread. can anyone help me out in finding a function module which can get data from the VARI table?
    thank you

    Hi,
    FMs you will require are:
    RS_VARIANT_CONTENTS - Values of a variant returned in a table
    RS_VARIANT_EXISTS - Checks whether a variant exists for a report
    RS_VARIANT_TEXT - Returns short description of variant
    RS_VARIANT_VALUES_TECH_DATA - Reads variant parameters of a report
    Do search on them for complete details.
    Cheers.

  • Function Module to get Date and Time out of Timestamp

    Hi,
    Source system timestamp field CREATED_TS of Type DEC-15
    BW PSA data in format 20.140.707.105.948
    In DSO, I have created two target InfoObjects; one for Date and one for Time.
    In transformation from PSA to DSO, in field level routine, I want to split timestamp into Date and Time.
    There is a function module CACS_TIMESTAMP_GET_DATE in source system but it is not available in BW. Another function module ADDR_CONVERT_TIMESTAMP_TO_DATE which is available in BW but returns only Date. 
    Does anyone know a function module in BW which takes Timestamp (PSA data in format 20.140.707.105.948) and returns Date and Time.
    Much better would be a FM which take timestamp and also Timezone  and returns Date and Time.
    Thanks
    Ahmad

    Timestamp to date time conversion (with time zone) is built into ABAP. Why use a function module?
    Read the ABAP help on CONVERT.

  • Function Module to get date wise weekly offday of employee

    Hi all,
    Is there any standard function module which imports PERNR and DATE and returns the weekly off dates on the basis of
    the work schedule (IT0007)?
    If there is no such Fn Mo, please let me know what tables to look for to do this.
    <<Text removed by moderator>>
    For your information I have already found function module HRPERSONAL_WORK_SCHEDULE.But it is not returning for entire period (say 01.10.2010-31.10.2010)._
    I have also found table relationship but it is not serving my purpose. Table T552A for monthly work schedule.
    Thanks
    Sourav

    Hi Anand,
    Thanks for your reply.
    This fn mo is returning the first three days(01.10.2010,02.10.2010,03.10.2010).
    Rest days of the month (Oct 2010) are not coming.
    According to display work schedule(transaction PT03) this func module is returning the first row bcoz first row contains
    01.10.2010,02.10.2010,03.10.2010.
    Here is my code snippet.
    DATA: it_ptpsp TYPE STANDARD TABLE OF ptpsp INITIAL SIZE 0,
          wa_ptpsp TYPE ptpsp.
    DATA : gd_warning LIKE sy-subrc.
    CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'
    EXPORTING
      pernr             = '00100007'
      begda             = '20101001'
      endda             = '20101031'
    *          KUG               =
    *          REFRESH           = 'X'
    *          WORKING_HOURS     = 'X'
    *          SWITCH_ACTIV      =
    *          MODIFY_ENTRIES    = 'X'
    *          I0001_I0007_ERROR = '0'
    *          READ_CLUSTER      =
    IMPORTING
      warning_occured   =   gd_warning
    TABLES
    *          I0000             =
    *          I0001             =
    *          I0002             =
    *          I0007             =
    *          I0049             =
    *          I2001             =
    *          I2002             =
    *          I2003             =
      perws             = it_ptpsp   "Stores employees work schedule
    *          I0003             =
    EXCEPTIONS
      error_occured     = 1
      abort_occured     = 2
      OTHERS            = 3.

  • Any Function module to get data from ESS leave form

    Hi Friends,
    I have modified std workflow ws12300111.with 2 levels.
    I want to send mail to HOD. In that mail i have to mention details like start date , end date,leave type which is entered into ESS form. I want to retrive that data.
    Is there any Fm is available? which wil give ESS data as output.
    Plz let m know.
    Regards,
    Shital

    Have you thought about creating attachments in the WF so you can read the form and get data from it.
    There's plenty of standard WF examples around of attaching objects to WF's.
    Since the ESS action will initiate the relevant workflows you should easily be able to save this data.
    BTW If your other question on this WF was answered please close that thread.
    Cheers
    Jimbo

  • 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

  • Reg Function module for getting date

    Hi,
    My requirement is, If I entered some date I need to get past three months number of days.
    Eg: if I entered 26thDec,2007
    I need to get number of days form October 1st to 26th Dec.
    Regards,
    sarath.

    try this code
    REPORT ztest .
    DATA : lv_date TYPE syst-datum ,
           lv_tmp  TYPE i          .
    PARAMETERS : p_date TYPE syst-datum OBLIGATORY .
    CALL FUNCTION 'ADD_TIME_TO_DATE'
      EXPORTING
        i_idate = p_date
        i_time  = '3'
        i_iprkz = '2' "Month
      IMPORTING
        o_idate = lv_date.
    lv_tmp = lv_date - p_date .
    WRITE : 'Diff in days ' , lv_tmp .

  • Function Module to get Last date of previous year

    Is there any function module to get the Last date of the previous year. e.g, if i give date as 03/02/2009 the output  should be 31/12/2008.

    pls use below 2 FM's
    CALL FUNCTION 'MONTH_PLUS_DETERMINE'
              EXPORTING
                months  = -1
                olddate = curent_date
              IMPORTING
                newdate = w_prevdate.
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
              EXPORTING
                day_in            = w_prevdate
              IMPORTING
                last_day_of_month = w_lastdayprevmonth
              EXCEPTIONS
                day_in_no_date    = 1
                OTHERS            = 2.

  • Function module to get the dates from the year and the period

    Is there a function Module to get the dates from the year and the period

    Check with :
    To get last day of period use .
    LAST_DAY_IN_PERIOD_GET.
    To get last of month Use :
    RE_LAST_DAY_OF_MONTH
    HRVE_LAST_DAY_OF_MONTH
    LAST_DAY_OF_MONTHS
    ISB_PREVIOUS_PERIOD_DATE_GET
    Thanks
    Seshu

  • Function Module to get first day of the fiscal year on passing a date

    Hi Experts!!
    Can you please suggest a Function Module to get first day of the fiscal year on passing a date..?
    Example:  if a fiscal year starts from 30 November 2009 and ends at 28 november 2010.
    it should return 30 th nov 2009 (first day of the fiscal year)

    Moderator message - Welcome to SCN.
    I think you'll find that this question has been answered before. Please search the forum before posting.
    Also, Please read Please read "The Forum Rules of Engagement" before posting!  HOT NEWS!! and How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
    Rob

  • Any function module for getting fiscal year week numbers

    can any one provide me function module for getting fiscal year week numbers ? if no function module please let me know work around.
    Thanks!
    Lakshmikandh

    hi,
    Use FM <b>'DATE_GET_WEEK'</b>...
    parameter D1 LIKE SCAL-DATE.
    Data w like scal-week.
    CALL FUNCTION <b>'DATE_GET_WEEK'</b>
    EXPORTING
    date = D1
    IMPORTING
    WEEK = W
    EXCEPTIONS
    DATE_INVALID = 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 W+4(2).
    Regards,
    Santosh

Maybe you are looking for

  • I am trying to migrate my whole iTunes experience (music files, number of plays, Genius, playlists) from a windows pc to an iMac.

    I have copied everything from my external hard drive (which is where I told iTunes my library was) to my iMac. I am now viewing all my content BUT all the user experience is not there (playlists, number of plays, etc). Can you help? I also noticed th

  • G/L Posting using BAPI

    Hi All, I need to make a FI-GL posting through my code. These are the following fields which I need to pass for the posting. 1. Company Code 2. Currency 3. Document Date 4. Posting Date 5. Posting Key 6. G/L Accounts 7. Amount I have navigated throug

  • Images broken in DW CS4 LiveView & browser preview.

    Hey everyone, need some major help here. I'm very new to dreamweaver. I am experienced with graphics and art but anything related to code I epicly fail at... So talk with me like I'm three if possible. I built my first site for my small sword making

  • Using out variable in a proceadure

    hi im trying to use out to return a value from a proceadure im not getting the syntax corect below could somone point be in the right direction -------spec-------- create or replace package test AS TYPE result_set_type IS REF CURSOR; PROCEDURE run_re

  • How to set default options in PD 16.5 SP03 PL01

    Everyone, I want to set some default physical options while reverse engineering the table(s). I want following options to be added everytime I reverse engieer the table. CREATE MULTISET TABLE, NO FALLBACK , NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKS