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

Function Modules on date and day.

Former Member
0 Likes
1,089

I need to calculate the date of the following Sunday based upon the current date.Could you suggest how to go calculate the same and if there are any function modules to do the same.

8 REPLIES 8
Read only

Former Member
0 Likes
1,007

Using the FM <b>HR_GB_DAY_RELATIVE_TO_DATE</b> if you give the current date it will give you the adding or subtracting u get Sunday date .

Read only

Former Member
0 Likes
1,007

Hi,

Go to SE37 and enter GETDATE* you will get so many Fun modules,

use the relative one

Regards,

Anji

Read only

Former Member
0 Likes
1,007

try this..

CALL Function 'GET_WEEK_INFO_BASED_ON_DAT'

exporting

date = ldate

importing

week = lweek

monday = lmon

sunday = lsun.

or use day_in_week FM and manuplate accordingl

Read only

Former Member
0 Likes
1,007

HI use this Fm

GET_WEEK_INFO_BASED_ON_DATE

Regards,

Vijay

Read only

Former Member
0 Likes
1,007

Hi,

Try FM <b>HR_GB_DAY_RELATIVE_TO_DATE</b>

reward if useful.

Read only

Former Member
0 Likes
1,007

HI sandeep this will give u the best results....



parameters:
  p_date like sy-datum ." here u give the required date
data:
  w_date1 type i,
  w_mod type i.



  w_date1 = p_date.

*  write: / p_date1.

  w_mod = w_date1 mod 7.

  write: / w_mod.

  if w_mod ne 0.
    w_date1 = w_date1 + ( 7 - w_mod + 1 ).
  else.
    w_date1 = w_date1 + 1.
  endif.

  move w_date1 to p_date.

  write: / 'the following sunday is ',p_date.

I hope it will helps u..

if helps reward with points..

Regards Rk..

null

Read only

Former Member
0 Likes
1,007

The following are some of the function Modules which may help you...

<b>GET_WEEK_INFO_BASED_ON_DATE</b>

<b>LAST_WEEK</b>

<b>NEXT_WEEK</b>

<b>DATE_TO_DAY</b>

<b>TIME_CONVERSION</b>

<b>LOOK_FOR_TIME_TABLE</b>

<b>CONVERT_TIME_TERMS</b>

Reward if it helps you....

Read only

Former Member
0 Likes
1,007

Ok