Use of Native SQL

Can i use all sql statementsa which are used in oracle ? Basically I am more interested in oracle data conversion functions like to_date(),To_Char() with appropriate formats.
I know that to use oracle's native commands i have to use Native SQL and for that i have to write my query between EXEC SQL and ENDEXEC.  But i am not able to use query that uses date conversion fuctions like to_date() and to_char().
Also i want to know the list of SQL statements which can be used with Native SQL in Oracle.

HI.
please refer this one.
To avoid the standard F4 help to be show, insert the event PROCESS ON-VALUE-REQUEST request in the program and add a field statement for the field that should trigger the F4 help. In the module called from PROCESS ON-VALUE-REQUEST request, call function module F4IF_FIELD_VALUE_REQUEST.
Example Code :
process before output.
process after input.
PROCESS ON VALUE-REQUEST.
FIELD sflight-carrid MODULE f4_help_for_carrid.
MODULE f4_help_for_carrid INPUT.
NOTE:
Tabname/fieldname is the name of the table and field
for which F4 should be shown.
Dynprog/Dynpnr/Dynprofield are the names of the Progran/Dynpro/Field
in which the f4 value should be returned.
Value: The value of the Dynpro field when calling the F4 help.
You can limit the values shown, by inseting a value in this parameter
e.g 'A*' to show only values beginning with A
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'SFLIGHT'
fieldname = 'CARRID'
SEARCHHELP = ' '
SHLPPARAM = ' '
dynpprog = 'ZDANY_F4_OWN_CALL'
dynpnr = '0100'
dynprofield = 'SFLIGHT-CARRID'
STEPL = 0
value = 'A*'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
SUPPRESS_RECORDLIST = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
RETURN_TAB =
EXCEPTIONS
FIELD_NOT_FOUND = 1
NO_HELP_FOR_FIELD = 2
INCONSISTENT_HELP = 3
NO_VALUES_FOUND = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " F4_help_for_carrid
To control F4 help in a selection screen use the AT SELECTION-SCREEN ON VALUE-REQUEST FOR event.Note that for ranges both the low and high value of the field must have there own ON VALUE-REQUEST
Example:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-low.
PERFORM f4_help_carrid.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-high.
PERFORM f4_help_carrid
Rewards all helpfull answers.
Regards.
Jay

