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 field issue

Former Member
0 Likes
1,024

Hi All,

If Iam having a date, say 28/02/2008. I wan to add '1' to this date.

DATE1 = '20080228'.

DATE2 = DATE1 + 1.

Now DATE2 will gimme '20080229'. But I should get 2008/03/01.

Is it possible ot get the same.

Regards,

Viji

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,005

Hi,

Use this Function module

CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY

Regards

Manasa

10 REPLIES 10
Read only

Former Member
0 Likes
1,006

Hi,

Use this Function module

CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY

Regards

Manasa

Read only

0 Likes
1,005

Hi Manasa,

I think 'CONVERSION_EXIT_PDATE_OUTPUT' will not help for this.

Regards,

Viji.

Read only

0 Likes
1,005

hii,

we have 29 days in feb this year.

with regards,

sandeep akella.

Read only

Former Member
0 Likes
1,005

Hi,

It is the correct result. Year 2008 is a Leap year and has 29 days. IF you change the year to 2007 or 2009, it will give you 1st March.

If you want 2008 add 2 to the date 20080228 , you will get what you want.

regards,

Advait

Read only

Former Member
0 Likes
1,005

This code works.


DATA: l_date TYPE sy-datum.

l_date = sy-datum.

l_date = l_date + 1.

WRITE l_date.

Regards

Sam

Read only

Former Member
0 Likes
1,005

REPORT ZSRK_045 .

DATA : V_DATE LIKE SY-DATUM.

DATA : DATE LIKE SY-DATUM.

DATE = '20080228'.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

DATE = DATE

DAYS = 1

MONTHS = 0

SIGNUM = '+'

YEARS = 0

IMPORTING

CALC_DATE = V_DATE.

WRITE : / V_DATE.

Read only

Former Member
0 Likes
1,005

hi,

2008 is a leap year

try the same with date 20070228

you will get the desired result.

Regards,

Prakash Pandey

Read only

Former Member
0 Likes
1,005

Hi, I got the solution for this.

THANKS ALOT.

Read only

Former Member
0 Likes
1,005

HI,

try this Fm

BKK_ADD_WORKINGDAY

Read only

Former Member
0 Likes
1,005

Hi,

The ouput you are getting is correct. 2008 is a leap year.

Thanks.