on 01-15-2007 10:01 AM
Hi All
Can anyone tell me how to get the List of USERS persented in SAP SERVER using Java code.
If so plz provide me some sample code.
Its Very Urgent.
Hi
the list of users is maintained @ USR02 table. so, you can use the following SQL query to retrive the info..
...
java.sql.Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("<query>");
while (rs.next()) {
// retrieve and print the values for the current row
String s = rs.getString("<value>");
System.out.println("ROW = " + i + " " + s + " " + f);
}
replace the above query with this.. .
select BNAME from USR02 where MANDT=<client number>;
;;;
use the above query..in the JAVA code and display the list.
hope this info helps!
with BR,
Rajesh.
<i>award suitable points</i>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
// Now attempt to create a database connection
Connection db_connection =
DriverManager.getConnection (url, "dba", "sql");
// Create a statement to send SQL
Statement db_statement = db_connection.createStatement();
// Execute query
ResultSet result = db_statement.executeQuery
("select * from employee");
// While more rows exist, print them
while (result.next() )
{
// Use the getInt method to obtain emp. id
System.out.println ("ID : " + result.getInt("ID"));
// Use the getString method to obtain emp. name
System.out.println ("Name : " + result.getString("Name"));
System.out.println ();
}
please go thru this link..
http://java.sun.com/docs/books/tutorial/jdbc/overview/index.html
or
http://www.javacoffeebreak.com/articles/jdbc/
or
http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html
with regards,
Rajesh.
<i>
award suitable points</i>
Hi Raj,
please go thru this url..
http://help.sap.com/saphelp_erp2005vp/helpdata/en/50/e48de299e7e94cb3caa9f7db1bc10b/frameset.htm
hope this info helps you!
with Regds,
Rajesh.
<i>pls, award points</i>
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.