on 02-14-2014 4:40 PM
Hi all,
Environment Variables are widely used in SAP Systems to partially configure an application server or components of it.
You may also be asked by a developer to set an environment variable to turn off/on functionality within a process in order to activate alternative code paths for error analysis.
In this context SAP Note 31559 has been revised and does cover now all available methods and scope description to set/change environment variables on a Windows box running an SAP application server.
kind regards
Peter
PS: feedback is highly appreciated (missing stuff, hard to understand sections...)
Hi,
Clicking on the link displays the message:
Translation is possibly not up-to-date Document is not released |
William
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Thank a lot for that question, it is great to be able to discuss the content of a note with its creator !
There is something that seems unclear to me either in the old and the new version (may be because English is not my native language)
SAP service is running under SAPService<SID> user I thought it should inherit from the environment of that user (but no SAP specific env. var are set for that user) but it is not the case.
Does the note means that when the SAP instance is started the variables defined under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\SAP\<sid>\Environment are append (or replace) the existing environment variables set from the ones defined for account <SID>adm ?
I've done some testing and it seems that only the env. variables defined for <SID>adm account are effective.
What is wrong with my test ?
Create an env var for sapserviceSID:
FOR /f %u in ('wmic useraccount where name^= ^'sapserviceSID^' get sid ^| find "S-"') do set USID=%u
Reg add "HKU\%USID%\Environment " /v TEST /t REG_SZ /d "SAP_SVC"/f
Stop/start services + SAP instance
Test with set command in prog RSBDCOS0 => var TEST is not set
Create an env var for SAP env. reg key:
Reg add "HKLM\SOFTWARE\SAP\SID\Environment" TEST /t REG_SZ /d "SAP_ENV" /f
Stop/Start services + SAP instance
Test with set command in prog RSBDCOS0 => var TEST is not set
Create an env var for <SID>adm
Reg add "HKU\Environment" TEST /t REG_SZ /d "USR_ENV" /f
Stop/Start service + SAP instance
Test with set command in prog RSBDCOS0 => var TEST is set to USR_ENV
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As described in the note SAP System specific environment variable are defined by reading HKEY_LOCAL_MACHINE\Software\SAP\<SID>\Environment. All (or most) environment variables defined in the windows user environment for the user running the service (default: SAPService<SID>) are overwritten.
The content of HKEY_LOCAL_MACHINE\Software\SAP\<SID>\Environment is overwritten by the environment variables defined for the user specified in HKEY_LOCAL_MACHINE\Software\SAP\<SID>\admUser everytime a SAP System is started.
regards
Peter
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.