09-25-2008 5:58 AM
Hi Abappers,
I am getting error when i am passing date field in function module Date_get_week i want to pass the date which i have given in select-options: s_budat for bsad-budat.
Regards,
simba.
09-25-2008 6:57 AM
Hi,
use as following
tables:bsad.
select-options: s_date for bsad-budat.
data: week type KWEEK.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = s_date-low " or s_date-high
IMPORTING
WEEK = WEEK
EXCEPTIONS
DATE_INVALID = 1.
Regards,
Raju.
09-25-2008 6:02 AM
HEllo,
Try this sample code:
data: l_t_deldat type table of edatu,
l_f_date like scal-date.
data: l_f_deldatwk like scal-week.
call function 'DATE_GET_WEEK'
exporting
date = l_f_date
importing
week = l_f_deldatwk.
concatenate l_f_deldatwk+4(2) '.' l_f_deldatwk+0(4)
into l_f_deldat.
write: l_F_deldate
Cheers,
Vasanth
09-25-2008 6:02 AM
Hi,
I gave just like this 'YYYYMMDD'.
It works.
Try this.
Anyway get into 'SU01' and check your default date format and give that formatted date as inout.
Regards,
R.Nagarajan.
09-25-2008 6:57 AM
Hi,
use as following
tables:bsad.
select-options: s_date for bsad-budat.
data: week type KWEEK.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = s_date-low " or s_date-high
IMPORTING
WEEK = WEEK
EXCEPTIONS
DATE_INVALID = 1.
Regards,
Raju.
09-25-2008 6:58 AM
Hi simba ravi,
U are getting error or dump because might be passing select-option date which stores the data in internal table...
either u should use PARAMETERS here
Or u can do in below way... use HIGH and LOW options of select-options here...
SELECT-OPTIONS : DATE1 FOR SY-DATUM.
DATA: WEEK1 LIKE SCAL-WEEK.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = DATE1-LOW
IMPORTING
WEEK = WEEK1
EXCEPTIONS
DATE_INVALID = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE 😕 'Week Number' , WEEK1+4(2).
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7