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 days to a particular date

Former Member
0 Kudos

HI,

I want to add days to a particular date and this should be working days or factory calender days.For example if i am having a date w_date = 12032008 and w_days = 10.Then i have to check the working days for US and add 10 working days and get the resultant date. How to do this.Is there any function module to do this or code to do this.

Regards,

Sowmya.

7 REPLIES 7

Former Member
0 Kudos

Hello Sowmya,

Try

HR_SEN_CALE_DAYS_DATE.

BKK_ADD_WORKINGDAY .

Regards,

Mandeep

Former Member
0 Kudos

hi,

exactly i didn't remmber.

But i will give advse.

Go through SE37 transaction

ENter BKKworkday* and press the F4

then u got ur desired fucntion module.

Former Member
0 Kudos

Use FM RP_CALC_DATE_IN_INTERVAL_SG - Date +/- year/month/day (into the future/past)

former_member156446
Active Contributor
0 Kudos

1.To get a date from a given date +/- period. Input : Date & Period (No. of Days) Output : Calculated Date

Please go through the Function Module "RELATIVE_DATE_CALCULATE". Remember to enter the date in 'yyyymmdd' format in the start date field.

2.if the days variable is integer and other 2 like sy-datum, the math below yields the number of days to yo.. start date = '23.07.2003' End date = '23.09.2003' Days = enddate - Start date.

3. Please go through the Functions Module , it gives date as well as time difference, though U may have to enter time as well. SD_DATETIME_DIFFERENCE

4. with this FM you can get dates between two dates : Function Module RP_CALC_DATE_IN_INTERVAL 5. go into SE37 and search on 'difference between dates', one of these 3 keywords or a combination between the 3 will give you a function module.

6. Date Upper & Lower limit: the lower is obviously the 1st of the month. To get the upper use function module END_OF_MONTH_DETERMINE.

7. to get the logon user setting date dynamically : Using offsets move it into a date field,obviously in the format yyyymmdd. then move it into a char(10) field. U get the data in char(10) using the current user's setting. ex:: w_date type d value '20030822', w_char(10). say logon user setting is mm/dd/yyyy. write w_date to w_char. w_char will have the value 08/22/2003.

You can use the result of the move stmt in bdc table.

8. Check this FM "/SAPDMC/LSM_DATE_CONVERT "

9.statements: 1. CONVERT DATE f1 INTO INVERTED-DATE f2. 2. CONVERT INVERTED-DATE f1 INTO DATE f2.

Calculates the nine's complement of the internal date format (YYYYMMDD - for more information about internal display, meaning and initial values of types and places it in the field f2.

For example, 19950511 ==> 80049488 or 80049488 ==> 19950511.

In the inverse date format, the most recent date has the numerically smallest value. You can make use of this effect when sorting dates.

10. GET TIME STAMP : returns the timestamp in short or long form. The short form contains the current date and time : DATA: s_tst TYPE timestamp, l_tst TYPE timstampl, tzone TYPE timezone. GET TIME STAMP FIELD s_tst. "Short form GET TIME STAMP FIELD l_tst. "Long form tzone = 'UTC '. "Time zone WRITE: / s_tst TIME ZONE tzone, / l_tst TIME ZONE tzone.

Then, The short form might then contain the value 19980204163520, while the long form has the value 19980204163520,1234560.

The time stamp can be converted by using CONVERT TIME STAMP and CONVERT DATE

11.Some system fields: DATLO Local date for user DATUT Global date related to UTC (GMT) TSTLO Timestamp (date and time) for user TSTUT Timestamp (date and time) related to UTC (GMT)

12. Check the site http://funciones.sapabap.cc for functions like DATE_CHECK_PLAUSIBILITY Check to see if a date is in a valid format for SAP.

Works well when validating dates being passed in from other systems.

DATE_COMPUTE_DAY Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.

DATE_GET_WEEK will return the week that a date is in.

DATE_IN_FUTURE Calculate a date N days in the future.

DAY_ATTRIBUTES_GET Return useful information about a day. Will tell you the day of the week as a word (Tuesday), the day of the week (2 would be Tuesday), whether the day is a holiday, and more.

F4_DATE for popping up calendar for date help on value request

RH_GET_DATE_DAYNAME return the day based on the date provided

RP_CALC_DATE_IN_INTERVAL Add/subtract years/months/days from a date

RP_LAST_DAY_OF_MONTHS Determine last day of month

WEEK_GET_FIRST_DAY For a given week (YYYYMM format), this function returns the date of the Monday of that week.

former_member705122
Active Contributor
0 Kudos

Hi,

HR_GET_LEAVE_DATA

- Get all leave information (includes leave entitlement, used holidays/paid out holidays)

HOLIDAY_GET

- Provides a table of all the holidays based upon a Factory Calendar &/ Holiday Calendar.

RP_CALC_DATE_IN_INTERVAL

- Add/subtract years/months/days from a date

Regards

Adil

Former Member
0 Kudos

hi

fllowing r the Fm that r being used in date and time problem solving

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

Cheers

snehi

Former Member
0 Kudos

Got the solution.

BKK_ADD_WORKINGDAY.