Get System ID
Hi everyone,
THere is a webdynpro application which display some "sensitive data" , so in the test system, it should not display any kind of data, except some test users (stored in exception table)
To do this, I have some questions:
How can I determine, which system is currently used (How can I get the system ID in java webdynpro)?
What do you think? what is the best way to hide the sensitive data? My idea is to write some modification to the code where the program reads the data from the application, and if he system ID is the test system, then simply don't read anything from the database.
Thanks.
N.
Hi,
Even I had a similar requirement. I used System Id to distinguish the functionality.
Assuming System Id of Test system is PC and production is BC, then use the following code.
try{
File file = new File(".");
String filePath [] = file.getCanonicalPath().split("/");
if(filePath[3].equalsIgnoreCase("PC")){
//do Test system related functionality
else if(filePath[3].equalsIgnoreCase("BC")){
//do production system related functionlity
// Generic code follows
The fourth element in the above mentioned array(filePath[]) always contains the system Id.
Hope this will help you.
Regards,
Vishweshwara P.K.M
Similar Messages
-
How to get System time during report generation?
Hi,
I am developing a template in which I am required to show data of current year only. Is there any method by which I can get system time(from which I will extract year) ?Thanks,
I already have found it on page 260 of oracle bi publisher guide.
sysdate() <?xdofx:sysdate()?> SYSDATE returns the current date and time.
The datatype of the returned value is DATE.
The function requires no arguments. -
I'm trying to download iTunes on Windows Vista, get system adminstrator won't allow this kind of installation error. What should I do? It's 64-bit.
Try the following user tip:
"The administrator has set policies to prevent this installation" error messages when installing iTunes for Windows on Windows Vista and Windows 7 systems -
When downloading Itunes, keep getting system error, have had it on this computer before
when downloading Itunes, keep getting system error, have had it on this computer before
For general advice see Troubleshooting issues with iTunes for Windows updates.
The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
tt2 -
I Have a mid 2011 iMac with windows 8.1 on it and constantly get system thread exception not handled and kernel security check failur
I Have a mid 2011 iMac with windows 8.1 on it and constantly get system thread exception not handled and kernel security check failur
-
Get system connect information in WAD
Dear All,
I need using Javascript get system connect information in WAD,and using the connect information call RFC,How to do it?by myself
-
Could not get system landscape directory client - NWDS 7.31 SP 09
Hi Experts,
We are unable to import development configurations from NWDI 7.4 to NWDS 7.31 for one of the developer's id. Other developers are able to import the
configuration successfully in NWDS and are able to create projects without any issues. In fact, I am able to import the development configurations from his Id on my machine.
The error message that is appearing is as follows: Could not get system landscape directory client.
PFB the NWDS logs:
null
Error
Tue Jan 06 12:48:58 IST 2015
List Development Configurations failed [Error: com.sap.ide.dii05.ui.internal.sld.SldContext Thread[ModalContext,6,main]]
com.sap.lcr.api.cimclient.LcrException: com.sap.lcr.api.cimclient.CIMClientException: HTTP response code: 407 (Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ))
at com.sap.lcr.api.cimclient.HttpRequestSender.newClientException(HttpRequestSender.java:719)
at com.sap.lcr.api.cimclient.HttpRequestSender.processResponse(HttpRequestSender.java:608)
at com.sap.lcr.api.cimclient.HttpRequestSender.send(HttpRequestSender.java:352)
at com.sap.lcr.api.cimclient.CIMOMClient.sendImpl(CIMOMClient.java:205)
at com.sap.lcr.api.cimclient.CIMOMClient.send(CIMOMClient.java:153)
at com.sap.lcr.api.cimclient.CIMOMClient.enumerateInstancesImpl(CIMOMClient.java:450)
at com.sap.lcr.api.cimclient.CIMOMClient.enumerateInstances(CIMOMClient.java:754)
at com.sap.lcr.api.cimclient.CIMClient.enumerateInstances(CIMClient.java:989)
at com.sap.lcr.api.sapmodel.JavaCIMObjectAccessor.enumerateInstances(JavaCIMObjectAccessor.java:213)
at com.sap.lcr.api.sapmodel.SAP_DesignTimeConfigurationAccessor.enumerateInstances(SAP_DesignTimeConfigurationAccessor.java:164)
at com.sap.ide.dii05.lib.internal.sld.SldBasicContext.listRemoteDevConfNames(SldBasicContext.java:197)
at com.sap.ide.dii05.ui.internal.devconf.wizard.DevConfImportSldPage$6.run(DevConfImportSldPage.java:293)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
NWDS version: 7.31 SP 09
Error Screenshot -
Any pointers will be highly appreciated.
BR,
AnuragHi,
we had some issues recently with this, and the trace also mentions proxy issues. Could you please try direct connection in that preferences (in other words do not use proxy settings in NWDS) ?
Is it possible that there is some kind of web-filter application installed that is blocking the request?
I'd suggest to google for this error:
407 (Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ))
Perhaps the problem is not even sap related.
Is Microsoft Forefront TMG (Threat Management Gateway after some googleing) perhaps configured in the way that it is not allowing this request ? Perhaps the IT guys of your company could look into this.
Microsoft Forefront Threat Management Gateway - Wikipedia, the free encyclopedia
12209 Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.
Cheers,
Ervin -
Get system no from login details
Hi All,
Is there any way to get system no from the login details.
Thank you,
Gopi.SHi Suhas,
When you are configuring a server on your e.g. logon pad, you are asked for the server IP, system ID and system number which is the SAP Instance Number and I am supposring thats what Gopi is looking for.
The function returns that value.
Cheers,
Aditya -
Is there any BAPI's to get system information
HI All,
Is there any BAPI's to get system information like name which NWcomponent is installed, version, function modules which are implemented.
ITS VERY URGENT
ThanksHi,
bapi for getting the details of system inthe sense euipment i believe so try this bapi
BAPI_EQUI_GETDETAIL
BAPI_EQUI_GETLIST
Regards,
sana. -
Dear all,
I am using Labview 8.5.
I am trying to get system date.
I use Format Date/Time String tool in a "%Y%m%d" format.
The PROBLEM is the Format Date/Time String return 'YYYYMMDD' only.
Please see my attachment to see.
Please help me with this, every time I encounter this problem it force for to re-install the labview program.
Best Thanks!
Solved!
Go to Solution.
Attachments:
DateTime Error.JPG 7 KBtyk007 - It is sucessfully working with other computers but there are some computer having this problem.
altenbach - Please see attached file for actual VI. I assume that it will work on your pc.
After leaving Format unwired, the output is YYYY-MM-DD 00:00:00 PM.
How Labview connects with the local machine system date?
Attachments:
Format DateTime String.vi 6 KB -
DB table to get system status and text for PO.
Hi All,
I need the table to get system status for a production order and system status text .Please help.Hi Prem,
JEST table is for system status for a production order and TJ02T table is for system status text.
Try with these fields in the above tables.
u2022 OBJNR like JEST-OBJNR object number
u2022 STAT like JEST-STAT Object status
u2022 INACT like JEST-INACT indicator status inactive
u2022 TXT04 like TJ02T-TXT04 individual status of an object
u2022 TXT30 likeTJ02T-TXT30 object status.
Hope it helps you.
Regards,
Anusha V.
Edited by: Anusha on May 26, 2009 10:22 AM -
How to get System status Check Boxes into Query selection screen
Dear experts,
Pleas help in knowing how to get System status Check Boxes into quick view query (SQVI), selectionscreen.
Regards
Jogeswara Rao
Edited by: K Jogeswara Rao on Jul 6, 2010 7:26 PMProblem solved through other Forum
(Checkboxes not possible, some alternative solution to my requirement found) -
Hello Sir,
I am Udhaya. I don't know how to capture system idle time using java. Please any one help me how to get system idle time. Any class is available in java to get idle time?
Thank in advance
Udhayajwenting wrote:
DrLaszloJamf wrote:
jwenting wrote:
the moment you ask the system for its idle time that idle time becomes 0, so just returning a constant value of 0 would always yield the correct answer.But when you don't call this constant method the value it would return is wrong. This is the sort of thing that keeps me up at night.Except of course that when you don't call it it doesn't return it and therefore still behaves properly.
Or were you thinking of philosphical problems like "what does a method do when it's not called?"?Actually I was trying to see if I could get the OP to say boo to a goose. -
How to get system temp dir. path on the fly ,system may be XP or Linux ??
How to get system temp dir. path on the fly ,system may be XP or Linux ??
please suggest solutionThe default temporary-file directory can be retrieved
using:
System.getProperty("java.io.tmpdir")
Thanks a lot for u r reply this one works !!!! -
How to get system status and user status ?
how to get system status and user status for the given production order?
In which PP table we can
find these?
Thanks&Regards
SatishHi Ram,
Use the FM "STATUS_READ" to read both the system and user statuses for an Order.
Alternatively, the following tables store the user and system status info:
JSTO- Status object information
JEST- Individual Object Status
Hope this helps.
Let me know if u need further information.
Regards,
Sonal -
How to get system Environment variable?
How to get system Environment variable without using jni?
just like "JAVA_HOME" or "PATH"...
Any reply is help to me!! :-)Thx for your reply...
I get it!!!
Read environment variables from an application
Start the JVM with the "-D" switch to pass properties to the application and read them with the System.getProperty() method. SET myvar=Hello world
SET myothervar=nothing
java -Dmyvar="%myvar%" -Dmyothervar="%myothervar%" myClass
then in myClass String myvar = System.getProperty("myvar");
String myothervar = System.getProperty("myothervar");
This is useful when using a JAVA program as a CGI.
(DOS bat file acting as a CGI) java -DREQUEST_METHOD="%REQUEST_METHOD%"
-DQUERY_STRING="%QUERY_STRING%"
javaCGI
If you don't know in advance, the name of the variable to be passed to the JVM, then there is no 100% Java way to retrieve them.
NOTE: JDK1.5 provides a way to achieve this, see this HowTo.
One approach (not the easiest one), is to use a JNI call to fetch the variables, see this HowTo.
A more low-tech way, is to launch the appropriate call to the operating system and capture the output. The following snippet puts all environment variables in a Properties class and display the value the TEMP variable. import java.io.*;
import java.util.*;
public class ReadEnv {
public static Properties getEnvVars() throws Throwable {
Process p = null;
Properties envVars = new Properties();
Runtime r = Runtime.getRuntime();
String OS = System.getProperty("os.name").toLowerCase();
// System.out.println(OS);
if (OS.indexOf("windows 9") > -1) {
p = r.exec( "command.com /c set" );
else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 2000") > -1 )
|| (OS.indexOf("windows xp") > -1) ) {
// thanks to JuanFran for the xp fix!
p = r.exec( "cmd.exe /c set" );
else {
// our last hope, we assume Unix (thanks to H. Ware for the fix)
p = r.exec( "env" );
BufferedReader br = new BufferedReader
( new InputStreamReader( p.getInputStream() ) );
String line;
while( (line = br.readLine()) != null ) {
int idx = line.indexOf( '=' );
String key = line.substring( 0, idx );
String value = line.substring( idx+1 );
envVars.setProperty( key, value );
// System.out.println( key + " = " + value );
return envVars;
public static void main(String args[]) {
try {
Properties p = ReadEnv.getEnvVars();
System.out.println("the current value of TEMP is : " +
p.getProperty("TEMP"));
catch (Throwable e) {
e.printStackTrace();
Thanks to W.Rijnders for the W2K fix.
An update from Van Ly :
I found that, on Windows 2003 server, the property value for "os.name" is actually "windows 2003." So either that has to be added to the bunch of tests or just relax the comparison strings a bit: else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 2000") > -1 )
|| (OS.indexOf("windows 2003") > -1 ) // works but is quite specific to 2003
|| (OS.indexOf("windows xp") > -1) ) {
else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 20") > -1 ) // probably is better since no other OS would return "windows" anyway
|| (OS.indexOf("windows xp") > -1) ) {
I started with "windows 200" but thought "what the hell" and made it "windows 20" to lengthen its longivity. You could push it further and use "windows 2," I suppose. The only thing to watch out for is to not overlap with "windows 9."
On Windows, pre-JDK 1.2 JVM has trouble reading the Output stream directly from the SET command, it never returns. Here 2 ways to bypass this behaviour.
First, instead of calling directly the SET command, we use a BAT file, after the SET command we print a known string. Then, in Java, when we read this known string, we exit from loop. [env.bat]
@set
@echo **end
[java]
if (OS.indexOf("windows") > -1) {
p = r.exec( "env.bat" );
while( (line = br.readLine()) != null ) {
if (line.indexOf("**end")>-1) break;
int idx = line.indexOf( '=' );
String key = line.substring( 0, idx );
String value = line.substring( idx+1 );
hash.put( key, value );
System.out.println( key + " = " + value );
The other solution is to send the result of the SET command to file and then read the file from Java. ...
if (OS.indexOf("windows 9") > -1) {
p = r.exec( "command.com /c set > envvar.txt" );
else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 2000") > -1
|| (OS.indexOf("windows xp") > -1) ) {
// thanks to JuanFran for the xp fix!
p = r.exec( "cmd.exe /c set > envvar.txt" );
// then read back the file
Properties p = new Properties();
p.load(new FileInputStream("envvar.txt"));
Thanks to JP Daviau
// UNIX
public Properties getEnvironment() throws java.io.IOException {
Properties env = new Properties();
env.load(Runtime.getRuntime().exec("env").getInputStream());
return env;
Properties env = getEnvironment();
String myEnvVar = env.get("MYENV_VAR");
To read only one variable : // NT version , adaptation for other OS is left as an exercise...
Process p = Runtime.getRuntime().exec("cmd.exe /c echo %MYVAR%");
BufferedReader br = new BufferedReader
( new InputStreamReader( p.getInputStream() ) );
String myvar = br.readLine();
System.out.println(myvar);
Java's System properties contains some useful informations about the environment, for example, the TEMP and PATH environment variables (on Windows). public class ShowSome {
public static void main(String args[]){
System.out.println("TEMP : " + System.getProperty("java.io.tmpdir"));
System.out.println("PATH : " + System.getProperty("java.library.path"));
System.out.println("CLASSPATH : " + System.getProperty("java.class.path"));
System.out.println("SYSTEM DIR : " +
System.getProperty("user.home")); // ex. c:\windows on Win9x system
System.out.println("CURRENT DIR: " + System.getProperty("user.dir"));
Here some tips from H. Ware about the PATH on different OS.
PATH is not quite the same as library path. In unixes, they are completely different---the libraries typically have their own directories. System.out.println("the current value of PATH is: {" +
p.getProperty("PATH")+"}");
System.out.println("LIBPATH: {" +
System.getProperty("java.library.path")+"}");
gives the current value of PATH is:
{/home/hware/bin:/usr/local/bin:/usr/xpg4/bin:/opt/SUNWspro/bin:/usr/ccs/bin:
/usr/ucb:/bin:/usr/bin:/home/hware/linux-bin:/usr/openwin/bin/:/usr/games/:
/usr/local/games:/usr/ccs/lib/:/usr/new:/usr/sbin/:/sbin/:/usr/hosts/:
/usr/openwin/lib:/usr/X11/bin:/usr/bin/X11/:/usr/local/bin/X11:
/usr/bin/pbmplus:/usr/etc/:/usr/dt/bin/:/usr/lib:/usr/lib/lp/postscript:
/usr/lib/nis:/usr/share/bin:/usr/share/bin/X11:
/home/hware/work/cdk/main/cdk/../bin:/home/hware/work/cdk/main/cdk/bin:.}
LIBPATH:
{/usr/lib/j2re1.3/lib/i386:/usr/lib/j2re1.3/lib/i386/native_threads:
/usr/lib/j2re1.3/lib/i386/client:/usr/lib/j2sdk1.3/lib/i386:/usr/lib:/lib}
on my linux workstation. (java added all those execpt /lib and /usr/lib). But these two lines aren't the same on window either:
This system is windows nt the current value of PATH is:
{d:\OrbixWeb3.2\bin;D:\jdk1.3\bin;c:\depot\cdk\main\cdk\bin;c:\depot\
cdk\main\cdk\..\bin;d:\OrbixWeb3.2\bin;D:\Program
Files\IBM\GSK\lib;H:\pvcs65\VM\win32\bin;c:\cygnus
\cygwin-b20\H-i586-cygwin32\bin;d:\cfn\bin;D:\orant\bin;C:\WINNT\system32;C:\WINNT;
C:\Program Files\Dell\OpenManage\Resolution Assistant\Common\bin;
d:\Program Files\Symantec\pcAnywhere;
C:\Program Files\Executive Software\DiskeeperServer\;C:\Program Files\Perforce}
LIBPATH:
{D:\jdk1.3\bin;.;C:\WINNT\System32;C:\WINNT;d:\OrbixWeb3.2\bin;D:\jdk1.3\bin;
c:\depot\cdk\main\cdk\bin;c:\depot\cdk\main\cdk\..\bin;
d:\OrbixWeb3.2\bin;D:\Program Files\IBM\GSK\lib;
H:\pvcs65\VM\win32\bin;c:\cygnus\cygwin-b20\H-i586-cygwin32\bin;d:\cfn\bin;
D:\orant\bin;C:\WINNT\system32;
C:\WINNT;C:\Program Files\Dell\OpenManage\ResolutionAssistant\Common\bin;
d:\Program Files\Symantec\pcAnywhere;
C:\Program Files\Executive Software\DiskeeperServer\;C:\Program Files\Perforce}
Maybe you are looking for
-
Dell Venue 8 Pro - won't charge (again)
Has anybody had any luck with Dell actually fixing their Venue 8 Pro tablets? We got 2 tablets for our kids at Xmas 2013. In August of '14, I had to send one in for repair because it would no longer charge. It is now, again, not working, and the s
-
How do I change the background color of a row in a table indicator?
Hello, How do I change the background color of a row in a table indicator? I know how to change the background color in a active cell, but that is not what I want. My first intent is to make the background color of the first row a unique color, suc
-
ODI Knowledge Module for UNION - UNION ALL - INTERSECT Case Study
All about BI & Data Integration: ODI Knowledge Module for UNION , UNION_ALL, INTERSECT
-
Problem during updating through x terminal
when i starts "apt-get update" in x terminal... it show GPG error...the following signature's could't be verified because no public key 4438160A655EF avilable..what should i do?... keyserver .commands also failed..it shows no key in server..and also
-
HT201303 forget my security question answers? how to retrieve that?
forgot my security question answers? how to retrieve that? Is there any chance to reset security questions?