‎2006 Aug 22 6:14 PM
Hi all,
I would like to get a Function module which returns date, month and year into separate paramaters taking date as input.
Kindly help me out.
Thanks
Arunkumar S
‎2006 Aug 22 6:22 PM
‎2006 Aug 22 6:28 PM
lv_datum like sy-datum
write date to lv_datum
year =lv_datum+0(4)
month = lv_datum+5(2)
day= lv_datum+7(2)
my offset might be wrong... just check
‎2006 Aug 22 6:36 PM
hi
you can do it manually using offset validations.
suppose you have the date in the format yyyymmdd.
then you can split as follows..
data: dat1 like mara-laeda value '20060822',
year(4),
month(2),
day(2).
year = dat1+0(4).
month = dat13(2).
day = dat1+5(2).
Cheers,
Abdul Hakim
‎2006 Aug 22 8:15 PM
Hai
parameters : p_date(8) default '20061025'.
data : v_out type sy-datum.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = p_date
IMPORTING
DATE_INTERNAL = v_out.
write 😕 v_out.
Regards
Sreeni
‎2006 Aug 22 8:27 PM
if your date format is in YYYYMMDD,
you can use OFFSET to get the values seperately
V_DATE = '20060102'.
v_year = v_date+0(4).
V_month = V_DATE+4(2).
V_days = V_DATE+6(2).
Regards
srikanth