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

Need function modules for date manupulation

Former Member
0 Likes
399

HI,

Could you please suggest the function module the below reqiurments

1) adding days to date.

ex: 20 days to 25.03.2008 = 15.04.2008

2) To find the given date is working date or not according to factory calender id.

3) To find the previous or last working date to the given date(Holiday date) according to the factory calender id.

It is very urgent requirment. please help me.

Thanks in advance

sathish kumar swamy

2 REPLIES 2
Read only

Former Member
0 Likes
376

Add days

ADD_TIME_TO_DATE

Check working day

DATE_CHECK_WORKINGDAY

Holyday I think you can do it using the holyday and going in reverse until you find the working day

Edit

I found this one

DATE_CONVERT_TO_WORKINGDAY

It can give you the last working or the next working day

Edited by: Ramiro Escamilla on Mar 25, 2008 5:10 PM

Read only

Former Member
0 Likes
376

hi use this...

RE_ADD_MONTH_TO_DATE

DATE_CONVERT_TO_FACTORYDATE

CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'

EXPORTING

I_DATE_OLD = date1

IMPORTING

E_DATE_NEW = date1

.

data date2 like sy-datum.

date2 = date1 + 1.

write date2.

If you put 27.12.2005 as the input date, date2 you will get as 01.12.2005.

Or else you can use the following code:

v_startdate = sy-datum.

v_startdate+6(2) = '01'.

v_enddate = v_startdate.

if v_enddate+4(2) >= '01' AND v_enddate >= '11'.

v_endate4(2) = v_enddate4(2) + 1.

elseif v_enddate = '12'.

v_enddate+4(2) = '01'.

v_enddate(4) = v_enddate(4) + 1.

endif.

v_enddate = v_enddate - 1.

regards,

venkat.