cancel
Showing results for 
Search instead for 
Did you mean: 

JAVA JCo Query

Former Member
0 Kudos

Hi,

is there a way to execute queries from a java application and import the results? with sap-jco? sample?

thx a lot

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

What do u mean by java appliction? A java application theretically can execute any query.

If u are thinking of writing a UDF in message mapping, then it would be better to use JDBC lookup

Regards,

Prateek

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

thx a lot, for all answers!!!

I examined all your advices with following result:

to: Swarup Sawant lower answer

That´s what i have done till now. But I haven't found a way to directly execute a query with JCO.

I could connect to our SAP Server an get System Information and read the flightbook example, but

not found a way to connect to a query, until now...

to: Prateek Raj Sri...

I want to develope a standalone Java Client, which can only execute a predefined set of queries. I know there are

multiple ways to do that, but I want to develope a application by myself

to: Swarup Sawant upper answer

Thanks, thats the right way, i think... Now I have downloaded JDO from apache.org and imported it in my

Projekt. I hadn´t read everything from your links until now, that will need some more time.

Have you got a complete sample source, where you use the

import com.sap.mw.jco.*;

import javax.jdo.*;

to perform a connection, execute a query and read the results?

Former Member
0 Kudos

Hi,

Probably the sample source code available on Page 9 in below link will help you

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a83ec690-0201-0010-14ac-bd1d75e2...

Here the below import libraries had used

import com.sap.mw.jco.IFunctionTemplate;

import com.sap.mw.jco.IMetaData;

import com.sap.mw.jco.IRepository;

import com.sap.mw.jco.JCO;

Thanks

Swarup

Former Member
0 Kudos

Thanks,

there is a very very good explanation of the jco *****.

But thats not what i need. I don't want to create queries within my application, i just want to

execute a query that is already designed (eg. with Query Designer in BEx Analyser) and

print out the results.

Sample:

1. In Query Designer i create a Query to a Cube XY with the name "Testquery"

2. Save and try the query

then in my standalone application:

3. Start a connection to SAP (already work)

4. Execute the Query

5. Display the result in a table

thats it.

In the sample i found only possiblities to directly manipulate/read the tables. Thats to much,

because we have so much Query already designed...

Hope you could help me... Thanks!!!

Former Member
0 Kudos

Hi,

Couple of months back...my teammates had tried the similar kind of implication of the desiged queries.

I don't have indepth idea..but I will talk with my teammates about it.

Meanwhile I would suggest you to wait till XI experties will add the various suggestions for this problem

Thanks

Swarup

Former Member
0 Kudos

>

> Hi,

> Couple of months back...my teammates had tried the similar kind of implication of the desiged queries.

> I don't have indepth idea..but I will talk with my teammates about it.

>

> Meanwhile I would suggest you to wait till XI experties will add the various suggestions for this problem

>

> Thanks

> Swarup

thanks

Former Member
0 Kudos