08-01-2007 12:16 PM
hi,
i am reading the date from list.
inthat list the date is like 25.06.2007
that date can be update in data base for this 20070625 i have done by concatenet
i am getting correct.
but if the user profile in yyyy:mm:dd
2007.06,25
how i know user profile is yyyy:mm:dd or dd:mm:yyyy.
08-01-2007 12:18 PM
hi,
In the Menu bar
Goto->System->User Profile->Own Data
There u can see all the default settings.
08-01-2007 12:19 PM
Hi,
Here is the solution.
Date: Date1 type Sy-datum.
Data: Date2(10) type c.
Date1 = '20070625'
Write Date1 to Date2.
Write: Date2.
here the Date2 will have the iser format date
Regards
Sudheer
08-01-2007 12:20 PM
You can see the settings of your system.
In the Menu bar
System->User Profile->Own Data-> and then Defaults.
See your system settings.
Regards,
Pavan
08-01-2007 12:23 PM
If u want to check the format at runtime in ur coding..
to check date format : yyyy:mm:dd or dd:mm:yyyy.
simply first check first 4 chars , it doesn't contain ( <b>: </b>), then its in YYYY:MM:DD format else in DD:MM:YYYY format..
like
date = 2005:10:12
if date+0(4) CS ':'.
then format is DD:MM:YYYY.
else
then format is YYYY:MM:DD
endif.
08-01-2007 12:24 PM
Data: V_Date1 type Sy-datum,
V_Date2(10) type c.
Write V_ Date1 to V_Date2.
so, V_Date2 will have the date format of the user login.
08-01-2007 12:33 PM
Hi,
Just do this.
Get the date in a variable of type sy-datum(lv_date type sy-datum).
Declare a variable of char 10.(lv_dat(10) type c)
Then just use the write command.
Write lv_date to lv_dat.
The date will be written to whatever is the user settings.
Thanks,
Sandeep.
08-01-2007 12:53 PM
Hi,
If you want to see the User default date parameter format you can go to the SU3 transaction->Defaults tab->Date format.
To programatically obtain this use the USR01 table. Pass the USR01-BNAME = sy-uname and retrieve the record with a select single. The USR01-DATFM will list the values. It will give you the key vakues only (1, 2, 3, 4, 5, 6, 7, 8, 9, A, B). Now use the Function module STF4_GET_DOMAIN_VALUE_TEXT. Pass the import parameters as follows
IV_DOMNAME='XUDATFM' ,
IV_VALUE=key value from USR01-DATFM.
Now if you read the EV_VALUE_TEXT parameter it will give you the Date fomat.
Hope it solve your query. Reward points if helpful.
- Irudayaraj Peter