‎2008 Jul 30 9:20 AM
Hi,
How to convert string "20080704" to date format?
Regards,
Asha
‎2008 Jul 30 9:24 AM
Hi,
Check this sample code,
DATA:
w_date1 TYPE sy-datum,
w_date TYPE string VALUE '20080730'.
w_date1 = w_date .
WRITE: w_date1.Regards
Adil
‎2008 Jul 30 9:21 AM
use edit mask or offset values..
data: v_data type string ,
data(10) type c .
v_data = '20080101'.
data = v_data .
write:/ data using edit mask '____/__/__'.
‎2008 Jul 30 9:21 AM
‎2008 Jul 30 9:21 AM
Hi,
1.Take a variable of type sy-datum
2. Assign your string to the variable.
Data:
date type sy-datum.
...........
...........
date = string.Regards,
anirban
‎2008 Jul 30 9:24 AM
Hi,
Check this sample code,
DATA:
w_date1 TYPE sy-datum,
w_date TYPE string VALUE '20080730'.
w_date1 = w_date .
WRITE: w_date1.Regards
Adil
‎2008 Jul 30 9:45 AM
‎2008 Jul 30 9:25 AM
Use edit mask ..
data : v_d1(10) value '20080704'.
write 😕 v_d1 using edit mask '____/__/__'.
‎2008 Jul 30 9:25 AM
hi,
Assign that value to a field of type sy-datum.
eg.
Date = sy-datum.
Date = '20080704'.
Regards
Sumit Agarwal
‎2008 Jul 30 9:26 AM
Hi Asha,
Try this code below :
data :
w_string type string value '20080704',
w_date type sy-datum.
w_date+0(4) = w_string+0(4). " Year
w_date+4(2) = w_string+4(2). " Month
w_date+6(2) = w_string+6(2). " Day
write : / w_date.Regards,
Swapna.
‎2008 Jul 30 9:34 AM
hi
use this FM
HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format
Cheers
Snehi
‎2008 Jul 30 9:36 AM
Hi
Use the Function Module "CONVERSION_EXIT_ALPHA_INPUT"
Hope it helps.
Murthy
‎2008 Jul 30 9:37 AM
Hi Asha,
Just check this ... i hope this will solve ur problem..
data:date1 like sy-datum.
data:months type i,
days type i,
r_date(10) type c.
date1 = '20081015'.
months = date1+4(2).
days = date1+6(2).
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
DAYS = DAYS
MONTHS = MONTHS
START_DATE = SY-DATUM
IMPORTING
RESULT_DATE = r_date.
write:r_date.
Thanks & Regards
Ashu Singh
.
‎2008 Jul 30 9:45 AM
Hi Asha.
I would like to suggest a few references,
[SDN - Reference for Conversion of String to Date format|;
[SDN - Reference for formating string to date format|;
[SDN - Reference - Problem with Userdefined Date Format function|]
[SDN - Reference for Date data type conversion into String data type|;
Hope that's usefull.
Good Luck & Regards.
Harsh Dave