cancel
Showing results for 
Search instead for 
Did you mean: 

Query DB using SAP interface...

former_member199632
Participant
0 Kudos

Hello,

Is it possible to query (SELECT query) DB tables using a SAP interface.?

From se16 we can see the table data.

But here i want to , write a SELECT query and get the data

like;

SELECT field1,field7 from TABLE x WHERE id > 2 AND pnum <8;

Is there any place to ; write this type of a statement and query information

regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hehe, absolutely, no need to write anything. SE16 is fully capable of that, you can choose the selection fields and the listed fields. Check the settings in the menu.

Cheers Michael

former_member199632
Participant
0 Kudos

yh thts possible.

But i jst want to know is it possible to write some query.

(like join...referring 2 tables)

lbreddemann
Active Contributor
0 Kudos

Sure it is.

Write an ABAP report.

Use SAP Query.

Take any of the tools provided by the system.

But, please, don't go and try to use your SQL knowledge to handle business data "in an easier way".

Once you get there, you're in a terrible place.

You must know all the details of the application logic to make the correct meaning from your SQL result.

You must take care of data access restrictions yourself.

You will violate IT security regulations (SOX/BASEL).

Finally and very lkely this approach will fail.

Therefore: don't go for this and use the provided tools instead.

Just a well-meant hint...

Lars

KayKa
Active Participant
0 Kudos

Hi,

goto the transaction dba_cockpit or st04.

Under Performance / Additional Functions you find the SQL Command Editor. And here you can do things like this:


select trunc(last_analyzed) statsdate, count(*) anzahl
  from all_tables
 group by trunc(last_analyzed)
 order by 1;

You can't do inserts, deletes, updates. But you don't really want to do these things here

best regards

Kay

lbreddemann
Active Contributor
0 Kudos

ahem.. you are aware that the SQL editor in DBACockpit/ST04 is limited to the Oracle Dictionary tables?

It cannot be used to query data from application tables.

cheers,

Lars

KayKa
Active Participant
0 Kudos

Hallo Lars,

it only seems to be for the dictionary ...

Try this


select waers, count(*) as saetze from t001 group by waers order by 2 desc

and you get this


29.04.2011                   Dynamische Listenausgabe                          1
--------------------------------------------------------------------------------
Result of the SELECT statement
-------------
|WAERS|SAETZE|
-------------
|EUR  |47    |
|ARS  |4     |
|MXN  |4     |

On DB2 z/OS you get an error if you try this in transaction db2c, but with a little trick it will work also...

For me it's the quickest way to reproduce statements from the Cursor Cache / Statement Cache and analyze them.

Gruß aus Bonn

Kay

lbreddemann
Active Contributor
0 Kudos

Hmm... this is rather a bug than a feature.

The documentation is pretty clear about this and there had been quite some efforts to prevent non Oracle-Dict-Access.

I'll check on this and hopefully this get's corrected.

Thanks for pointing out!

regards, Lars

KayKa
Active Participant
0 Kudos

no please , no correction ;-(

fidel_vales
Employee
Employee
0 Kudos

May be related to this:

Note 1499051 - DBACockpit: Weak authorization checks in SQL Command Editor

Answers (0)