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

FM name....????

Former Member
0 Likes
1,126

Hi,

can anyone tell me FM name to get the date of 6 month back from today...????

Thanks in advance...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,099

hi Sandeep,

CALCULATE_DATE : Calculates the future date based on the input .

v DATE_TO_DAY : Returns the Day for the entered date.

v DATE_COMPUTE_DAY : Returns weekday for a date

v DATE_GET_WEEK : Returns week for a date

v RP_CALC_DATE_IN_INTERVAL : Add days / months to a date

v DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified

v MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.

v END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.

v HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.

v FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.

v MONTH_NAMES_GET : Get the names of the month

v WEEK_GET_FIRST_DAY : Get the first day of the week

this moght help u

Amit

Hi,

can anyone tell me FM name to get the date of 6 month back from today...????

Thanks in advance...

9 REPLIES 9
Read only

Former Member
0 Likes
1,099

Hi,

Check this link-

Regards,

Sujit

Read only

bpawanchand
Active Contributor
0 Likes
1,099

Hi

there is no need of any function modules you can subtract the number of days from the given date then you will get the desired result.

Regards

Pavan

Read only

Former Member
0 Likes
1,099

hi sandeep,

Try to use the function module CALCULATE_DATE.

Best of luck,

Bhumika

Read only

Former Member
0 Likes
1,100

hi Sandeep,

CALCULATE_DATE : Calculates the future date based on the input .

v DATE_TO_DAY : Returns the Day for the entered date.

v DATE_COMPUTE_DAY : Returns weekday for a date

v DATE_GET_WEEK : Returns week for a date

v RP_CALC_DATE_IN_INTERVAL : Add days / months to a date

v DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified

v MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.

v END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.

v HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.

v FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.

v MONTH_NAMES_GET : Get the names of the month

v WEEK_GET_FIRST_DAY : Get the first day of the week

this moght help u

Amit

Read only

Former Member
0 Likes
1,099

Hi Sandeep,

Check these function modules for date calculations:

CALCULATE_DATE : Calculates the future date based on the input .

DATE_TO_DAY : Returns the Day for the entered date.

DATE_COMPUTE_DAY : Returns weekday for a date

DATE_GET_WEEK : Returns week for a date

RP_CALC_DATE_IN_INTERVAL : Add days / months to a date

MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.

END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.

HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.

FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.

MONTH_NAMES_GET : Get the names of the month

WEEK_GET_FIRST_DAY : Get the first day of the week

HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format

SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours

L_MC_TIME_DIFFERENCE : Find the time difference between two date/time

HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months

LAST_DAY_OF_MONTHS : Returns the last day of the month

DATE_CHECK_PLAUSIBILITY :Check for the invalid date.

Hope this helps you.

Regards,

Chandra Sekhar

Read only

former_member787646
Contributor
0 Likes
1,099

Hi

Try the FM: RP_CALC_DATE_IN_INTERVAL

In the parameters set the parameter SIGNUM = '-' . ( Minus Sign )

Hope this would help you.

Murthy

Read only

Former Member
0 Likes
1,099

Hi Sandeep,

Try this FM;

MONTH_PLUS_DETERMINE

Add or subtract months from a date. To subtract a month, enter a negative value for the 'months' parameter.

data: new_date type d.

CALL FUNCTION 'MONTH_PLUS_DETERMINE'
  EXPORTING
    months        = -5       " Negative to subtract from old date, positive to add
    olddate       = sy-datum
 IMPORTING
   NEWDATE       = new_date.

write: / new_date.

With luck,

Pritam.

Read only

Former Member
0 Likes
1,099

Use FM MONTH_PLUS_DETERMINE. Call this FM with a -ve value for month as shown below:

CALL FUNCTION 'MONTH_PLUS_DETERMINE'

EXPORTING

MONTHS = '-6'

OLDDATE = SY-DATUM

IMPORTING

NEWDATE = V_NEXTMONTH.

Regards,

Joy.

Read only

Former Member
0 Likes
1,099

Hi,

DATA: P_MONTHS LIKE T5A4A-DLYMO,
      P_SIGNUM LIKE T5A4A-SPLIT VALUE '+',
      DAYS LIKE T5A4A-DLYDY,
      YEARS LIKE T5A4A-DLYYR,
      NEW_DATE LIKE P0001-BEGDA.

PARAMETERS: P_DATE LIKE P0001-BEGDA.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
  EXPORTING
    DATE            = P_DATE
    DAYS            = '0'
    MONTHS          = '06'
   SIGNUM          =  '-'
    YEARS           = '00'
 IMPORTING
   CALC_DATE       = NEW_DATE.

WRITE: NEW_DATE.

Even we have another function module 'months_plus_determine'.

Hope this helps you.

plz reward if useful.

thanks,

dhanashri.