ABAP Open SQl or EXEC SQL

1.     I want to do following:
Select material_no  from mara where material_type in (u2018XXXu2019, u2018YYYu2019, u2018ZZZu2019)
Where material_no, mateial_type will re replaced by the actual field names.
Is it possible to do that in OPEN SQL or do I have to use native SQL u2013 EXCE SQL in my case Oracle SQL.
2.     I have to refer to material type in (u2018XXXu2019, u2018YYYu2019, u2018ZZZu2019) in several sql querie in ABAP, so is it possible to move this code an ABAP function e.g., allowed_mattypes which will true or false
, so I say
Where allowed_mattypes(materail_type) = true.
Once again can it be done in OPEN SQL or in EXEV SQL.
3. Is there any disadvantage to using EXEC SQL; I know my database Oracle is not going to change and I am qite familiar with EZEC SQL.
THnaks a lot

Hi ,
oh yes it is an object (well, how the database should handle it in any context if it wasn't)
i.e. for ORACLE you would have several thousands of them:
select count(*) from dba_objects where object_type ='VIEW'
If you avoid some kind of foreground processing (i.e. pull the data over the network) and handle the processing inside the database it can improve somehow performance a little (i.e. using the retieved rows of the view to stuff into a database table directly). But his may not always possible...
bye
yk

Similar Messages

  • EXEC SQL with IN Clause

    Hello,
    I'm trying to run an EXEC SQL statement with an IN clause.  Here's my SQL code:
    EXEC SQL.
          OPEN C FOR
          SELECT name
                 FROM sv_hoover_data
                 where dunsNum in :DUNS_NUMBERS
        ENDEXEC.
    My DUNS_NUMBERS variable is of type String and contains the following data:
    ('12334223','4353434','54674563')
    When the statement is executed, I receive the following error message in SM21:
    Line 1: Incorrect syntax near '@P1'.
    Also, the underlying database is MS SQL Server.  When I run the query via MS Query Ananlyzer, it runs fine.
    Does any know if EXEC SQL can handle IN clauses, and if so, how they're written?
    Thanks,
    Matt

    I haven't used it myself (yet), but this is what I found in the help:
    EXEC SQL - EXECUTE
    Syntax
    EXEC SQL.
      EXECUTE PROCEDURE proc ( IN    p_in1    IN    p_in2 ...,
                               OUT   p_out1   OUT   p_out2 ...,
                               INOUT p_inout1 INOUT p_inout2 ... )
    ENDEXEC.
    Effect
    In database systems, you can define procedures as so-called "stored procedures". Since the syntax for calling such procedures and the pertinent parameter transfer for various database systems can vary widely, a uniform command exists in Native SQL.
    The statement EXECUTE PROCEDURE calls a procedure proc stored in the database. For all formal parameters of the procedure, you must specify the actual parameters, separated by commas. You must specify IN, OUT or INOUT before every actual parameter, in order to indicate whether the parameter is an input, output, or input/output parameter. You can use literals or Host Variables labeled by a colon(:)for the actual parameters.
    Example
    This example defines a selfunc procedure using database specific SQL-Statements (Informix). It also calls the procedure using the SAP-specific Native-SQL-Statement EXECUTE PROCEDURE in a LOOP-loop by means of a Selection Table, and deletes the the procedure using an SQL-Statement. In the case shown here, the procedure is a function whose return value output in EXECUTE PROCEDURE is copied to the host variable name.
    DATA scarr_carrid TYPE scarr-carrid.
    SELECT-OPTIONS s_carrid FOR scarr_carrid NO INTERVALS.
    DATA s_carrid_wa LIKE LINE OF s_carrid.
    DATA name TYPE c LENGTH 20.
    TRY.
        EXEC SQL.
          CREATE FUNCTION selfunc( input CHAR(3) )
            RETURNING char(20);
            DEFINE output char(20);
            SELECT carrname
                   INTO output
                   FROM scarr
                   WHERE mandt  = '000' AND
                         carrid = input;
            RETURN output;
            END FUNCTION;
        ENDEXEC.
        LOOP AT s_carrid INTO s_carrid_wa
                         WHERE sign = 'I' AND option = 'EQ'.
          TRY.
             EXEC SQL.
                EXECUTE PROCEDURE selfunc( IN  :s_carrid_wa-low,
                                           OUT :name )
              ENDEXEC.
              WRITE: / s_carrid_wa-low, name.
            CATCH cx_sy_native_sql_error.
              MESSAGE `Error in procedure execution` TYPE 'I'.
          ENDTRY.
        ENDLOOP.
        EXEC SQL.
          DROP FUNCTION selfunc;
        ENDEXEC.
      CATCH cx_sy_native_sql_error.
        MESSAGE `Error in procedure handling` TYPE 'I'.
    ENDTRY.

  • EXEC SQL

    Hi,
    What does an EXEC SQL stmt do in ABAP?
    What is the disadvantage of using it?
    Regards,
    Kalai

    Hi
    <b>EXEC SQL</b>
    EXEC SQL [PERFORMING subr].
    ENDEXEC.
    These statements define an area in an ABAP program in which one or more Native SQL statements are to be carried out. The area between EXEC and ENDEXEC is not completely checked by the syntax check. The statements entered there are passed to the Native SQL interface and processed there as follows:
    Almost all SQL statements that are valid for the addressed database system can be included between EXEC and ENDEXEC, in particular the DDL statements. These SQL statements are passed from the Native SQL interface to the database system largely unchanged. The syntax rules are specified by the database system, in particular the case sensitivity rules for database objects. If the syntax allows a separator character between individual statements, you can include several Native SQL statements between EXEC and ENDEXEC. Generally, the semicolon ( is used as the separator character.
    You can also include SAP-specific Native SQL language elements between EXEC and ENDEXEC. These statements are not passed directly from the Native SQL interface to the database, but are converted appropriately. These SAP-specific language elements are::
    <b>Host variables</b>
    Statements for cursor processing
    Database procedure calls
    Statements for establishing database connections
    All Native SQL statements bypass SAP buffering. Automatic client handling is not performed.
    <b>System fields</b>
    The statement ENDEXEC sets the system fields sy-subrc and sy-dbcnt.
    sy-subrc Meaning
    0 The statements between EXEC and ENDEXEC were executed successfully.
    4 The statements between EXEC and ENDEXEC were not executed.
    The ENDEXEC statement sets sy-dbcnt to the number of table rows processed in the last Native SQL statement.
    Programs with Native SQL statements are generally dependent on the database system used, so that they cannot be executed in all SAP Systems. This is especially true for the examples in this section, which was written for Informix database systems.
    <b>Example</b> Inserting two rows in the database table SCARR. If neither of these rows exists, sy-subrc is set to 0 by ENDEXEC and sy-dbcnt to 1. Otherwise, an exception is raised and handled.
    DATA: exc_ref TYPE REF TO cx_sy_native_sql_error,
          error_text TYPE string.
    TRY.
        EXEC SQL.
          INSERT INTO scarr
                      (MANDT, CARRID, CARRNAME, CURRCODE, URL)
            VALUES ('000', 'FF', 'Funny Flyers', 'EUR',
                    'http://www.ff.com');
          INSERT INTO scarr
                     (MANDT, CARRID, CARRNAME, CURRCODE, URL)
            VALUES ('000', 'EF', 'Easy Flyers', 'EUR',
                    'http://www.ef.com');
        ENDEXEC.
      CATCH cx_sy_native_sql_error INTO exc_ref.
        error_text = exc_ref->get_text( ).
        MESSAGE error_text TYPE 'I'.
    ENDTRY.
    <b>Reward if usefull</b>

  • Exec sql Execute in Pro*C

    Hi,
    My ProC code works fine when I have Exec sql in it but when I include plsql block in it using EXEC SQL EXECUTE, it throws the following error:
    /tmp/cc88UGZa.o(.text+0x2c0): In function `main':
    : undefined reference to `ECPGget_sqlca'
    I have included all these below header files:
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <sqlca.h>
    #include <sqlda.h>
    #include <sqlcpr.h>
    and the path have been mentioned in pcscfg.cfg as well.
    what can be the reason and the solution to this please? Help is appreciated.
    Thanks in advance!
    Ash

    You have to use 'BEGIN procedure_name END' in the execute statement while calling PL/SQL Procedures
    EXEC SQL EXECUTE
    DECLARE
    BEGIN
    END;
    END-EXEC;

  • Memory Allocated using EXEC SQL VAR in ProC

    For a table that stores resumes, I have a ProC program which outputs LONG column values into a host variable. Here is the table definition:
         create table resume (resume_id number(5),
                   resume_size number(15),
                   resume_text LONG)
    The size of the resume_text can be vary from 0 bytes up to 90K bytes. We use the column "resume_size" to store the size of the resume_text in bytes. Since most of them are smaller than 8K, we don't want to allocate 90K memory for every resume SELECT call. Before we do the SELECT on the resume_text, a host variable pointer is used to allocate memory according to the size of the resume_text:     
         char *resume_buffer;
    len = get_resume_size(id); /* A SELECT statement to fetch the resume_size for this resume from the table */               
         resume_buffer = malloc(len); /* Allocate memory for the resume according to the resume_size. For example, len could be 6000 */
         EXEC SQL VAR resume_buffer IS LONG (100000);      /* without using a constant number will lead to a compiler error */
         EXEC SQL SELECT resume_text INTO :resume_buffer FROM resume WHERE resume_id = :id;
    Is 100000" the size actually allocated in memory (either OS level or Oracle data buffer cache) every time it runs or is it just the maximum possible size needed to satisfy the precompiler?
    Any help greatly appreciated.

    You have to use 'BEGIN procedure_name END' in the execute statement while calling PL/SQL Procedures
    EXEC SQL EXECUTE
    DECLARE
    BEGIN
    END;
    END-EXEC;

  • Use Of "#EC CI_EXECSQL in ABAP with EXEC SQL. Statement giving Syntax Error

    Dear Gurus,
    I have encountered an issue while trying to remove warning for using Native SQL statement using pseudo comment "#EC CI_EXECSQL
    The thing is like this -- i have used follwing native sql command in abap.
    EXEC SQL.
        CONNECT TO 'SURROUND_DB'
      ENDEXEC.
    Now when i am checking this code in code inspector it is showing a warning with information below
    CA CL_CI_TEST_CRITICAL_STATEMENTS0006
    Code Inspector
    Critical Statements
    Use of Native SQL
    Authorization checks cannot be appropriately run using EXEC SQL and should be carried out at program level.
    The message can be hidden using the pseudo-comment "#EC CI_EXECSQL
    Use of exceptin handling section for that warning showing me to use :
    The message can be hidden using pseudo
    comment      "#EC CI_EXECSQL
    Now when I am using "#EC CI_EXECSQL in the abap like below :
    EXEC SQL. "#EC CI_EXECSQL
        CONNECT TO 'SURROUND_DB'
      ENDEXEC.
    It is giving syntax error
    The text literal ""#EC CI_EXECSQL        " is longer than 255
    characters.Check whether it ends correctly.
    Please provide the guideline to resolve this issue.
    Thanks & regards
    Saifur Rahaman.

    Hi Saifur,
    You can remove the warning using the following syntax:
    EXEC "#EC CI_EXECSQL
      SQL.
        CONNECT TO 'SURROUND_DB'
      ENDEXEC.
    At least, it worked fine for me when using OPEN CURSOR, SELECT, FETCH and so on statements.
    The way to use the pseudo comment is not very intuitive, but at least for my examples worked fine.
    I hope this may help you.
    Best regards,
    Edgardo G. König

  • EXEC SQL join in ABAP program

    Hi All,
    I am using EXEC SQL join in my ABAP report,but it is giving dump.could you please correct my following code?
    START-OF-SELECTION.
      CONCATENATE '%' pa_match '%' INTO tp_match.
      EXEC SQL.
        OPEN dbcur FOR
        SELECT  kunnr,name1, banks
               FROM  kna1 as a inner join
               knbk as b
               on akunnr = bkunnr
               WHERE a.kunnr = b.kunnr and
               upper(a~name1) LIKE :tp_match
      ENDEXEC.
      DO.
        EXEC SQL.
          FETCH NEXT dbcur INTO :wa_name1
        ENDEXEC.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND wa_name1 TO ta_name1.
        COLLECT wa_name1 INTO ta_name1.
      ENDDO.
      EXEC SQL.
        CLOSE dbcur
      ENDEXEC.

    Remove the 'As' from the statement
    EXEC SQL.
      OPEN dbcur FOR
      SELECT kunnr,name1, banks
      FROM kna1 a inner join        "Delete 'AS' here
      knbk b
      on a~kunnr = b~kunnr
      WHERE a.kunnr = b.kunnr and
      upper(a~name1) LIKE :tp_match
    ENDEXEC.

  • CREATE VIEW in ABAP (Open SQL or Native SQL)

    Hi all you experts!
    I want to create a VIEW in ABAP. I have created Table Views using ABAP Dictionary (in transaction SE11), I don't have any problem with them.
    But, what I need is to create a dynamic view, I mean, a view that can be created/replaced (or modified) at runtime. Is this possible with SAP Open SQL, I don't think so... that is why I tried to created using native SQL but it is not working.
    Here is the code:
      EXEC SQL.
        CREATE VIEW [ZMXRFIV_GLPCA]
          AS SELECT
             T1.GL_SIRID,
             T1.POPER,
             T1.RBUKRS,
             T1.RPRCTR,
             T1.RACCT,
             T1.HSL
          FROM
             GLPCA T1
          INNER JOIN
             SKA1 T2
          ON
             T1.RACCT = T2.SAKNR
          WHERE
            T1.RVERS      =  '000'
            AND T1.RYEAR  =  '2008'
            AND T1.KOKRS  =  'PI01'
            AND T2.KTOPL  =  'PI00'
            AND T2.XBILK  <> 'X'.
      ENDEXEC.
    I have tried using quotes (") for the view name, parenthesis and even using only the name but this make no difference.
    Do any of you experts have any idea?
    PS: After creating the view I need to do a SELECT INTO TABLE to that view and finally delete this view and continue working with the data on the internal table.

    Hi ,
    oh yes it is an object (well, how the database should handle it in any context if it wasn't)
    i.e. for ORACLE you would have several thousands of them:
    select count(*) from dba_objects where object_type ='VIEW'
    If you avoid some kind of foreground processing (i.e. pull the data over the network) and handle the processing inside the database it can improve somehow performance a little (i.e. using the retieved rows of the view to stuff into a database table directly). But his may not always possible...
    bye
    yk

  • Cross Join in ABAP Open SQL

    Hi guys!
    I need to implement a CROSS JOIN (cartesian product) based on two tables. To my understanding there is no construct to implement a cross join in OPEN SQL. So the question is first is this correct? And secondly in which way would you then implement a cross join of two tables with the constructs at hand in ABAP?
    I have come up with the following solution of cross joining two tables, but would like to know if there is a better (not so ugly way).
    Example:
    SELECT * FROM tab1 AS t1 JOIN tab2 AS t2 ON t1mandt = t2mandt INTO CORRESPONDING FIELDS OF itab.
    Note that this only works if the tables tab1 and tab2 is client dependent.
    Regards,
    Christian

    Christian,
      There's no cross join construct in abap. Join statement results in a cartesin product rarely because of completely obsolete statistics missing selection or join conditions.
    Try the following join to get result similar to cartesian product
    select tab1location tab2matnr into itab
      from tab1 join tab2 on tab1location ne tab2matnr.
    if you really want to implement cross join, use native sql, try the following code,
    beware of cartesian products, Basis folks doesn't like em....
    data: begin of itab occurs 0,
      loc like tab1-sloc
      matnr like tab2-matnr,
    end of itab.
    exec sql performing append_itab.
      select a.loc, b.matnr
        into :itab
        from tab1 a
        cross join tab2 b
    endexec.
    form append_itab.
      append itab.
    endform.               
    Regards
    Sridhar.

  • What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it

    hi,
    What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?
    regards.

    sorry, question resolved.

  • SELECT on TIMESTAMP field from ABAP with EXEC SQL

    Hello,
    I'm trying to get a field of one table which is defined as TIMESTAMP. MaxDB parameter DATE_TIME_FORMAT is set to INTERNAL. When I do the SELECT in SQL Studio I get ISO format 'YYYY-MM-DD HH:MM:SS.MMMMMM' back. So I tried a SELECT with ISO in WHERE clause, but I'm always getting a shortdump with this error:
    Database error text........: "POS(82) Invalid date input value"
    Database error code........: "-3065"
    Then I did a SELECT without a WHERE clause in ABAP and got value '06-FEB-09' back from this field. So I tried with this ABAP statement and got no shortdump, but I also need to add time and not only the date.
      EXEC SQL.
        SELECT recv_time INTO :l_time FROM ztest WHERE sent_recv_time = '06-FEB-09'
      ENDEXEC.
    I'm using Native SQL because the SELECT is on a table which is not located in SAP Schema User. "SELECT recv_time FROM ztest WHERE recv_time = '2009-02-24 10:02:55.888000'" works in SQL studio, but not from ABAP.
    Does anyone know which format I need to specify in the WHERE clause?
    Regards
    Markus Karsch
    Edited by: Markus Karsch on Feb 26, 2009 4:22 PM

    >
    Thomas Theodor Koetter  wrote:
    > Hello Markus
    >
    > I don't know whether this will work from ABAP, but at least MaxDB can internally handle the ODBC literals for time, date and timestamp.
    >
    > Therefore literals like
    >
    > "{d'0001-02-03'}"
    > "{t'01:02:03'}"
    > "{ts'0001-02-03 04:05:06'}"
    >
    > might work. See [http://msdn.microsoft.com/de-de/library/ms190234(SQL.90).aspx]
    >
    >
    > HTH & regards  Thomas
    Hi Thomas,
    Thanks for your help. Unfortunately doesn't seem to work, I get following shortdumps (tried with 3 different notations):
    Database error text........: " "
    Database error code........: "-4005"
    Triggering SQL statement...: "SELECT xxxxxx, status, sent_xxxx_time FROM
    xxx_xxxxxxxxx WHERE sent_recv_time = "{ts'2009-02-06 04:05:06'}""
    Database error text........: "POS(87) Invalid keyword or missing delimiter"
    Database error code........: "-3008"
    Triggering SQL statement...: "SELECT xxxxxx, status, sent_xxxx_time FROM
    xxx_xxxxxxxxx WHERE sent_recv_time = '{ts' 2009-02-06 04:05:06 '}'"
    Database error text........: "POS(81) Missing value specification"
    Database error code........: "-5010"
    Triggering SQL statement...: "SELECT xxxxxx, status, sent_xxxx_time FROM
    xxx_xxxxxxxxx WHERE sent_recv_time = { ts '2009-02-06 04:05:06.000' }"
    Regards
    Markus

  • Exec sql help

    Hi,
    I have this abap/exec sql code to extract data from as400/db2.
    I am getting data by a "select" statement and i am trying to append the records with append statements.
    but, not works.
    EXEC SQL.
        CONNECT TO 'SATDBR'
      ENDEXEC.
      EXEC SQL.
    --->(HERE THE PROBLEM)  OPEN C1 FOR.
          SELECT A,B,C,D
          FROM SAPTEST.XX1
      ENDEXEC.
        EXEC SQL.
          OPEN C1
          FETCH NEXT C1 INTO
         :ZTABLE.AA, :ZTABLE.BB, :ZTABLE.CC, :ZTABLE.DD 
    ENDEXEC.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
          APPEND ZTABLE.
        ENDIF.
      ENDDO.
    EXEC SQL.
      CLOSE C1
    ENDEXEC.
      EXEC SQL.
        DISCONNECT 'SATDBR'
      ENDEXEC.
    I need to declare the cursor??? whats wrong in my code :S
    the runtime error is "A SQL mistake has appeared by the execution of Native SQL."
    i would appreciate your help.
    thanks
    vicky

    hi,
    I recommend you, make the select and test it first in the DB2 console.
    Only delcare your internal tables, your variable with abap code.
    To extract the data with the select statement is enough, to fill the table with several records use this code:
    EXEC SQL.
    CONNECT TO 'DB2' " the name of the connection
    ENDEXEC.
    EXEC SQL.
    OPEN C1 FOR
    SELECT A,B,C,D
    FROM SAPTEST.XX1
    ENDEXEC.
    DO
    EXEC SQL.
    OPEN C1
    FETCH NEXT C1 INTO
    :ZTABLE
    ENDEXEC.
    IF sy-subrc <> 0.
    EXIT.
    ELSE.
    APPEND ZTABLE.
    ENDIF.
    ENDDO.
    EXEC SQL.
    CLOSE C1
    ENDEXEC.
    EXEC SQL.
    DISCONNECT 'DB2'
    ENDEXEC.
    The ZTABLE must have the same order in which you put on the fields in the "select"
    DATA:   BEGIN OF  ztable OCCURS 0,
    A(1) TYPE c
    B(8) TYPE c
    C(17)TYPE N
    D(19 TYPE c
            DATA:   END   OF ZTABLE.
    I HOPE THIS INFORMATION HELPS YOU!!
    REGARDS
    VICKY
    Message was edited by: Victoria León

  • EXEC SQL insert null date

    Hello,
    Could anyone please tell me how I can insert a null date into an oracle table dynamically?  Here are my codes:
    DATA: LV_KEY(10),
                LV_DATE TYPE D.
    TRY.
      EXEC SQL.
        INSERT INTO Z_ORACLE_TABLE
        ( KEY_FIELD, OPTION_DATE )
        VALUES
        ( :LV_KEY, TO_DATE( :LV_DATE, 'YYYYMMDD' ) )
      ENDEXEC.
    ENDTRY.
    Somehow, Oracle gives an error if LV_DATE is initial ('00000000'), saying the date is not between -49xx to ....
    I could have done the following but it is kind of dumb:
    TRY.
      IF :LV_DATE IS INITIAL.
        EXEC SQL.
          INSERT INTO Z_ORACLE_TABLE
          ( KEY_FIELD, OPTION_DATE )
          VALUES
          ( :LV_KEY, NULL )
        ENDEXEC.
      ELSE.
        EXEC SQL.
          INSERT INTO Z_ORACLE_TABLE
          ( KEY_FIELD, OPTION_DATE )
          VALUES
          ( :LV_KEY, TO_DATE( :LV_DATE, 'YYYYMMDD' ) )
        ENDEXEC.
    ENDTRY.
    Thanks in advance for any suggestions.

    Hi Sau Tong Calvin,
    don't you mess up INITIAL ans NULL values.
    In ABAP, every data type has an initial value. As opposed to other programming languages, all variables are set to their initial value before use, numeric fields get 0, TYPE N which is numeric character will take 0 in all places, strings are empty and character fields are space. ABAP date fields are type N technically, so will be '00000000'.
    You can store as this using open SQL.
    NULL value means there is nothing stored for this field - this may save disk space if only few records have values stored for the field. But it will make problems in a WHERE clause of selection because SPACE matches initial values but not NULL values and opposite.
    I don't know too much about native EXEC SQL because I never needed in the last decade. Hopefully you can solve the task using ABAP open SQL.
    Regards,
    Clemens

  • SQL error 3113 occurred when executing EXEC SQL.

    Hi,
    We are facing one typical problem, One background is failing regularly with
    below dump. as we now got all notes giving information, if database  restarted
    taking backup, these type of failures occur, but our database is only down for backup once in a week, but it is failing with frequenly.
    in this two servers are located in different place, in this job tries to connect
    another server to get material statistics.
    It is giving some error message in sm21 with
    SQL error 3113 occurred when executing EXEC SQL.
    work procees in reconnect mode.
    all notes saying these types of dump occur when database restared, but this dump
    even though database is up.
    below is short dump, please can anyone help me from this problem.
    ABAP runtime errors    DBIF_DSQL2_SQL_ERROR
          Occurred on    08.01.2007 at 00:30:28
    >> Short dump has not been completely stored. It is too big.
    SQL error 3113 occurred when executing EXEC SQL.
    What happened?
    The error occurred in the current database connection "AZ1".
    What can you do?
    Note the actions and input that caused the error.
    Inform your SAP system administrator.
    You can print out this message by choosing "Print". Transaction ST22
    allows you to display and manage termination messages, including keeping
    them beyond their normal deletion date.
    Error analysis
    How to correct the error
    Database error text........: "ORA-03113: end-of-file on communication channel#"
    Triggering SQL statement...: "select mara.groes, mara.brgew, mara.ntgew,
    mara.gewei, mara.volum, mara.voleh, mara.mstae, mara.mstde, mara.prdha,
    marc.matnr, marc.werks, marc.mmsta, marc.mmstd from sapr3.mara, sapr3.m
    where sapr3.mara.mandt = sapr3.marc.mandt and sapr3.mara.matnr =
    Internal call code.........: "[DBDS/NEW DSQL]"
    Please check the entries in the system log (Transaction SM21).
    If the error occurred in a non-modified SAP program, you may be
    able to find a solution in the SAP note system.
    If you have access to the note system yourself, use the following
    search criteria:
    "DBIF_DSQL2_SQL_ERROR"
    "ZM2431216 " or "ZM2431216 "
    "EXTRACT_GENERAL_DATA"
    If you cannot solve the problem yourself, please send the
    following documents to SAP:
    1. A hard copy print describing the problem.
      To obtain this, select the "Print" function on the current screen.
    2. A suitable hardcopy prinout of the system log.
      To obtain this, call the system log with Transaction SM21
      and select the "Print" function to print out the relevant
      part.
    3. If the programs are your own programs or modified SAP programs,
      supply the source code.
      To do this, you can either use the "PRINT" command in th
      print the programs using the report RSINCL00.
    4. Details regarding the conditions under which the error o
      or which actions and input led to the error.
    System environment
    SAP Release.............. "46C"
    Application server....... "essceu3"
    Network address.......... "172.19.119.198"
    Operating system......... "AIX"
    Release.................. "5.3"
    Hardware type............ "00C7ADBD4C00"
    Database server.......... "ukblx176"
    Database type............ "ORACLE"
    Database name............ "EU3"
    Database owner........... "SAPR3"
    Character set............ "es_ES.ISO8859-1"
    SAP kernel............... "46D"
    Created on............... "Jul 9 2006 20:26:33"
    Created in............... "AIX 1 5 00447C4A4C00"
    Database version......... "OCI_920__OCI_7_API "
    Patch level.............. "2257"
    Patch text............... " "
    Supported environment....
    Database................. "ORACLE 8.0.5.., ORACLE 8.0.6.., ORACLE
    8.1.6.., ORACLE 8.1.7.., ORACLE 9.2.0.., ORACLE 10.2.0.."
    SAP database version..... "46D"
    Operating system......... "AIX 1 4, AIX 2 4, AIX 3 4, AIX 1 5, AIX 2 5, AIX 3
    5, , System build information:,                                      , LCHN :
    841480"
    User, transaction...
    Client.............. 600
    User................ "MPZMMES"
    Language key........ "S"
    Transaction......... " "
    Program............. "ZM2431216 "
    Screen.............. "SAPMSSY0 1000"
    Screen line......... 6
    Information on where termination occurred
    The termination occurred in the ABAP/4 program "ZM2431216 " in
    "EXTRACT_GENERAL_DATA".
    The main program was "ZM2431216 ".
    The termination occurred in line 980
    of the source code of program "ZM2431216 " (when callin
    The program "ZM2431216 " was started as a background jo
    Source code extract
    009500              mara.ntgew,
    009510              mara.gewei,
    009520              mara.volum,
    009530              mara.voleh,
    009540              mara.mstae,
    009550              mara.mstde,
    009560              mara.prdha,
    009570              marc.matnr,
    009580              marc.werks,
    009590              marc.mmsta,
    009600              marc.mmstd
    009610        into :w_ops-groes,
    009620              :w_ops-brgew,
    009630              :w_ops-ntgew,
    009640              :w_ops-gewei,
    009650              :w_ops-volum,
    009660              :w_ops-voleh,
    009670              :w_ops-mstae,
    009680              :w_ops-mstde,
    009690              :w_ops-prdha,
    009700              :w_ops-matnr,
    009710              :w_ops-werks,
    009720              :w_ops-mmsta,
    009730              :w_ops-mmstd
    009740        from sapr3.mara, sapr3.marc
    009750        where sapr3.mara.mandt = sapr3.marc.mandt
    009760          and sapr3.mara.matnr = sapr3.marc.matnr
    009770          and sapr3.mara.mandt = :p_mandt
    009780          and sapr3.mara.matnr = :w_ebs-matnr
    009790          and sapr3.marc.werks = :p_owerks
        >    ENDEXEC.
    009810  endform.                    " extract_general_data
    009820  *&
    009830  *&      Form  append_i_ops
    009840  *&
    009850  *      Appends W_OPS to I_OPS
    009860  *
    009870  form append_i_ops.
    009880    append w_ops to i_ops.
    009890  endform.                    " append_i_ops
    009900  *&
    009910  *&      Form  extract_material_description
    009920  *&
    009930  *      Extracts a Material Description from the remote database an
    009940  *      modifies the current record in I_OPS.
    009950  *
    009960  *        >P_SPRAS  Language Key
    009970  *
    009980  form extract_material_description using    p_spras.
    009990    EXEC sql performing set_langauge.
    Contents of system fields
    SY field contents..................... SY field contents............
    SY-SUBRC 0                            SY-INDEX 0
    SY-TABIX 1                            SY-DBCNT 1
    SY-FDPOS 18                            SY-LSIND 0
    SY-PAGNO 0                            SY-LINNO 1
    SY-COLNO 1
    Chosen variables
    Name.......................... Contents.1........2........3....+..
    W_EBS-PRAT4
                                  2
                                  0
    W_OPS-GROES
                                  22222222222222222222222222222222
                                  00000000000000000000000000000000
    W_OPS-BRGEW                    #######
                                  0000000
                                  000000C
    W_OPS-NTGEW                    #######
                                  0000000
                                  000000C
    regards,
    krishnaiah.

    Hi,
    This is usually a SERVER SIDE DATABASE PROBLEM or SQLNET LISTENER (server side) PROBLEM.  The client side should initially be ignored and instead the server should be investigated. In rare cases, this can be caused by client
    side memory or other resource problem, or a DLL version mismatch, but this is
    unlikely.
    Enlist the assistance of your DBA.  Then reproduce the ORA-3113 error on your
    client application.  Ask your DBA to look at the database side Alert.log and
    trace files and look for ANY activity.  Any activity that coincides with your
    ORA-3113 will be a clue.
    REgards
    Vinod

  • Getting core dump when using EXEC SQL CLOSE

    In my pro*c program , i have used a cursor to fetch the set of accounts.Once cursor is opened , code will perform set
    of operation using fetched data and then cursor is closed. Between open and closing of cursor , i have used 23 EXEC
    SQL CLOSE. For example i am copying the value of a to b using strlcpy between fetch and close cursor statement.If
    returned value from strlcpy is greater than size of destination variable, then flow should not proceed , in that case I will
    close the cursor using EXEC SQL CLOSE and return the flow to calling program. Similarly i have closed the cursor at
    another 22 locations.
    When i compile the code and run binary the core dump occurs. On analyzing the core it shows
    t@null (l@8) terminated by signal SEGV (no mapping at the fault address)
    0xffffffffffffffff: <bad address 0xffffffffffffffff>
    dbx: core file read error: address 0xfc4ffe48 not in data space
    Current function is dbMtBaseClass::Pswd_Change
    7860 sqlcxt(&_dbMtCtx, &sqlctx, &sqlstm, &sqlfpn);
    if I remove any of the three EXEC SQL CLOSE commands , core dump does not occurs.
    It looks strange.Please help me to resolve the issue.

    In my pro*c program , i have used a cursor to fetch the set of accounts.Once cursor is opened , code will perform set
    of operation using fetched data and then cursor is closed. Between open and closing of cursor , i have used 23 EXEC
    SQL CLOSE. For example i am copying the value of a to b using strlcpy between fetch and close cursor statement.If
    returned value from strlcpy is greater than size of destination variable, then flow should not proceed , in that case I will
    close the cursor using EXEC SQL CLOSE and return the flow to calling program. Similarly i have closed the cursor at
    another 22 locations.
    When i compile the code and run binary the core dump occurs. On analyzing the core it shows
    t@null (l@8) terminated by signal SEGV (no mapping at the fault address)
    0xffffffffffffffff: <bad address 0xffffffffffffffff>
    dbx: core file read error: address 0xfc4ffe48 not in data space
    Current function is dbMtBaseClass::Pswd_Change
    7860 sqlcxt(&_dbMtCtx, &sqlctx, &sqlstm, &sqlfpn);
    if I remove any of the three EXEC SQL CLOSE commands , core dump does not occurs.
    It looks strange.Please help me to resolve the issue.

Maybe you are looking for

  • Built in calendar app on iphone disappeared

    My built in calendar app disappeared.  How do I get it back?

  • Export whole database with all stored data

    how can i export the whole database with all tables, sequences, views etc to a textfile and then import it again? it should contain all availabe data. thank you.

  • 9/23 Updater Summary

    Folks, Since the bugs fixed in the updater are not listed by Apple, I'm posting my summary findings after using the update for the last week. 1) ITMS songs not playing: this problem seems to be fixed; there are scattered reports that some still exper

  • Wifi not working with iPhone

    Help I have a rather expensive Belkin router and everything was fine for 6 months. I have one computer and an Xbox connected to it by ethernet. I had an iphone and an ipad connected up by wifi.Despite the large size of the house I had no problems con

  • Restarts doesn't leave start-up screen.

    Today, I tried to download a new application then tried to download the OS X software update. The software update didn't complete, and the applications weren't responding so I restarted the computer using Finder. All icons disappeared but the desktop