Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Better way to query multiple tables of SAP

former_member213644
Participant
0 Kudos

Hi Experts,

I am using BAPI RFC_READ_TABLE for querying tables of SAP in my application written in java.

But the limitation of the BAPI is that I can only access and apply filters to one table.

In my case , I want to access multiple tables and join the tables based on a common column in each table. Then I want to filter the result out.

What is the most efficient way to do this. I can not write BAPI because it undergoes a certification process from SAP. Which will consume a lot of time.

Is there any out of box BAPI exposed which can query multiple tables of SAP? If not, what is the other efficient way to achieve it?

4 REPLIES 4

Former Member
0 Kudos

RFC_READ_TABLE is a pest and should not be used. Particularly if you hand it out to end users for locally implemented PC tools then you will regret it very fast - both because of it's limitations, forcing you to grant basis authorizations and performance degradation of the system.

Is there no business BAPI which already exists for the tables you want to select from? One which makes proper application checks...

If it is customer tables, you must obviously create your own custom API and logic for it to call from external clients and do not need any SAP BAPI or release certification for that.

There is no certifiable interface for remotely generating a query code, inserting it into a target system via RFC, submitting the query and returning the results. Those who try typically get flamed here... 🙂

Cheers,

Julius

mvoros
Active Contributor
0 Kudos

Hi,

if you find a solution to your problem please report it to SAP as a security bug ;-). I am not sure what you are trying to do but having a generic access to any table in the system sounds like a really bad idea. You should go via proper development and develop interfaces that you need and then certify it.

Cheers

Former Member
0 Kudos

Hi Vikas,

One way of joining the tables in SAP is using SQVI. You can join multiple tables and filter which particular fields you want to extract from these tables. Once you create a view in SQVI, you can just execute this and get the required data. Also, when you create a SQVI view, a program is created which can be looked up in SE38.

Not sure if this solves the problem, but it is a huge help when we have to query data from multiple tables.


Arpit

0 Kudos

Even if you don't use the "install and run" approach to adhoc query ABAP generation via RFC, a fixed program with a name would still need a remote submit which either exposes the report name to be submitted as an import paramter of the table names and join part of the code to the generation template.

The chances of that being misused are fairly good bad.

Rather use business APIs or create your own RFCs for dedicated reporting on your own tables as already mentioned by Martin. Much safer!

Cheers,

Julius