2022 Aug 14 11:42 AM
Hi
The format of Sy-datum is YYYYMMDD right...
1 - when you display sy-datum it print it the following format DD.MM.YYY
2 - when you assign sy-datum to a variable and you display it we get : DDMMYY
3 - If i want to extract only the MM, i need to use pos and number, knowing the format is YYYYMMDD
so
v_month = sy-datum+4(2)
capture-decran-2022-08-14-113623.png
my question is that's mean the sy-datum is automatically convert the format of the date when it is displaying ?
but there french and britain format that are same and us format, so i ll use the format of base where the server is ?
Thanks
2022 Aug 14 1:23 PM
The country specified date is stored in Table T005X.
You can use for example the command
SET COUNTRY 'EN"
or use string templates like:
|{ sy-datlo COUNTRY = 'US ' }|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abendate_formats.htm
2022 Aug 14 1:23 PM
The country specified date is stored in Table T005X.
You can use for example the command
SET COUNTRY 'EN"
or use string templates like:
|{ sy-datlo COUNTRY = 'US ' }|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abendate_formats.htm
2022 Aug 15 11:49 AM
Thanks, must use more ABAP Keyword Documentation before coming asking questioNs, thanks you....
2022 Aug 15 12:31 PM
Or use
data(date_as_text) = |{ sy-datum date = user }|.
for the output in the users language.
2022 Aug 14 3:38 PM
In ABAP, there are elementary types: C, D, N, etc.
Type D is for dates, which are 8 characters and internal format is YYYYMMDD (which itself is Gregorian calendar = today is year 2022, versus islamic calendar which could be year 1443 or 1444).
SY-DATUM is a variable of type D.
1 - depends on language environment
2 - depends on statement used and on language environment
3 - correct.
European format of dates is usually day followed by month, while US format is month followed by day.
For more information, see ABAP documentation: