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

date

Former Member
0 Likes
829

I need to use today's date as to dat

today's date = sy-datum.

How to get a date 12 months from today's date.

7 REPLIES 7
Read only

former_member188829
Active Contributor
0 Likes
794

Hi,

Use FM:RP_CALC_DATE_INTERVAL

Check this Program.

DATA:date2 TYPE d.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
  EXPORTING
    date            = sy-datum
    days            = 0
    months          = 12
   signum          = '+'    "For adding months +,For subtracting -
    years           = 0
 IMPORTING
   calc_date       = date2
          .
WRITE:date2.

Read only

Former Member
0 Likes
794

hi,

do this way ..


CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = date
days = '00'
months = '12'
signum = '+'
years = '00'
IMPORTING
calc_date = v_date.   "<<< will have 12 months date..

Read only

Former Member
0 Likes
794

hi check this..

parameters:p_date type sy-datum .

or check this..

report message-id zmsf.

DATA:

l_select_date LIKE workflds-gkday,

l_select_week LIKE scal-week.

  • pop up calendar.

CALL FUNCTION 'F4_DATE'

EXPORTING

date_for_first_month = sy-datum

IMPORTING

select_date = l_select_date

select_week = l_select_week

EXCEPTIONS

calendar_buffer_not_loadable = 1

date_after_range = 2

date_before_range = 3

date_invalid = 4

factory_calendar_not_found = 5

holiday_calendar_not_found = 6

parameter_conflict = 7

OTHERS = 8.

IF sy-subrc <> 0.

EXIT.

ENDIF.

  • Validate date - An invalid date is caused by using the cancel

  • button on the calendar

CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'

EXPORTING

date = l_select_date

EXCEPTIONS

plausibility_check_failed = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • User has cancelled the calendar

EXIT.

ENDIF.

regards,

venkat

Read only

Former Member
0 Likes
794

hi

RP_CALC_DATE_INTERVAL this FM does not exist

try this

RP_CALC_DATE_IN_INTERVAL

cheers

snehi

Read only

0 Likes
794

Hi Chouhan,

You are right

The Function module Name is RP_CALC_DATE_IN_INTERVAL

But i have used the same function module in my program

Read only

Former Member
0 Likes
794

Hi,

Use the FM

CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'

EXPORTING

MONTHS = '12'

OLDDATE = D_DATE_NM_FD

IMPORTING

NEWDATE = D_DATE_NM_FD.

and give number of months in input

reward point if found helpful

Read only

Former Member
0 Likes
794

Hi,

Use the any of the function modules.

SG_PS_ADD_MONTH_TO_DATE

MONTH_PLUS_DETERMINE

BKK_ADD_MONTH_TO_DATE

RE_ADD_MONTH_TO_DATE

HR_PSD_DATES_ADD_MONTHS

HR_HCP_ADD_MONTH_TO_DATE

HR_JP_ADD_MONTH_TO_DATE

HR_BR_ADD_MONTH_TO_DATE

HR_PT_ADD_MONTH_TO_DATE