06-29-2007 7:00 AM
hai.........
How are the date and time field values stored in SAP?
Thanks
06-29-2007 7:47 AM
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
06-29-2007 7:04 AM
06-29-2007 7:22 AM
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
06-29-2007 7:29 AM
hai ravi...
this is my mail id kpavan07@rediffmail.com
can u send me asap.....
thanks and regards
pavan
06-29-2007 9:00 AM
hai ravi...
can u send me the material to my mail is...
kpavan07@rediffmail.com asap.....
06-29-2007 7:40 AM
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.
06-29-2007 7:47 AM
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
06-29-2007 7:58 AM
Hi,
just try this code you will get system date and time.
write sy-datum.
write / SY-UZEIT.
IF USEFULL REWARD POINTS
06-29-2007 11:13 AM
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
06-29-2007 11:30 AM
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.