Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function Modules for Date

Former Member
0 Likes
844

Hi ALL,

I would like to know the various function modules that can be used for calculating dates.Like first day of month,last day.....etc etc.

Please give me a list of the FM's and not the F4 help option info.

Cheers

1 ACCEPTED SOLUTION
Read only

former_member69765
Contributor
0 Likes
728

1st day of any month is always 01

for last day of month use - RP_LAST_DAY_OF_MONTHS Pass any date of that month to that FM it will return u the last date.

6 REPLIES 6
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
728

Hi,

CONCATENATE sy-datum+0(4) '0101' INTO p_begda.

l_month = sy-datum+4(2) - 1.

UNPACK l_month TO l_month.

CONCATENATE sy-datum0(4) l_month sy-datum6(2) INTO l_date.

  • Getting last day of previous month

CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'

EXPORTING

i_date = l_date

IMPORTING

e_date = p_endda.

Read only

former_member69765
Contributor
0 Likes
729

1st day of any month is always 01

for last day of month use - RP_LAST_DAY_OF_MONTHS Pass any date of that month to that FM it will return u the last date.

Read only

Former Member
0 Likes
728

Check these,they may help u

FIMA_DAYS_AND_MONTHS_AND_YEARS:Difference in dates

CONVERSION_EXIT_IDATE_OUTPUT:Date formatting

HR_IN_GET_DATE_COMPONENTS

DATE_CONVERT_TO_WORKINGDAY

DAYS_BETWEEN_TWO_DATES

LAST_DAY_OF_MONTHS

RP_CALC_DATE_IN_INTERVAL :Calculate the previous date

Regards

Read only

anversha_s
Active Contributor
0 Likes
728

hi,

some more...

SG_PS_GET_LAST_DAY_OF_MONTH

RE_LAST_DAY_OF_MONTH

HR_HCP_GET_LAST_DAY_OF_MONTH

HRVE_LAST_DAY_OF_MONTH

RP_LAST_DAY_OF_MONTHS

SLS_MISC_GET_LAST_DAY_OF_MONTH

LAST_DAY_OF_MONTHS

WSAF_GET_LAST_DAY_OF_MONTH

use this FM - > 

***********

CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = sy-datum
IMPORTING
LAST_DAY_OF_MONTH = v_lastdate. <--Gives you the last day of a Month


data:f_date type sy-datum,
l_date type sydatum.


CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = f_date  
EV_MONTH_END_DATE = l_date.


rgds

Anver

Read only

Former Member
0 Likes
728
Read only

Former Member
0 Likes
728

Hi ,

Here are a few FM used for date manipulation

<b>DATE_IN_FUTURE </b> Add / Substract days from a given date

<b>HR_SGPBS_ADD_TIME_TO_DATE</b> Find the next date based on input date , addition / sub and month , year ,date

<b>CONVERT_DATE_TO_EXTERNAL</b> Convert date to External format

<b>SG_PS_ADD_MONTH_TO_DATE</b> Find the next date based on input date , addition / sub and month , year ,date

<b>DATE_COMPUTE_DATE</b> For a input date gives the day of the week

<b>DATE_GET_WEEK</b>For an input date ,gives the week as output

<b>WEEK_GET_FIRST_DAY</b> Input year and week output is the first day of the week

<b>WEEKDAY_GET</b> Gives the day range , Monday , Tuesday ,…..

<b>RP_CALC_DATE_IN_INTERVAL</b> Calculate Future Date

<b>CALCULATE_DATE</b> Calculate Future Date

<b>FIMA_DAYS_AND_MONTHS_AND_YEARS</b> Difference between two dates

<b>CONVERSION_EXIT_PDATE_INPUT</b> It checks if the date is in future , if yes an error is displayed

Reagrds

Arun