‎2009 May 19 1:17 PM
Hi,
How to convert date and time format ?
i.e input date 05/05/2009 input time 00:00:00
output date 05052009. output time 000000
I want to give the output date & time formate to my BAPI field. Is there any FM for convert date & time format.
thanks & regards
santhosh.
‎2009 May 19 1:23 PM
hi,
You can make us of offsets to convert the date in YYYYMMDD format if the date is separated by '/'
or you can also make use of split statement.
The FM to convert date to internal format is 'CONVERT_DATE_TO_INTERNAL'
Regards,
Ankur Parab
‎2009 May 19 1:22 PM
Dear santosh
Take the date and time vales in to some variables and use the below syntax.(please check for the syntax)
REPLACE all occurances of '/' in l_date by space.
REPLACE all occurances of '/' in l_time by space.
condense l_date.
condense l_time.
Hope it helps.
Give points before closing the question.
Regards
Akmal
‎2009 May 19 1:23 PM
hi,
You can make us of offsets to convert the date in YYYYMMDD format if the date is separated by '/'
or you can also make use of split statement.
The FM to convert date to internal format is 'CONVERT_DATE_TO_INTERNAL'
Regards,
Ankur Parab
‎2009 May 27 8:31 PM
what is 'CONVERT_DATE_TO_INTERNAL' how do you use this in Webi report ?
we ahve a problem with this prompt
to_date( @Prompt('Enter Start Date (mm/dd/yyyy format):','D','Prompts\Current Day',mono,free,Not_Persistent,,User:1),'mm/dd/yyyy hh:mi:ss am')
I entered date and time as specified in the format here, mm/dd/yyyy hh:mi:ss am', value like '3/26/2009 12:00:00 am', Webi is complaining with WIS message, 'invalid month', it is seeing month as 26 instead of 3, so I made it 26/3/2009 12:00:00 am, now it is complaining 'invalid time ... time must be between 12 and 0', what should be the time format I enter ?
‎2009 May 27 8:34 PM
what is 'CONVERT_DATE_TO_INTERNAL' how do you use this in Webi report ?
we ahve a problem with this prompt
to_date( @Prompt('Enter Start Date (mm/dd/yyyy format):','D','Prompts\Current Day',mono,free,Not_Persistent,,User:1),'mm/dd/yyyy hh:mi:ss am')
I entered date and time as specified in the format here, mm/dd/yyyy hh:mi:ss am', value like '3/26/2009 12:00:00 am', Webi is complaining with WIS message, 'invalid month', it is seeing month as 26 instead of 3, so I made it 26/3/2009 12:00:00 am, now it is complaining 'invalid time ... time must be between 12 and 0', what should be the time format I enter ?
‎2009 May 19 1:23 PM
Hi,
Simply write a small piece code for it like:
say date1= 05/05/2009.
use:
CONCATENATE date1+0(2)
date1+3(2)
date1+6(4)
INTO date2.date2 will be 05052009.
Similarly for the time also.
Regards.
‎2009 May 19 1:29 PM
Hi,
[Click here|https://wiki.sdn.sap.com/wiki/display/ABAP/ABAPFunctionModules]
--Naveen Inuagnti.
‎2009 May 19 1:32 PM
Hi,
You can convert in following ways
SET TIME MASK: CONTROLS THE THE TIME FIELD FORMAT.
SET DATE MASK: CONTROLS THE DATE FIELD FORMAT.
eg: Set Time mask = ''HH.MM.SS'
Regards
Sathish
‎2009 May 19 1:59 PM
Hi,
Assign the date toa variable
say befdate= 05/05/2009.
the u can use like this:
CONCATENATE befdate+0(2)
befdate+3(2)
befdate+6(4)
INTO aftdate.
similarly u can do for time also.
Regards