Function Module Related on Date Calculations - ABAP Development - SCN Wiki

Embed Size (px)

Citation preview

  • 8/17/2019 Function Module Related on Date Calculations - ABAP Development - SCN Wiki

    1/4

    Getting Started Newsletters Store

    Search the Community 

    Welcome, Guest Login  Register 

    Products Services & Support About SCN Downloads

    Industries Training & Education Partnership Developer Center  

    Lines of Business University Alliances Events & Webinars Innovation

     ABAP Development   / ABAP Development

    Created by Avinash Kodarapu, last modified by IFF on May 02, 2009

    Function Module related on Date calculations

    Function Modules Description

    /SAPNEA/J_SC_CONVERT_DATE Covert Date in Japanese Format

    /SDF/CMO_DATETIME_DIFFERENCE Calculates difference between two dates/timestamps.

     ADD_TIME_TO_DATE Add time to date

    BKK_ADD_MO NTH_TO _DATE Add months t o dat e

    BKK_ADD_WORKINGDAY

    BWSO_DATE_GET_FIRST_WEEKDAY Gives the First date of the week for the given date

    CACS_ DATE_GET_TIMESTAMP Concatenates the date and time format 11-12-2008 10:11:11

    CACS_ DATE_GET_YEAR_MONTH Gives the Year and month for the given date

    CACS_TIMESTAMP_GET_DATE Get date and time from Timestamp

    CONVERT_ TIME_TERMS

    DATE_CHECK_WORKINGDAY Check the day is working day or not for given date & calendar id

    DATE_CHECK_WORKINGDAY_MULTIPLE   Check the day is working day or not for given date in muliple calendar id

    DATE_CO MPUTE_DAY G ives t he day number in t he week (EX 1-Mon,2-TUE etc)

    DATE_CONVERT_TO_WORKINGDAY

    DATE_T O_DAY G iv es the day of the date( Ex Monday , T ues day etc )

    DATE_TO_DAY Get the day of the date (Ex Mon.Tue etc )

    F4_DATE FM for F4 help for Date

    FIMA_DAYS_AND_MONTHS_AND_YEARS

    FIMA_DECIMAL_MONTHS_AND_YEARS Gives the difference between the dates in decimal foemat of number of month & years

    GET_WEEK_INFO_BASED_ON_DATE Get the week Number, Sunday date & Monday date for the given date

    HR_99S_DATE_ADD_SUB_DURATION Add/Subtract months(M)/days(D)/years(Y) to given date to get the future date

    HR_99S_DATE_MINUS_TIME_UNIT Subtract months(M)/days(D)/years(Y) to given date to get the future date

    HR_99S_DATE_PLUS_TIME_UNIT Add months(M)/days(D)/years(Y) to given date to get the future date

    HR_99S_INTERVAL_BETWEEN_DATES Gives the difference between the dates in days, weeks, years

    HR_99S_MONTHS_BETWEEN_DATES * Returns months between two dates. Both dates are included in the

    * computation. An individual prorata is made for each month

    * Meaning of parameter p_compl:

    * 'B' accumulate all complete months and in/complete first month

    * 'E' accumulate all complete months and in/complete last month

    * ' ' accumulate all months (incomplete and complete)

    * 'X' accumulate only complete months

    http://-/?-http://-/?-http://-/?-http://scn.sap.com/login.jspahttp://scn.sap.com/community/uachttp://scn.sap.com/welcomehttp://wiki.scn.sap.com/wiki/display/ABAP?src=breadcrumbs-collectorhttp://scn.sap.com/community/downloadshttp://wiki.scn.sap.com/wiki/display/~j3bhvrzhttp://scn.sap.com/welcomehttp://wiki.scn.sap.com/wiki/pages/diffpagesbyversion.action?pageId=72122522&selectedPageVersions=13&selectedPageVersions=14http://-/?-http://wiki.scn.sap.com/wiki/display/ABAP/Function+Module+related+on+Date+calculationshttp://-/?-http://scn.sap.com/community/uachttp://scn.sap.com/community/getting-startedhttp://wiki.scn.sap.com/wiki/login.jsp?os_destination=%2Fdisplay%2FABAP%2FFunction%2BModule%2Brelated%2Bon%2BDate%2Bcalculationshttp://wiki.scn.sap.com/wiki/display/ABAP/ABAP+Development?src=breadcrumbs-parenthttp://www.sapstore.com/http://-/?-http://scn.sap.com/login.jspahttp://scn.sap.com/community/newslettershttp://wiki.scn.sap.com/wiki/display/~t012kp3http://scn.sap.com/community/developer-center

  • 8/17/2019 Function Module Related on Date Calculations - ABAP Development - SCN Wiki

    2/4

    HR_CALC_YEAR_MONTH_DAY Gives the difference between the dates in days, weeks, years

    HR_E_NUM_OF_DAYS_OF_MONTH Number of days in the given month

    HR_HCP_ADD_MONTH_TO_DATE Add months to date

    HR_IN_GET_DATE_COMPONENTS Splits rge given date in DAY, MONTH, YEAR, Month Small TEXT & Month Long TEXT

    HR_MONTHS_BETWEEN_TWO_DATES Gives months bteween the two dates

    HR_SGPBS_YRS_MTHS_DAYS Gives the difference between dates in Day,Months, years 7 calendar Days

    HRAR_SUBTRACT_MONTH_TO_DATE Subtract's one month from the date

    ID WT _R EAD _MO NT H_ TEXT R ea d t he mon th T ex t

    LAST_WEEK G et t he Last week Number, Sunday dat e & Monday dat e f or t he given Year and Week number 

    LOOK_FOR_TIME_TABLE

    MONTH_NAMES_GET G ives t he list of 12 months t ext in t he given language

    MO NT H_PL US_ DET ER MI NE Add m on th s t o da te

    MONTHS_BETWEEN_TWO_DATES Gives months bteween the two dates

    MONTHS_BETWEEN_TWO_DATES_NEW

    NEXT_WEEK G et t he Next week Number, Sunday dat e & Monday dat e f or t he given Year and Week number 

    NUMBER_OF_DAYS_PER_MONTH_GET Gives you the number of days per month considering the Year 

    O IL_LAST_DAY_OF_MONTH G ives t he last day of t he month

    OIL_LAST_DAY_OF_PREVIOUS_MONTH Gives the last day of the prevous month

    OIL_MONTH_GET_FIRST_LAST Gives the month first day date & last day date

    R E_AD D_ MO NT H_ TO _D AT E Add m on th s t o da te

    RH_GET_DATE_DAYNAME Gives the day number in the week and day text

    RH_PM_CONVERT_DATE_TO_MONTH

    RH_PM_CONVERT_DATE_TO_MONTH Gives the difference between the dates in month

    RH_PM_CONVERT_DATE_TO_YEAR

    RP_CALC_DATE_IN_INTERVAL To calculate the new date by adding/Sub days, months & Year 

    SG_PS_GET_LAST_DAY_OF_MONTH Last day of the month

    TIME_CONVERSION

    TM_DATE_CHECK_WORKINGDAY

    WDKAL_DATE_ADD_FKDAYS

    DATE_CHECK_PLAUSIBILITY

    DATE_IN_FUTURE Calculate Future Dates

      DURATION_DETERMINE Calendar: Determine duration between tw

    DELTA_TIME_DAY_HOUR Difference Between Date & Time

    CALCULATE_DATE Year entry: 2-charact. to

    HR_SEN_CRULE_0100_DATE Calculation of a Date (1 Year = 12 Months, 1 Month = 30 Days)

    D AT E_ 2D _T O_ 4D _C ON VER SI ON

    No lab

    4 Comments

    J@Y

    Good one Avinash.

    http://wiki.scn.sap.com/wiki/display/~bza2e1a

  • 8/17/2019 Function Module Related on Date Calculations - ABAP Development - SCN Wiki

    3/4

    Guest

    many typo's in description. example: Gives months bteween the two dates

    Guest

    Hi Avinash,

    Some of the function modules listed above behave oddly...and give ouput which doesnot have any reason...

    LIke:

    RP_CALC_DATE_IN_INTERVAL :

    Date: 28.01.2011

    Days: 10

    Months: 1

    SIGNUM : +

     And the output : CALC_DATE : 07.03.2011

    whereas:

    HR_99S_DATE_ADD_SUB_DURATION :

    Date: 28.01.2011

    IM_OPERATOR : +

    IM_DURATION: 0 1 10

     And the output : CALC_DATE : 10.03.2011

    so the difference in date calcutions differ .

    Can I know the reason.

    I need the future date by giving the source date, number of months,days and years to be added.

    Need to know the exact function module for this scenario.

    Please help me out.

    Regards

    harish

  • 8/17/2019 Function Module Related on Date Calculations - ABAP Development - SCN Wiki

    4/4

    Guest

    Hi Avinash,

    Some of the function modules listed above behave oddly...and give ouput which doesnot have any reason...

    LIke:

    RP_CALC_DATE_IN_INTERVAL :

    Date: 28.01.2011

    Days: 10

    Months: 1

    SIGNUM : +

     And the output : CALC_DATE : 07.03.2011

    whereas:

    HR_99S_DATE_ADD_SUB_DURATION :

    Date: 28.01.2011

    IM_OPERATOR : +

    IM_DURATION: 0 1 10

     And the output : CALC_DATE : 10.03.2011

    so the difference in date calcutions differ .

    Can I know the reason.

    I need the future date by giving the source date, number of months,days and years to be added.

    Need to know the exact function module for this scenario.

    Please help me out.

    Regards

    harish

      Follow SCNContact Us   SAP Help Portal

    Privacy   Terms of Use   Legal Disclosure   Copyright

    http://scn.sap.com/docs/DOC-18476http://help.sap.com/http://www.sdn.sap.com/irj/scn/policy?view=PPhttp://bit.ly/SCNTwRhttp://bit.ly/SCNyouThttp://bit.ly/SCNFBhttp://www.sdn.sap.com/irj/scn/policyhttp://www.sap.com/corporate-en/our-company/legal/impressum.epxhttp://www.sap.com/corporate-en/our-company/legal/copyright/index.epx