Similar Messages

  • Use of native SQL-select statment

    hi,
    in my z-abap i use a native sql, saying the following:
    EXEC SQL.
      select agzdau into :gf_agzdau from APZD08/AG
                    where AGMAID = '77732' and
                          AGJAHR = 2008 and
                          AGMON  = 09 and
                          AGSPAL = 'ZASALD'
                          %_HINTS AS400 'HARD_CLOSE'
    ENDEXEC.
    before that i make a connection to the server where the table is stored.
    APZD08 is the library and AG is the filename (on a AS/400-machine)
    BUT: the file is not always in APZD08-lib, it depends on the employee.
    how can i make the lib-name and file flexible:
    i have tried it with
    select...............from :gf_file
    and i have put a value for gf_file before.
    but with that i got an SQL-error -104 when executing.
    i can't use a hostvariable there it seems.
    any ideas ?
    reg, Martin

    Hi.
    I would use ADBC instead of EXEC SQL. Then you can concatenate the SQL statement in the way you want it. But in that case you should use host variables in the where condition to get better performance.
    So something like the following (untested, no syntax check yet, pseudo code...):
    DATA: p_con_name   TYPE dbcon-con_name,
          p_con_ref    TYPE REF TO cl_sql_connection,
          p_stmnt      TYPE REF TO cl_sql_statement,
          p_result_set TYPE REF TO cl_sql_result_set,
          query        TYPE string.
    p_con_ref = cl_sql_connection=>get_connection( 'YOURCON' ).
    LOOP AT it_employees
    * CASE your logic
    CONCATENATE 'select agzdau from '  table_name
                'where  AGMAID = ? and AGJAHR = ?'
           INTO statement SEPARATED BY SPACE.
    * ENDCASE
    TRY.
      p_stmnt = p_con_ref->create_statement( ).
      GET REFERENCE OF p_agamaid INTO p_paramref.
      p_stmnt->set_param( p_paramref ).
      GET REFERENCE OF p_agjahr INTO p_paramref.
      p_stmnt->set_param( p_paramref ).
      p_result_set = p_stmnt->execute_query( query ).
      GET REFERENCE OF gf_agzdau INTO p_resultref.
      p_result_set->set_param( p_resultref ).
      p_result_set->next( ).
      CATCH CX_SQL_EXCEPTION.
    * error handling needed!
      ENDTRY.
    ENDLOOP.
    p_con_ref->close( ).
    Oh, I was assuming that there is only one result. If there can be more (and better style anyway) do a while-loop until next( ) is different from zero.
    Best regards,
    Jan

  • BW uses more Native SQL than R/3 does?

    hi all,
    BW uses more Native SQL than R/3 does? can anyone explain me how does bw makes effective use of native sql. (i knew what is meant by native sql). can anyone explain me with an realtime scenario.
    regds
    hari

    Hi,
    I don't get your question exactly; Native SQL is the SQL coding used in ABAP in order to deal with the underlying database objects (but I read that you knew that already...).
    BW and R/3 are using extensively native SQL, I couldn't tell if one the application uses more than the other, furthermore I don't think such a statement would make sense.
    BW uses native SQL to post data in the PSA, read this data in the PSA and pass it the internal tables for further processing (Trules / URules for instance); insert records in a cube; read the data in a cube/ods/IObj... in order to display the result of a query; native SQL is used for administrating the BW objects, monitoring, to record statistic; native SQL is used to generate code dynamically and to store/retrieve it from the database...
    In few words, there's a database table behind every single object/process in BW and R/3.
    The database is the memory of your system, native SQL is the mean to use this memory.
    hope this answers your question
    Olivier.
    Message was edited by:
            Olivier Cora

  • Retreiving data from external DB using cursors (Native SQL)

    Hi experts,
    Iu2019m trying to use some functionality based on the Native SQL on an Oracle Server. Iu2019m facing some difficulties using cursors and fetching data from the external database.
    Basically the synonym its zfisicc_c_dblink, and Iu2019m running the for the following code:
    TRY.
          OPEN CURSOR WITH HOLD c1 FOR SELECT *
                                FROM  zfisicc_c_dblink
                                WHERE estado_sif = 'I'.
        CATCH cx_sql_exception INTO sqlerr_ref.
          PERFORM handle_sql_exception USING sqlerr_ref.
      ENDTRY.
    DO.
    *  "Move the data from the Cursor into the target area.
        FETCH NEXT CURSOR c1 APPENDING TABLE tab.
        IF sy-subrc  0.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE CURSOR c1.
    The cursor C1 it's cursor type and the table tab it's ZFISICC_C_DBLINK type, but every time i run it it's giving me the ORA-932 error.
    Database error text........: "ORA-00932: inconsistent datatypes: expected %s
    got %s"
    Can anyone help me on this error? What Iu2019m doing wrong when fetching the data ?
    Another doubt that Iu2019ve it's when using pl/Sql procedure. Can anyone tell how I can retrieve data from the external database with the following code?
    **Select Directo com Cursor
      EXEC SQL.
        CONNECT TO :gv_db_name AS 'dblink_con'
      ENDEXEC.
      IF sy-subrc NE 0.
        WRITE: 'Não foi possível fazer a ligação à DBCON: ', gv_db_name.
      ELSE.
        EXEC SQL.
          DECLARE CURSOR c_1 IS SELECT tipo_operacao FROM movimento_contribuicao
                 WHERE ROWNUM <= 10000;
              wa movimento_contribuicao.tipo_operacao%type;
    BEGIN
           OPEN c_1;
         LOOP
            FETCH c_1 INTO wa; "Not able to return data to SAP system
             EXIT WHEN c_1%NOTFOUND;
          END LOOP;
      END;
        ENDEXEC.
          EXEC SQL.
          DISCONNECT 'dblink_con'
        ENDEXEC.
      ENDIF.
    On the FETCH c_1 INTO wa; code Iu2019m moving the data to an Oracle variable, wa movimento_contribuicao.tipo_operacao%type;, and not to an program variable. Can anyone explain me this how this is +possible using this PL/SQL procedure?
    Thanks in advance,
    Best Regards
    João Martins
    Edited by: Rob Burbank on May 7, 2010 10:25 AM

    Hi Joao,
    Regarding your first question: It looks like there's a conversion problem (with one or more columns) from your Oracle table to your ABAP internal table.
    In the following link you can see (in your case in the SELECT section) the type conversions used for each type combination.
    Some combinations lead to an oracle error (specified in the "Result" column), like in your case (error 932).
    http://help.sap.com/saphelp_470/helpdata/EN/a3/74caa1d9c411d1950e0000e8353423/content.htm
    Regarding your second question: You can use the PERFORMING addition in the EXEC SQL statement.
    You can see an example in the following link:
    http://help.sap.com/saphelp_470/helpdata/EN/fc/eb3b8b358411d1829f0000e829fbfe/content.htm
    Hope it helps.
    Regards,
    Ana Luisa.

  • About use native sql

    how to use the native sql get the following value
    REPORT  YXLIU0010.
    DATA: exc_ref TYPE REF TO cx_sy_native_sql_error,
          error_text TYPE string.
    DATA: BEGIN OF ITAB OCCURS 0 ,
      F_BH(30) TYPE C,
      F_NCYEJE TYPE p DECIMALS 2,
    END OF ITAB.
      TRY.
        EXEC SQL PERFORMING eout.
          select ZFIITKMJE.F_KMBH as F_BH,SUM(F_SNJZ) as F_NCYEJE  into :itab from ZFIITKMJE
        ENDEXEC.
      CATCH cx_sy_native_sql_error
        INTO exc_ref.
        error_text = exc_ref->get_text( ).
        ROLLBACK WORK.
      ENDTRY.
    FORM eout.
      write / ITAB-f_bh  .
    ENDFORM.
    it seems than native sql not suppot alias column

    ok!, the last code can work. but i don`t know what happen with "fetch next" or with other thing....
    because now the problem is when call the function: DB02_GET_TB_DETL_ANALYSIS_DB2.
    this send  a dump:
    Table does not exist in database.
    The termination occurred in line 26 of the source code of the (Include)
    program "LDB02_DB2U20"
    of the source code of program "LDB02_DB2U20" (when calling the editor 260).
    Processing was terminated because the exception "CX_SY_NATIVE_SQL_ERROR"
    occurred in the
    procedure "DB02_GET_TB_DETL_ANALYSIS_DB2" "(FUNCTION)" but was not handled
    locally, not declared in the
    RAISING clause of the procedure.
    The procedure is in the program "SAPLDB02_DB2 ". Its source code starts in line
    7
    of the (Include) program "LDB02_DB2$20 ".
    and indicate this part in the code of the function:
    000240 ?
    000250 ?   EXEC SQL.
         > ?     SELECT NAME, CREATOR,
    000270 ?            TYPE, DBNAME,
    000280 ?            TSNAME, COLCOUNT,
    000290 ?            NPAGES, KEYCOLUMNS,

  • Native sql not populating correct data in ECC6.0 unicode system

    Hi,
    I am working in an upgrade upgrade project from 4.6c to ECC6.0.
    4.6c is non-unicode system. ECC6 is Unicode system.
    I am facing Native SQL problem in custom developed programe in ECC6.That means programe reading the data from oracle datbase and stored into internal table.
    But data not stored as normal character format that means its stored as different character format.
    I am suspecting this is due to unicode system. IF that is issue then please provide
    what syntax I have to use for Native SQL statment in unicode system.
    I have provided the code which we are using in programe.
      data:
        i_locn       type table of t_locn,
        v_locn       like line  of i_locn.
      field-symbols:
        <f_005t>        type t_005t.
    Get existing EIS_VIDEO_LOCN_CONV records
      EXEC SQL.
        OPEN C FOR
          SELECT EIS_LOCN
            FROM VIDADMIN.EIS_VIDEO_LOCN_CONV
      ENDEXEC.
      do.
        EXEC SQL.
          FETCH NEXT C
            INTO :V_LOCN-EIS_LOCN
        ENDEXEC.
        if sy-subrc ne 0.
          exit.
        endif.
        append v_locn to i_locn.
      enddo.
      EXEC SQL.
        CLOSE C
      ENDEXEC.
      sort i_locn.
    I am facing the problem in i_locn internal table. Please give me your input to solve this issue.
    - Anandakumar K

    Hi,
    We have resolved this issue with BASIS team help.
    We modified the data charcater set as UTF8  in Oracle data base in unicode system ECC6.0 then the programme returns the
    exact character format
    Regards
    K.Anandakumar

  • Mapping Problem with Native SQL query

    My application uses a native SQL query to locate certain entities. It looks like this:
    SELECT UPLOADATTEMPTREF, STUDENTNUMBER, USERID, WORKITEMCODE, WORKITEMINSTURN, WORKITEMTITLE, MODULERUNCODE, STUDENTNAME, SUBMISSIONDEADLINE, UPLOADATTEMPTSERVERDATE, FILENAME, UPLOADCOMPLETESERVERDATE, NEWFILENAME, FILESIZE, FILEPATH, DOWNLOADSERVERDATE, MODULECODE, MODULETITLE
    FROM Submission_Attempt WHERE UPLOADATTEMPTREF IN (
    SELECT uploadAttemptRef FROM (" +<br /><br />                         "SELECT MAX(uploadAttemptRef) AS uploadAttemptRef, UserID, workItemInstUrn, " +<br /><br />                         "workItemCode FROM Submission_Attempt where workiteminsturn = ?1 " +<br /><br />                         "GROUP BY UserID, workItemInstUrn, workItemCode) Table1 ) " +<br /><br />                         "and uploadCompleteServerDate is not null;"<br />
    My expectation was that EclipseLink would be able to handle the mapping of the results to the entity quite happily. However, I get a NonSynchronizedVector of Objects - each Object representing one field of data.
    I need help with either:
    Converting the above SQL into JPQL so that I (hopefully) don't have to worry about the SQL or
    Understanding why this isn't working properly...
    Anyone able to help?
    Edited by: phunnimonkey on Nov 6, 2008 3:33 AM

    Never mind - the problem was to do with not specifying a class when creating the native query.

  • JDBC Receiver - Message Protocol = Native SQL String

    Hi Friends
    Has any one worked on JDBC Receiver with Message Protocol as <b>Native SQL String</b>?
    If so, can you please send me a detailed scenario of it...like
    the datatypes, message types, mappping.
    Because if I use the Native SQL String, then I think I have to pass a simple SQL string to the receiver..
    So how can I do that?
    Regards,
    Raju...

    Hi Raju,
    This can be done using the following format,
    <root>
      <stmt>
        <Customers action="SQL_DML">
          <access> UPDATE Customers SET Name=’$NAME$’ WHERE Number='$NUMBER$’
          </access>
          <key>
            <NAME>ABC</NAME>
            <NUMBER>000</NUMBER>
          </key>
        </Customers>
      </stmt>
    </root>
    Just pass map the value to the correspondung fields in the KEY FIELD and it will work like you want, dynamically.
    Regards,
    bhavesh

  • Fetch join with Native SQL Query?

    Hello all,
    I am using the J2EE 5.0 persistence api with the SUN appserver v9. As the java persistence api does not yet support spatial queries ("... where contains(polygon, point)") I have to use native SQL queries for that purpose.
    Now my question is how can I "join fetch" my ManyToOne-related entities when using a native SQL query? Is this somehow possible using the SqlResultSetMapping annotation?

    Never mind - the problem was to do with not specifying a class when creating the native query.

  • Native sql DBCO, CONNECT statement short dump

    Hi ALL ,
    I am facing the  problem here.  please help me out in this.
    i am trying to connce to the external database MSS, i made all the entries in the DBCO t-code and writing the follwoing native sql statement.
    EXEC SQL.
    CONNECT TO 'AAJ' AS 'V'
    ENDEXEC.
    EXEC SQL.
    SET CONNECTION 'V'
    ENDEXEC.
    The above statement is not giving any error  when i activate it but when i execute it is giving me shortdump error .
    I already maintan   entries in DBCON table or DBCO t-code
    And also tel me once it is connect how can i access the data from MSS (Microsoft sql server)i mean what kind of statement.
    helpfull answer will be rewarded.
    Anees
    9886358645
    Message was edited by:
            anees jawad

    Native SQL
    Open SQL allows you to access database tables declared in the ABAP Dictionary regardless of the database platform that you R/3 System is using. Native SQL allows you to use database-specific SQL statements in an ABAP program. This means that you can use database tables that are not administered by the ABAP Dictionary, and therefore integrate data that is not part of the R/3 System.
    As a rule, an ABAP program containing database-specific SQL statements will not run under different database systems. If your program will be used on more than one database platform, only use Open SQL statements.
    Native SQL Statements in ABAP Programs
    To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:
    EXEC SQL [PERFORMING  )
    The parameters are separated by commas. You must also specify whether the parameter is for input (IN), output (OUT) or input and output (INOUT). For further information, refer to SAP Note 44977.
    EXEC SQL
       EXECUTE PROCEDURE proc1 ( IN , OUT :y )
    ENDEXEC.
    Cursor Processing
    Cursor processing in Native SQL is similar to that in Open SQL:
    OPEN
      ENDIF.
    ENDDO.
    EXEC SQL.
      CLOSE c1
    ENDEXEC.
    This example opens a cursor, reads data line by line, and closes the cursor again. As in Open SQL, SY-SUBRC indicates whether a line could be read.
    Data Types and Conversions
    Using Native SQL, you can
    Transfer values from ABAP fields to the database
    Read data from the database and process it in ABAP programs.
    Native SQL works without the administrative data about database tables stored in the ABAP Dictionary. Consequently, it cannot perform all of the consistency checks used in Open SQL. This places a larger degree of responsibility on application developers to work with ABAP fields of the correct type. You should always ensure that the ABAP data type and the type of the database column are identical.
    If the database table is not defined in the ABAP Dictionary, you cannot refer directly to its data type. In this case, you should create a uniform type description in the ABAP Dictionary, which can then be used by all application programs.
    If the table is defined in the ABAP Dictionary, you should remember that the sequence of fields in the ABAP Dictionary definition may not be the same as the actual sequence of fields in the database. Using the asterisk (*) in the SELECT clause to read all columns into a corresponding work area would lead to meaningless results. In the worst case, it would cause an error.
    The Native SQL module of the database interface passes a description of the type, size, and memory location of the ABAP fields used to the database system. The relevant database system operations are usually used to access and convert the data. You can find details of these operations in the manuals for the programming interface of the relevant database system. In some cases, Native SQL also performs other compatibility checks.
    The documentation from the various database manufacturers provides detailed lists of combinations of ABAP data types and database column types, both for storing ABAP field values in database tables (INSERT, UPDATE) and for reading database contents into ABAP fields (SELECT). You can also apply these descriptions for the input and output parameters of database procedures. Any combinations not listed there are undefined, and should not be used.
    The following sections provide details of the data types and conversions for individual databases. Although they are database-specific, there are also some common features.
    Recommended type combinations are underlined. Only for these combinations is behavior guaranteed from release to release. For any other combinations, you should assume that the description only applies to the specified release.
    The results of conversions are listed in a results column:
    "OK": The conversion can be performed without loss of data.
    Operations that fail are indicated by their SQL error code. Errors of this kind always lead to program termination and an ABAP short dump.
    In some cases, data is transferred without an SQL error occurring. However, the data is truncated, rounded, or otherwise unusable:
    Right truncation.
    "Left" or "right" applies to the normal way of writing a value. So, for example, if a number is truncated, its decimal places are affected.
    : Left truncation
    : Number is rounded up or down during conversion
    : A number that was "too small" is rounded to 0 (underflow)
    : The conversion result is undefined.
    There are several possible results. The concrete result is either not known at all, or can only be described using a set of rules that is too complicated for practical use.
    : The conversion returns the SQL value NULL.
    : The conversion is performed without fields and unchecked.
    The original data is converted, but without its format being checked. The result may therefore be a value invalid for the result type, which cannot be processed further. An example of this is a date field containing the value "99999999" or "abcdefgh" after conversion.
    Combinations of ABAP data type and database column type can be divided into finer subcategories. Here, for example, using the transfer direction ABAP ® database (INSERT, UPDATE):
    If the width of the ABAP field is greater than that of the database column, the ABAP field may contain values for which there is not enough space in the database column. This can produce other cases: The concrete data value in ABAP finds space in the database column, or not.
    If the ABAP field is at most as long as the database column, there is always space for the ABAP value in the database column.
    Some types, such as numeric columns, expect values in a particular format. This is particularly important in connection with character types, for example, when you want to write an ABAP character field (type C) into an integer column.
    Native SQL for Oracle
    Native SQL for Informix
    Native SQL for DB2 Common Server
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm

  • Native SQL Regarding

    Hai Experts,
    I need To  Insert Values Into Sql Server Table Using EXEC And ENDEXEC Commands.
    Can Any one Give Some Suggestion.
    <REMOVED BY MODERATOR>
    Thanks In Adv,
    Jai.M
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 4:38 PM

    Hi,
    EXEC SQl statement does Native SQL .Normally we use OPEN sql statement.
    This is not database specific.So datbase convetor converts into database specific sql statements for our sql statements.This is slow fetching compared to Native sql.
    Open SQL allows you to access database tables declared in the ABAP Dictionary regardless of the database platform that you R/3 System is using. Native SQL allows you to use database-specific SQL statements in an ABAP program. This means that you can use database tables that are not administered by the ABAP Dictionary, and therefore integrate data that is not part of the R/3 System.
    As a rule, an ABAP program containing database-specific SQL statements will not run under different database systems. If your program will be used on more than one database platform, only use Open SQL statements.
    Native SQL Statements in ABAP Programs
    To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:
    REPORT demo_native_sql.
    DATA: BEGIN OF wa,
    connid TYPE spfli-connid,
    cityfrom TYPE spfli-cityfrom,
    cityto TYPE spfli-cityto,
    END OF wa.
    DATA c1 TYPE spfli-carrid VALUE 'LH'.
    EXEC SQL PERFORMING loop_output.
    SELECT connid, cityfrom, cityto
    INTO :wa
    FROM spfli
    WHERE carrid = :c1
    ENDEXEC.
    FORM loop_output.
    WRITE: / wa-connid, wa-cityfrom, wa-cityto.
    ENDFORM.
    <REMOVED BY MODERATOR>
    Cheers,
    Chandra Sekhar.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 4:40 PM

  • Open & Native SQL

    Hai all !
      Can anybody give me the exact Difference between Open SQL & Native SQL.
    Thanks in Advance,
    Swapna.

    Hii!
       Open SQL is basically SAP specific Structured Query language.Open SQL consists of a set of ABAP statements that perform operations on the central database in the R/3 System. The results of the operations and any error messages are independent of the database system in use. Open SQL thus provides a uniform syntax and semantics for all of the database systems supported by SAP. ABAP programs that only use Open SQL statements will work in any R/3 System, regardless of the database system in use. Open SQL statements can only work with database tables that have been created in the ABAP Dictionary.
    Native SQL is basically a database specific language.
    Open SQL allows you to access database tables declared in the ABAP Dictionary regardless of the database platform that you R/3 System is using. Native SQL allows you to use database-specific SQL statements in an ABAP program. This means that you can use database tables that are not administered by the ABAP Dictionary, and therefore integrate data that is not part of the R/3 System.
    As a rule, an ABAP program containing database-specific SQL statements will not run under different database systems. If your program will be used on more than one database platform, only use Open SQL statements.
    To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:
    EXEC SQL [PERFORMING <form>].
      <Native SQL statement>
    ENDEXEC.

  • Open an native sql

    1) what is open sql an wat is native sql an wt is the diference between these to.....

    Hi Satish,
    The difference is:
    OPEN SQL - Open SQL consists of a set of ABAP statements that perform operations on the central database in the R/3 System. The results of the operations and any error messages are independent of the database system in use. Open SQL thus provides a uniform syntax and semantics for all of the database systems supported by SAP. ABAP programs that only use Open SQL statements will work in any R/3 System, regardless of the database system in use. Open SQL statements can only work with database tables that have been created in the ABAP Dictionary.
    NATIVE SQL - Open SQL allows you to access database tables declared in the ABAP Dictionary regardless of the database platform that you R/3 System is using. Native SQL allows you to use database-specific SQL statements in an ABAP program. This means that you can use database tables that are not administered by the ABAP Dictionary, and therefore integrate data that is not part of the R/3 System.
    Plz Reward if useful,
    Mahi.

  • How to use Native SQL statement in JDBC receiver interface

    Dear All,
    Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    Select Field1 Field2 from TABLE Where Field3 like "%Name'
    I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    Hence I need to know:-
    1. What message mapping I should use in case if I have to use Native SQL statement.
    2.What operation mapping I should use in case if I have to use Native SQL statement.
    If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    3 .How do to go about it to do the Java mapping.
    Thanks
    Ameet

    >
    Ameet Deshpande wrote:
    > Dear All,
    >
    > Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    >
    > "
    > Select Field1 Field2 from TABLE Where Field3 like "%Name'
    > "
    > I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    >
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    >
    > The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    >
    > Hence I need to know:-
    >
    > 1. What message mapping I should use in case if I have to use Native SQL statement.
    > 2.What operation mapping I should use in case if I have to use Native SQL statement.
    > If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    > 3 .How do to go about it to do the Java mapping.
    >
    > Thanks
    > Ameet
    You can use a stored procedure, and call it from jdbc receiver adapter.
    I also solve this issue, with a DBLookup in message mapping. You can refer to my blog, and this usefull 3d:
    http://simonlesflex.wordpress.com/2010/12/07/pi-oracle-dblookup/
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

  • Using Native SQL in ABAP for DB2 database

    Dear Friends,
           I have 500K records in ITAB(Internal table) which needs to insert in 'Z' transparent table. Currently it is taking hours of time for insertion and commit. 
    Does using Native SQL helps in performance or any suggestions? If so please send the code. Our database is DB2.
    Your immediate reply is appreciated. Thanks in advance.

    Hi Rama,
    Using array inserts and commit after each Insert, set up your array size as a parameter and try  different array sizes.
    I would start with 2000 and increment by 1000 or 2000 and see what the optimal array size is.
    I would think more commits are desirable, as the array gets bigger it takes longer for the system to prepare in the event of a rollback.
    Just remember to commit after each insert. And are you enqueueing the table first?
    Hope this helps.
    Filler

Maybe you are looking for

  • Change to cost center in time dependent data. Can I rerun depreciation YTD?

    I need to change the cost center in October (Period 10) Period 9 and prior are already closed.  I thought that since I put the Interval for the new cost center as 1/1/11 that it might do and adjustment in October reversing the depreciation posted for

  • After effects cs4 1625 error!!!

    Hi, I'm trying to install aecs4 trial, but intallation stops near the start with this message "suite shared configuration error 1625 error":  why? (sorry for my poor english!!) please help me!!!

  • Field VBUND does not allow changes to the document ?

    If you post the trading partner, the trading partner(Field VBUND)does not allow changes to the document. I can't change trading partner. Thanks!! Message was edited by: Rico Wang

  • Change Movieclips Parameters-Variables

    Hi, Im working on the following code and i need some help to change part of the code: The code is a slider to view pictures loaded from external file. I changed the size of the stage(1000x1000), the big pictures are displayed above(1000x400) and i wo

  • Custom TOC Image in WebHelp

    Hi Guys. I'm using RH 8.  Is it possible to create a custom TOC image to use in WebHelp?  I'm assuming I have to create an entire new skin, huh?  Is there any simple way to get that started? Thanks. Chris