Skip to Content

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

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 😊..

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jun 18, 2013 at 08:18 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 19, 2013 at 02:47 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 18, 2013 at 08:18 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 19, 2013 at 12:25 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 19, 2013 at 01:52 AM

    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. 

    Add comment
    10|10000 characters needed characters exceeded