on 09-24-2014 9:00 AM
Hi Experts,
How to access the Std portal databse tables like WCR_USERSTAT table using webdynpro java, PortalComponent application.
I have come across the SAP Code gallery for the same:
http://wiki.scn.sap.com/wiki/display/Snippets/Direct+Access+Databse+Tables
But in the code need to lookup portal DataSource by alias name and here given Std alias name is not working.....
Like to know any other option to access the Std. SAP Portal databse tables.
Regards,
Hanif
Hi,
Check this link may be help for you.
Creating Custom Activity Report on Netweaver Portal 7.30 or Higher - Portal - SCN Wiki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Durga,
Thanks for the reply.
But as mentioned, I am using the Example-Activity Report for finding out an user's last logon time on the portal
from the link you shred and here the code does not execute the query and shows blank.
Need to know what could the jdbc DataSource object alias name and from where to ensure the same, as then only system will have active connection object subsequently query will get execute.
Let me know whether above helped to execute the query...?
Regards,
Hanif
Hi,
Check this code once may help for you.
sqlStatement = "select TIMESTAMPHOUR,LOGONID from WCR_USERSTAT ORDER BY TIMESTAMPHOUR DESC ";
InitialContext initialContext = new InitialContext();
dataSource = (DataSource) initialContext.lookup("jdbc/SAP/BC_UME");
// Default Datasource created at installation time
BR,
Durga.
Hi Durga,
I have used the code in web-dynpro java program to access the WCR_USRSTAT table, but no data is getting accessed.
Whereas by using the same code in portal application component, the data is acessible.
Like to know what is limiting the webdynpro to pull the data from WCR tables.
Regards,
hanif
Hi,
Sorry for the long silence.In this WDJ code may be help for you.
String loginsRecord = "select logonid,timestamphour from WCR_USERSTAT where timestamphour between "+<FROMDATE>+" and "+<TODATE>+" " +
"and (logonid <> 'Administrator' and logonid <> 'Guest' and logonid <> 'admin') and USERTYPE <> 'a' order by timestamphour desc";
pstm = con.prepareStatement(loginsRecord);
ResultSet rs = pstm.executeQuery();
Here you will get the table of data in ResultSet rs.You can set the table node and display.
BR,
Durga Rao.
Hi hanif,
The above code is working for me.Check this link
http://help.sap.de/saphelp_nw74/helpdata/en/47/87329cc84a199ce10000000a42189d/content.htm
Direct Access to Database Tables - Portal - SAP Library
Otherwise try this may be help for you.
BR,
Durga
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.