‎2007 Jun 03 2:20 PM
Hi all,
how to change the date formate in the WRITE statement directly.
ex: write:/ p0000-begda.
i need to conver date into desired formate in the output only.
waiting for reply.
thanks
‎2007 Jun 03 2:35 PM
See the below example program :
India Date format :
data : v_date(10) type c,
v_day(2) type c,
v_month(2) type c,
v_year(4) type c.
data : date(8) type c.
start-of-selection.
date = sy-datum.
v_year = date+0(4).
v_month = date+4(2).
v_day = date+6(2).
concatenate v_day '/' v_month '/' v_year into v_date.
write:/ v_date.
USA date Format :
data : v_date(10) type c,
v_day(2) type c,
v_month(2) type c,
v_year(4) type c.
data : date(8) type c.
start-of-selection.
date = sy-datum.
v_year = date+0(4).
v_month = date+4(2).
v_day = date+6(2).
concatenate v_month '/' v_day '/' v_year into v_date.
write:/ v_date.
if you need only output then use like this
WRITE: / sy-datum DD/MM/YYYY.
Reward Points if it is helpful
Thanks
Seshu
Message was edited by:
Seshu Maramreddy
‎2007 Jun 03 3:29 PM
Hello Prakash
Have a look in the keyword documentation for the <b>WRITE </b>statement. To output dates in a specific format you can use the following option:
WRITE: / p0000-begda DD/MM/YYYY. " or YYYY/MM/DDRegards
Uwe
‎2007 Jun 04 4:44 AM
Hi Prakash,
Just go to 'Formatting Options' of the WRITE statement in the ABAP documentation, and you could find a variety of ways in which dates can be formatted. These are :
1.DD/MM/YY
2.MM/DD/YY
3.DD/MM/YYYY
4MM/DD/YYYY
5.DDMMYY
6.MMDDYY
7.YYMMDD
You just need to use it the way Uwe has mentioned.
Hope this helps.
Regards
Anil Madhavan
‎2007 Jun 04 7:38 AM
Hi Prakash,
Use the syntax :
WRITE p0000-begda DD/MM/YYYY.
Award points if found useful.
Regards
Indrajit