Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

date problem

Former Member
0 Kudos

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.

7 REPLIES 7

Former Member
0 Kudos

hi,

In the Menu bar

Goto->System->User Profile->Own Data

There u can see all the default settings.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

former_member183890
Participant
0 Kudos

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