on 11-10-2011 12:03 PM
Hi all,
Is there a way to execute an already existing query using java sdk?
example:
Query Name: ZCO_M11/ZCOPA_M11_Q024
i can get the connection and connect to SAP. I can also execute an MDX query.
But i'm getting alot of trouble to know/get the existing query. :S
i will try to explain a litlle better
im using SAP xmla olap to connect to SAP.
this is an example of getting data from an MDX query that i use:
public void runQuery() {
String userString = "SAPSUPPORT";
String passString = "experts";
String languageString = "EN";
String clientString = "210";
String urlString = "http://10.60.12.3:8000/sap/bw/xml/soap/xmla";
ManagedConnectionFactory mcf;
IConnectionFactory cf;
IConnectionSpec cs;
mcf = new XmlaManagedConnectionFactory();
try {
cf = (IConnectionFactory) mcf.createConnectionFactory();
cs = cf.getConnectionSpec();
cs.setPropertyValue(BIConnectionConstants.USERNAME.toString(), userString);
cs.setPropertyValue(BIConnectionConstants.PASSWORD.toString(), passString);
cs.setPropertyValue(BIConnectionConstants.LANGUAGE.toString(), languageString);
cs.setPropertyValue(XmlaConnectionConstants.LOGONMETHOD.toString(), XmlaConnectionConstants.LOGONMETHOD_UID);
cs.setPropertyValue(XmlaConnectionConstants.URL.toString(), urlString + "?sap-client=" + clientString + "&sap-user=" + userString + "&sap-password=" + passString);
IBIConnection conn = (IBIConnection) cf.getConnectionEx(cs);
//
IBIOlap olap = conn.getOlap();
// Executing query
String query = "SELECT [0CUSTOMER__0COUNTRY].MEMBERS ON ROWS, {[Measures].[1C0ARHWN265RP6598KU87O625],[Measures].[17RCFU9V0PODT3FTXPO2JG9U6],[Measures].[326VOTH4LLLQ867KTGTZCA4Y1]} ON COLUMNS FROM ZCO_M11/ZCOPA_M11_Q005 SAP VARIABLES [0P_FYEAR] INCLUDING '2010'";
IBIDataSet ds = olap.execute(query);
// Using examples method
PrintWriter out = new PrintWriter(new File("example2.html"));
out.println(Helpers.getDocTypeDefinition());
out.println("<html>");
out.println("<head><title>DEMO2</title>");
out.println(Helpers.getStyleSheetDefinition());
out.println("</head><body>");
Helpers.renderDataset(out, ds, false);
out.flush();
out.close();
//
} catch (Exception e) {
System.out.println("ERROR: " + e.getMessage());
e.printStackTrace();
}
}
What i need to execute is someting like that, but instead executing the MDX query, i only have the query name ( ZCO_M11/ZCOPA_M11_Q024).
is there a way to do something like:
SELECT Measures.MEMBERS ON COLUMNS, NON EMPTY Measures.MEMBERS ON ROWS FROM ZCO_M11/ZCOPA_M11_Q024
or using ObjectFinder:
objectFinder = olap.getObjectFinder();
Cube cube = objectFinder.findCubeFirst((String) null, "ZCO_M11/ZCOPA_M11_Q024");
to access the query data?
thanks
ping!
no one has any lights about this question/problem? :S
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.