cancel
Showing results for 
Search instead for 
Did you mean: 

Getting system date format in a variable

shalinee_gupta
Associate
Associate
0 Kudos
1,961

I want to get the date format of logged in system in a variable like if the date format of system is 'dd.mm.yyyy' then the same string i want as output. I want to have the value in a variable which i am using while writing function module.

Accepted Solutions (0)

Answers (4)

Answers (4)

raymond_giuseppi
Active Contributor
0 Kudos

Could you reformulate 'the date format of logged in system' ?

You can get

  • the logon language with cl_abap_syst=>get_logon_language( ) .
  • the date format from user master data (USR01-DATFM)
  • the date format from country customizing (T005X-DATFM)
ArthurParisius
Contributor
0 Kudos

As the others have stated the internal date format is YYYYMMDD.

If you want the date format settings for a specific user try using Function module SUSR_GET_USER_DEFAULTS.

former_member182550
Active Contributor
0 Kudos

Hi,

Check the conversion exits, or write the date variable to a character variable. That will give you the date in user format, as Loyd says, the internal date format is YYYYMMDD.

Rich

loyd_enochs3
Participant
0 Kudos

Shalinee,

You are starting from an incorrect premise. The date format of any SAP system is ALWAYS in the format YYYYMMDD and is based on the SAP data type of DATS.

The display format is based on the user parameter unless overridden. This is clearly documented within any SAP system, and is required reading.