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 and time field values

Former Member
0 Kudos

hai.........

How are the date and time field values stored in SAP?

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

see the data tyep for Date and time as below ..

For   Date -> Data Type     ->   DATS       Date field (YYYYMMDD) stored as char(8)
For  Time -> Data Type       ->  TIMS	  Time field (hhmmss), stored as char(6)

that is why when we upload the date and time we use the logic to convert it into SAP format .

Date format for entry into BDC

Because a date field is stored and displayed in different formats within SAP the following code is required to convert the date into a format which can be input onto a screen field.

Example :

Date field         
  data: ld_date(8).
  
  ld_date(2)   = sy-datum+6(2).
  ld_date+2(2) = sy-datum+4(2).
  ld_date+4(4) = sy-datum(4).

reward points if it is usefull ...

Girish

9 REPLIES 9

Former Member
0 Kudos

hi

we can declare the date in fields by using 'DATUM'

Former Member
0 Kudos

It depends how u set ur settings.

U can check how ur system is set. Follow the following steps

1. Goto SE11

2.Eneter any table say for example VBPA

3.Go for display

4.in the Menu bar you have

System->Userprofile->Own data

U will be taken to screen Maintain User profile screen.

Here u can see Defaults tab, click that and then you can see the different format and the format set for you system.

If u give ur mail id I can send you the screen shots.

Let me know if it is not clear.

Regards,

Ravi

0 Kudos

hai ravi...

this is my mail id kpavan07@rediffmail.com

can u send me asap.....

thanks and regards

pavan

0 Kudos

hai ravi...

can u send me the material to my mail is...

kpavan07@rediffmail.com asap.....

Former Member
0 Kudos

Hi,

The date field is stored as the type <b>DATS</b> and the time is stored as the type <b>TIMS</b>. The system field SY-DATUM will give current date and SY-UZEIT will give Current Time of Application Server.

You can refer the table SYST for finding the various type of system fields.

Reward if useful.

Regards,

Renjith Michael.

Former Member
0 Kudos

see the data tyep for Date and time as below ..

For   Date -> Data Type     ->   DATS       Date field (YYYYMMDD) stored as char(8)
For  Time -> Data Type       ->  TIMS	  Time field (hhmmss), stored as char(6)

that is why when we upload the date and time we use the logic to convert it into SAP format .

Date format for entry into BDC

Because a date field is stored and displayed in different formats within SAP the following code is required to convert the date into a format which can be input onto a screen field.

Example :

Date field         
  data: ld_date(8).
  
  ld_date(2)   = sy-datum+6(2).
  ld_date+2(2) = sy-datum+4(2).
  ld_date+4(4) = sy-datum(4).

reward points if it is usefull ...

Girish

Former Member
0 Kudos

Hi,

just try this code you will get system date and time.

write sy-datum.

write / SY-UZEIT.

IF USEFULL REWARD POINTS

Former Member
0 Kudos

Hi Pawan

Dates and time will be stored in SYST table.

You can try this code, you will get result.

write sy-datum.

write / sy-uzeit.

if it is useful reward the points.

Thanks

senthil

Former Member
0 Kudos

Hi Pawan,

Irrespective of your user settings, SAP has a standard way of storing date in YYYYMMDD format inetrnally and time as HHMMSS. But how it should be displayed is dependent on your user settings.

You can go to the transaction SU3 and take the defaults to see your settings. So the external display will be based on this setting.

So if ypu have to check the value in your coding, you have to check always with the internal format only.

If this answer helps you, pls reward with points.