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: 

System Date Format

Former Member
0 Kudos

hi ,

how can i find the system date format.

regards

arun

5 REPLIES 5

Former Member
0 Kudos

Check table <b>USR01</b>, field <b>DATFM</b>.

if DATFM = 1, format is DD.MM.YYYY

If you want the path, SYSTEM --> USER PROFILE --> OWN DATA

Regards,

Subramanian V.

0 Kudos

HI,

MY PROBLEM IS I AM DOING A BDC , IN WHICH THERE IS A DATE ENTRY , HOW DO I CHECK WHETHER THE DATE FROM THE FLAT FILE HAS THE SAME FORMAT AS MY SYSTEM.

REGARDS

ARUN

0 Kudos

The BDC will be run by some user (say ABC), select the date format from usr01 for ABC and comepare it with the input (from file) and do a conversion if required.


select single datfm into usr01-datfm from usr01 where
                                       bname eq sy-uname .

if wf_datfm eq '1' .
    concatenate loc_date+6(2)
                loc_date+4(2)
                loc_date+0(4)
                into wf_date separated by '.' .
    condense wf_date .

  elseif wf_datfm eq '2' .
    concatenate loc_date+4(2)
                loc_date+6(2)
                loc_date+0(4)
                into wf_date separated by '/' .
    condense wf_date .

  elseif wf_datfm eq '3' .
    concatenate loc_date+4(2)
                  loc_date+6(2)
                  loc_date+0(4)
                  into wf_date separated by '-' .
    condense wf_date .
  elseif wf_datfm eq '4' .
    concatenate loc_date+0(4)
                  loc_date+4(2)
                  loc_date+6(2)
                  into wf_date separated by '.' .
    condense wf_date .
  elseif wf_datfm eq '5' .
    concatenate loc_date+0(4)
                  loc_date+4(2)
                  loc_date+6(2)
                  into wf_date separated by '/' .
    condense wf_date .
  elseif wf_datfm eq '6' .
    concatenate loc_date+0(4)
                  loc_date+4(2)
                  loc_date+6(2)
                  into wf_date separated by '-' .
    condense wf_date .
  endif .

Regards

Raja

0 Kudos

Hello Arun,

In case of the BDC, you have to know the format in which the date is stored in the file. Let us say that the date in your flat file is stored in the format DD/MM/YYYY.


data: w_flat_file_date(10) value '29/12/2004'.
data: w_temp_date type d,
      w_screen_date(10) type c. 

w_temp_date+0(4) = w_flat_file_date+6(4).
w_temp_date+4(2) = w_flat_file_date+3(2).
w_temp_date+6(2) = w_flat_file_date+0(2).

write w_temp_date to w_screen_date.

Now, w_screen_date contains the date in the format in which it is displayed on the screen.

Hope this helps,

Regards,

Anand Mandalika.

athavanraja
Active Contributor
0 Kudos

System date format is always YYYYMMDD.

if you want to find out about user specific date format you can get the same from USR01-DATFM

Regards

Raja