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: 

SQL Script in ABAP

Former Member
0 Kudos

Hi Everyone,

I have sql script which gives certain output from the data base files, is it possible to execute this script in ABAP, I want to embed this sql script in ABAP and get the output into an internal table how is it possible.

Can anyone suggest me on this, it will be of great use to me.

Thanks,

Prashant.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

SAP uses Open SQL for accessing data from any of the databases.

Incase you want to find more details. Also look for Open SQL or Use Native SQL language in ABAP to accomplish the job.

<b> Open SQL

http://help.sap.com/saphelp_46c/helpdata/en/c9/5472f9787f11d194c90000e8353423/frameset.htm

Native SQL

http://help.sap.com/saphelp_46c/helpdata/en/c9/5472f9787f11d194c90000e8353423/frameset.htm</b>;

Hope this will help.

Please reward suitable points.

Regards

- Atul

6 REPLIES 6

Former Member
0 Kudos

Hi

SAP uses Open SQL for accessing data from any of the databases.

Incase you want to find more details. Also look for Open SQL or Use Native SQL language in ABAP to accomplish the job.

<b> Open SQL

http://help.sap.com/saphelp_46c/helpdata/en/c9/5472f9787f11d194c90000e8353423/frameset.htm

Native SQL

http://help.sap.com/saphelp_46c/helpdata/en/c9/5472f9787f11d194c90000e8353423/frameset.htm</b>;

Hope this will help.

Please reward suitable points.

Regards

- Atul

0 Kudos

Hi Atul,

Thanks for the links, but my sql script reads the data from the data dictionary views and tables. All the information which is related to database size, like the tablespace size from database segments, extent size etc.

Thanks,

Prashant.

0 Kudos

Hi

I guess without any changes it will work.

Try writing the queries as it is in SAP ABAP Editor.

Incase, there are any issue, then use Native SQL.

Hope this will help.

Please reward suitable points.

Regards

- Atul

0 Kudos

Hi,

My main intention in that script is to get the overall database size and tablespace size, how do I achieve this in ABAP.

The flow is in my selection screen program I have checkbox for database size, if the user checks this box, it has to display the entire database size in MB of KB.

I know that we can get this information through DB02, but my task is to get this information in a program and display it as a list.

Please suggest me with some ideas.

Thanks,

Prashant.

Former Member
0 Kudos

Hi

Look at the below thread, this may help you ..

reward the points if it helpful

Regards

Sudheer

Former Member
0 Kudos

Hi,

To check the table space we have a program .....

RSORAT01 - Check Table Space

RSORATC5 - Check Table Extent

http://www.saptechies.com/sap-table-space-daily-check-list/

same like you will find the Program name for entire database also.. i do not know about the program, but Basis people will definetly helpyou out in this one

Regards

Sudheer