Application Development and Automation 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: 
Read only

SELECT Statement in Native SQL and Open Sql ( ABAP Select)

former_member9607
Active Participant
0 Likes
2,319

Can anybody please tell the differences between the Select Statement in ABAP and In Native SQL ?

I have worked with SQL Server for more than 3 years. Sometimes i get confused about the behavior of SELECT statement in ABAP. I try to compare the SELECT in SQL SERVER and SELECT in ABAP.. and result is confusion in many scenarios ..

So anybody who can explain them better please reply to this post and share your knowledge ..

5 REPLIES 5
Read only

Former Member
0 Likes
1,223

If you have specific Open SQL statements you'd like to evaluate you could try using transaction ST05 to trace the SQL. In there you can see the native SQL and explain plan.

Read only

former_member219762
Contributor
0 Likes
1,223

Hi Krishnakanth,

                        There is one layer between application server and data base server called data base interface in sap.Data base interface convert abap open sql statement into corresponding data base select statement so that program is data base independent.So there is minor difference between

  abap and sql server select statement. In sap also we can write data base dependent select query called as native sql. For more details http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm

In sap we can see converted sql statement by interface in tool called sql trace.

Regards,

Sreenivas.

Read only

ronaldo_aparecido
Contributor
0 Likes
1,223

HI

If the database is ORACLE you can do a EXEC SQL to execute a select native Oracle, whereas Oracle has a special clause for this type of select, but I've tried to compare the ABAP open SQL and Oracle Native nor is such difference or the performance gain is so high that it is worth the loss in time to maintain.

And few people know what complicates maintenance.

Read only

former_member186413
Participant
0 Likes
1,223

Hi,

If you want to compare these two, I definistly recommand you to use Open SQL anywhere in your ABAP program, because it will improve your performance of your program by using system cash of SAP system, which Native SQL can not achive.  Fetch array is very comman in Oper SQL which used for Extract Data from database such as SELECT * FROM MARA INTO TABLE itab, for update and modify data to database such as MODIFY dbtab FROM TABLE itab. 

If native sql  process rows of data, it will process one by one,  its network is very costly to compare with Open SQL. 

Read only

Former Member
0 Likes
1,223

Hi Krishnakant,

See here - http://scn.sap.com/people/tuncay.karaca/blog/2006/06/26/open-sql-vs-native-sql

& http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb3b8b358411d1829f0000e829fbfe/content.htm (already above).

Open SQL makes the SAP ECC independent of the underlying database i.e. it can be Oracle, DB2, etc. Whatever statements we write in ABAP Programs are generally in Open SQL which are converted to Native SQL depending on the native DB connected. This offers a layer of abstraction.

BR.