Application Development 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: 

adding the 3 digit days to date

Former Member
0 Kudos

Hi Folks

I want display the future date by adding the no of days to the current date, here the intresting thing is the user wants enter the 3 digit number also( EX: 360). i analysed the all standard FMs, which are accepting the days in 2 digit ormat only.

could please tell me is there any a FM support this functionality. or can i code the required logic in program itself? if yes , please explain how?

thanks in advance.

regards

priya:)

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You don't need a FM.

data: date type sy-datum.

date = sy-datum + 360.

Regards

Rich Heilman

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You don't need a FM.

data: date type sy-datum.

date = sy-datum + 360.

Regards

Rich Heilman

former_member181966
Active Contributor
0 Kudos

You can also Try FMs

<b>HR_SEN_CALE_DAYS_DATE</b>

WDKAL_DATE_ADD_FKDAYS

Hope this’ll give you idea!!

<b>Pl... award the points.</b>

Good luck

Thanks

Saquib Khan

"Some are wise and some are otherwise"

Former Member
0 Kudos

Hi,



Data : date1 type dats.
Data : date2 type dats.
Data : days  type i.

date1 = <Any valid date>.
days  = <Any integer Value>.

date2 = date1 + days.


Former Member
0 Kudos

Hi Priya,

U can use the FM <b>"ADD_TIME_TO_DATE"</b>

CALL FUNCTION 'ADD_TIME_TO_DATE'

EXPORTING

i_idate = <b>sy-datum</b>

i_time = <b>30</b>

  • i_iprkz =

  • I_RDMHD =

IMPORTING

O_IDATE = <b>ws_Date1</b>

EXCEPTIONS

INVALID_PERIOD = 1

INVALID_ROUND_UP_RULE = 2

INTERNAL_ERROR = 3

OTHERS = 4

.

Reward if helpful

Regards,

Tushar

Message was edited by: Tushar Marshall Dass

Former Member
0 Kudos

data : v_datum type sy-datum.

data : v_int type i.

i = 300.

v_datum = sy-datum + i.

*--v_datum will have 300th day from today.SAP will take care of putting the date in that accordingly.

Regards,

Srikanth.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Please make sure to award points for all helpful answers and mark you post as solved when solved completely. Thanks.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi priya,

f_date = sy-datum + 360.

the sap system will take care of the date.

reward if helpful.

regards,

keerthi.