2007 May 14 6:20 AM
hi all..
we can get the date using the sy-datum which has a common format of dd-mm-yyyy..but i have a requirement to change the default format to some other format...can anyone please help me find out a method so that i can change the default format to some other format...
2007 May 14 6:27 AM
hi,
take the date into variable lv_date of data type sy-datum
data: lv_dd(2) type c,
lv_mm(2) type c,
lv_yy(4) type c.
lv_date = sy-datum.
lv_dd = lv_date+6(2), here comes the date
lv_mm = lv_date+4(2), mnth
lv_yy = lv_date+0(4), year..
Npw you can use concatenate statement and make the date in your format..
EG: concatenate lv_dd lv_mm lv_yy into lv_newdate
seperated by '/'.
output: 14/05/2007..
Else if you need months in text you can use relevant Function modules ..
rewards if useful..
regards,
nazeer
hi all..
we can get the date using the sy-datum which has a common format of dd-mm-yyyy..but i have a requirement to change the default format to some other format...can anyone please help me find out a method so that i can change the default format to some other format...
2007 May 14 6:22 AM
2007 May 14 6:23 AM
Hi,
In the Menu goto System --> User Profile --> Own data.
there in the default tab, u can set ur default formats.
Regards,
Himanshu
2007 May 14 6:24 AM
Hi
Split the Day,month and year from the given date format and concatenate them as per your format.
Or use the edit mask command
or use the command WRITE date1 TO date2.
Reward points if useful
Regards
Anji
2007 May 14 6:27 AM
hi
u can change the default settings either through system->user profile-->owndata
or
goto su01 transaction
give username and click change icon...and there ucan change the settings..
2007 May 14 6:27 AM
hi,
take the date into variable lv_date of data type sy-datum
data: lv_dd(2) type c,
lv_mm(2) type c,
lv_yy(4) type c.
lv_date = sy-datum.
lv_dd = lv_date+6(2), here comes the date
lv_mm = lv_date+4(2), mnth
lv_yy = lv_date+0(4), year..
Npw you can use concatenate statement and make the date in your format..
EG: concatenate lv_dd lv_mm lv_yy into lv_newdate
seperated by '/'.
output: 14/05/2007..
Else if you need months in text you can use relevant Function modules ..
rewards if useful..
regards,
nazeer
2007 May 14 6:33 AM
Date and Time Information
The following system fields are always set automatically. If necessary, the GET TIME statement synchronizes the application server time with that of the database server and writes it to the system field SY-UZEIT. SY-DATUM and the system fields for the local time zone, that is SY-TIMLO, SY-DATLO, and SY-ZONLO are also reset.
SY-DATLO
Local date of user, for example 19981129, 19990628.
SY-DATUM
Current (application server) date, for example 19981130, 19990627.
SY-DAYST
During daylight saving time X, otherwise empty.
SY-FDAYW
Factory calendar weekday, Sunday 0 Saturday 6.
SY-TIMLO
Local time of user, for example 154353, 225312.
SY-TZONE
Time difference to Greenwich Mean Time (UTC) in seconds, for example 3600, 10800.
SY-UZEIT
Current (application server) time, for example 164353, 215312.
SY-ZONLO
Time zone of user, for example CET, UTC.
hope its useful for ur question,
reward points if its so,
thanks and regards
vijay
2007 May 14 6:38 AM
Hi,
you can divide the date into day, month and year & can also concatenate the same as per your required format.
You can take the help from this code
data : d_date type sy-datum,
day(2),
month(2),
Year(4),
new_date(10).
d_date = sy-datum.
day = d_date+6(2).
month = d_date+4(2).
year = d_date+0(4).
concatenate day ':' month ':' year into new_date.
write : d_date.
write : new_date.
Regards,
Sandeep Kaushik
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |