How to Set & Check Environment Variables for SAP System

This article is based on SAP note 1827566 – How to set environment variables for SAP system.

Setting the Environment Variables

On Windows environment

Note: Use WIN + R (to open the Run dialog) and paste rundll32.exe sysdm.cpl,EditEnvironmentVariables. This shortcut will open the environment variable directly.

Right click on My Computer / This PC and select Properties.

Click on Advanced system settings.

Click on Environment Variables.

You can click one the following options, for either a user or a system variable:

  • Click New to add a new variable name and value.
  • Click an existing variable, and then click Edit to change its name or value.
  • Click an existing variable, and then click Delete to remove it.

On Linux environment

Environment variables are set by login scripts. These are .cshrc, .profile, .login, depending on the login shell (csh, ksh, sh, etc.) of [sid]adm user. You don’t need to put anything there.

For SAP systems and its database environment variables are inserted in $HOME/.sapenv_[hostname].(c)sh and $HOME/.dbenv_[hostname].(c)sh scripts of [sid]adm user (e.g. /home/bcsadm/.sapenv_probud2.csh).

When variables are changed / deleted / added this way both SAP and (to be on the safe side) the SAP Start service (sapstartsrv) needs to be restarted.

Checking the Environment Variables

From SAPMMC,

Right click on the server instance, select All Tasks and View Environment.

From transaction code SM51,

From the top menu, select Goto, Information and Environment.

You May Also Like

Leave a Reply?