DBIF_RSQL_INVALID_CURSOR: Invalid interruption of a database selection.

I have created an external program that extracts a very large table from SAP 7.0 through RFC using the NetWeaver SDK APIs. This program repeatedly calls an RFC-enabled function written in ABAP. On the first
call the function does "OPEN CURSOR WITH HOLD" and a "FETCH". On each subsequent call the function does a "FETCH". The cursor is declared as "STATICS".
When I run the program I am getting the following error:
DBIF_RSQL_INVALID_CURSOR: Invalid interruption of a database selection.
This error manifests itself in two ways.
1) When time interval between RfcInvoke() calls is about 0.5 sec., it takes 30 sec. to 90 sec. for the error to come out.
2) When time interval between RfcInvoke() calls is about 0.2 sec. or lower, it takes 8 min. to 17 min. for the error to come out, but sometimes the program completes successfully in 25 min.
1) What is causing this error?
2) If it has something to do with SAP configuration, how it be modified to extract this particular table.
3) Is it possible in general to extract a table of any size (on the magnitude of gigabytes) using such an approach, that is, a "pull".
4) If the answer is negative, what approach do you think is appropriate.
Any help will be appreciated.

Hi Andrew Coleman  ,
                                 This error sounds like problem is in the way you are calling the RFC Function module (n -number of times). Looks like during the subsequent calls the Select / ENDSELECT  is failing need to check that logic.
Thanks,
Greetson

Similar Messages

  • Error: Invalid interruption of a database selection

    Hi,
    When i execute the below code, the output is displayed without any problem.
    <b>tables lfa1.
    select * from lfa1 order by lifnr.
    write / lfa1-lifnr.
    endselect.</b>
    But however when i debug this piece of code, i get an error as below.
    ShrtText - Invalid interruption of a database selection
    Runtime Errors - DBIF_RSQL_INVALID_CURSOR
    Exceptn - CX_SY_OPEN_SQL_DB
    Can anybody help me with the reason for the occurence of this problem.

    Hi Vijay,
    Just go through the following link:
    Re: DBIF_RSQL_INVALID_CURSOR dump during debugging
    As Sooness pointed out, SELECT-ENDSELECT dumps only the first time. Try re-executing it and it will work fine.
    Meanwhile, it is always better to use INTO TABLE OF instead of SELECT-ENDSELECT, as this minimizes database hits.
    Regards
    Anil Madhavan

  • Runtime Error:Invalid interruption of a database selection

    Hi,
    I have the above mentioned runtime error (short text of runtime error) while executuing FM with the runtime error DBIF_RSQL_INVALID_CURSOR and exception CX_SY_OPEN_SQL_DB.
    the source code  for the cause of the error is as follows:
    {       PERFORM fill_spras USING g_r_werks[]
                          CHANGING g_r_spras[].
          IF g_r_spras[] IS INITIAL.
      Please specify a value for Language.
            MESSAGE e003(yy_master_data).
            RAISE error_passed_to_mess_handler.
          ENDIF.
    Determine number of database records to be read per FETCH statement
    from input parameter I_MAXSIZE. If there is a one to one relation
    between DataSource table lines and database entries, this is trivial.
    In other cases, it may be impossible and some estimated value has to
    be determined.
          OPEN  CURSOR s_marc FOR SELECT *
          FROM  marc
          WHERE werks IN g_r_werks AND
                matnr IN g_r_matnr.
        ENDIF.                             "First data package
    Fetch records into interface table.
      named E_T_'Name of extract structure'.
        FETCH NEXT CURSOR s_marc INTO TABLE gt_marc PACKAGE SIZE s_s_if-maxsize.
        IF sy-subrc = 0.
          DELETE ADJACENT DUPLICATES FROM gt_marc COMPARING matnr}
    the pointer shown in the runtime analysis is at if sy-subrc EQ 0.
    while debugging also it gives run time error when curson reaches the statement FETCH Next Cursor.
    Any ideas?

    Hi Simran,
    if for whatever reason the process is interrupted between SELECT and ENDSELECT (or, in other words, after OPEN CURSOR between subsequent FETCHes), you will get this error: The Database is exspected to run within one logical unit of work.
    If any screen is displayed waiting for user input (this also applies for debug screen), an implicit commit is is done that finishes the current LUW. The database will not like it....
    That's why you should do only minor things between SELECT and ENDSELECT (OPEN/CLOSE CURSOR).
    The E Message will also cause the end of the LUW.
    Regards,
    Clemens

  • Frequest process chain issue - Database selection was interrupted

    hi experts,
    we are running master data meta chains daily, and we have PP,SD,MM,LO,FI,PS masterdata meta chains running daily, and everyday 2-3 process chains are failing, it is extracting only 50000 records and the requests becomes RED.
    if i check the long text of the error message, it is giving the below error message.
    Database selection was interrupted (see long text)
    Message no. RSBK072
    Diagnosis
    You are extracting data from a DataSource or an InfoProvider. The selection is made with an open database cursor. This cursor has been invalidated by one of the following ABAP statements:
    COMMIT WORK
    ROLLBACK WORK
    CALL TRANSACTION
    SUBMIT
    The ABAP statement responsible for termination probably ran in a transformation routine programmed by you.
    System Response
    Request processing has ended with errors.
    Procedure
    Change the code for the transformation in which one of the specified ABAP statements is executed. If you are using statement COMMIT WORK, replace it with:
    CALL FUNCTION 'DB_COMMIT'.
    again if i delete the request from the target and repeat it is working fine but taking lot of time. but there are no routines in the transformations.
    please provide us the solution to rectify the issues as it is causing lot of reporting issues.
    regards
    venuscm

    hi experts,
    here is the source 0MAT_PLANT_TEXT and the target is 0MAT_PLANT.
    info  package load is very fast, but DTP it is taking lot of time if i execute the DTP Manually.
    The data packets are processed very fast, but after that at the bottom
    Set technical status to green and
    set overall status to green in yellow very long time, due to this DTP Load for above master data is taking long time.
    how to resolve this?
    any solutionz pl.
    Regards
    venuscm
    Edited by: venu WAD on Oct 24, 2011 6:37 AM

  • Database selection with invalid cursor !

    hi experts,
        When  execute SAP BW processchar, it occur some system error: (sm21)
    Database selection with invalid cursor
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed).
    this error occur when apply bw support package 19.
    sap notes 1118584 Solution is: Import Support Package 17 . but my support package is 19.
    how can i solve this error?
    thanks,
    xwu.

    I am only assuming things, but it might be worth to look closely if you were experiencing an ORA- error during the execution. This could have caused a rollback and thus closed the cursor. Please check the job log, the workprocess trace (dev_wX file) and the system log SM21 and ST22 as well.
    Besides that check the oracle alertlog and the usertrace destination.
    Best regards, Michael

  • Database selection with invalid cursor with MaxDB database

    Hi Experts,
    I encountered the this error:
    "Database selection with invalid cursor
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed)."
    We are using bw support package 19 early this month. Previously is working fine but this problem occured from the last 2 days.
    We are using MaxDB database.
    Really appreciate any speedy responds.

    Hi,
    We finally resolved the issue.
    The solution:
    We check the RFC connection test in SM59. There are connection error.
    There is an error that related J2EE_ADMIN user.
    SO we reset the J2EE_ADMIN id in SU01.
    The problem goes away.
    Many thanks

  • Load data error: Database selection with invalid cursor (sm21)

    hi experts,
    when I execute processchar, it occur some system error:
    "Database selection with invalid cursor ",
    "Documentation for system log message BY 7 :
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed). "
    the error msg occur when apply bw support package19.
    data from DSO to CUBE, Transferred Recodes is not zero, but Added Recodes is zero.
    Request status always yellow, process is running.
    current sys info: BI7 and BW19, BASIS17,PI_BASIS17, the database is oracle10g R2.
    thanks for your help.

    I have solved this issue, The Oracle checkpoint not complete.
    thanks,
    xwu.

  • Processchar occur error:  Database selection with invalid cursor (sm21)

    hi,
       when I execute processchar, it occur some system error:
    "Database selection with invalid cursor ",
    "Documentation for system log message BY 7 :
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed). "
    the error msg occur when apply bw support package19.
    data from DSO to CUBE, Transferred Recodes is not zero, but Added Recodes is zero.
    Request status always yellow, process is running.
    current sys info: BI7 and BW19, BASIS17,PI_BASIS17, the database is oracle10g R2.
    thanks for your help.

    I have solved this issue , The Oracle checkpoint is not complete.
    thanks,
    xwu.

  • Database selection with Invalid Cursor error in RSDRI_INFOPROV_READ

    Hi Everyone.
    I am using RSDRI_INFOPROV_READ Function module for reading data from a multiprovider.
    Logic of the code is as following
    while <more data>
    CALL RSDRI_INFOPROV_READ reading data in E_T_DATA
    Append lines of E_T_DATA to EO_T_DATA.
    If total lines of data in EO_T_DATA > 200000
    <save EO_T_DATA in a file using GUI_DOWNLOAD>
    <clear EO_T_DATA>
    EndIF
    EndWhile.
    As soon as number of record exceed 200000 first file is saved, but after that next data call results in error.
    Error says "Database selection with invalid cursor".
    I suspect that this because of call to FM GUI_DOWNLOAD. While calling this FM after RSDRI_INFOPROV_READ causes system to commit and again the cursor is tried to open in next call casuing it to fail.
    But it is imperative for me to save data in file at regular intervals as data volume is huge.
    Any pointers in this direction will be helpful.

    Hi Everyone.
    I am using RSDRI_INFOPROV_READ Function module for reading data from a multiprovider.
    Logic of the code is as following
    while <more data>
    CALL RSDRI_INFOPROV_READ reading data in E_T_DATA
    Append lines of E_T_DATA to EO_T_DATA.
    If total lines of data in EO_T_DATA > 200000
    <save EO_T_DATA in a file using GUI_DOWNLOAD>
    <clear EO_T_DATA>
    EndIF
    EndWhile.
    As soon as number of record exceed 200000 first file is saved, but after that next data call results in error.
    Error says "Database selection with invalid cursor".
    I suspect that this because of call to FM GUI_DOWNLOAD. While calling this FM after RSDRI_INFOPROV_READ causes system to commit and again the cursor is tried to open in next call casuing it to fail.
    But it is imperative for me to save data in file at regular intervals as data volume is huge.
    Any pointers in this direction will be helpful.

  • Database selection was interrupted (see long text) Error

    Hi
    Please let me know the process to resolve this error on DTP in BI, when i repeat this DTP  it is failing again. and the most of the transferred records are added to the target DSO.
    Error: Database selection was interrupted (see long text)

    Hi:
    Please check if any of the SAP Notes below helps you in solving this issue.
    Note 1285640 - 70SP21: "Database selection was interrupted"
    Note 1518750 - Additional trace messages in the DTP request log
    Note 1519889 - DTP processing: "Database selection was interrupted"
    Regards,
    Francisco Milán.

  • Recompile all invalid objects in live database

    Hi Expers,
    Just need a clarification on recompiling all invalid objects in production database when the systems is busy.
    i thought of recompile all the invalid objects using utlrp.sql script in my production database since some of few synonyms were invalid after application patch script been implemented last weekeend.
    we have identifed the invalid objects now, i thought to run the utlrp.sql, what will be the consequences.
    Regards,
    Salai

    Hi Hemanth,
    I'd reserve utlrp.sql for upgrades, downgrades and patchsets. I do agree 101% with above point, I a not denying on that.
    If you really have a large number of invalid objects, you might choose to compile a few "selected" objects every hour instead of running a single-shot "compile all invalid objects". Rare but a possible requirement.I came across such requirement during early days of career during pushing product enhancement to production and we would have get to know the things and number of objects which would go invalid as we use to carry out testing on test databases.
    I agree completely utlrp.sql is suggested and should opt for.
    - Pavan Kumar N

  • Get all Persons via Database select

    Hello all,
    if you ever need to get all Persons and its string values in an easy way directly from your database such as the xpath select
    " Select * from /Person" use following Database select against your FimService Database:
    --determine dynamically the columns for pivot
    DECLARE @cols AS NVARCHAR(MAX),
    @query  AS NVARCHAR(MAX)
    select @cols = STUFF((SELECT ',' + QUOTENAME(Name)
                        FROM [fim].[ObjectValueString] AS [o]
                        INNER JOIN [fim].[AttributeInternal] AS [ai]
                        ON [ai].[Key] = [o].[AttributeKey]
                        WHERE            
                        [o].[ObjectTypeKey] = 24   
                        group by Name FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'),1,1,'')
    set @query = N'SELECT ' + @cols + N' from
                 (SELECT        
                    [ai].[Name],
                    CAST ([o].[ValueString] AS NVARCHAR(MAX)) as Value,
                    ROW_NUMBER() over(partition by [ai].Name order by [o].[ValueString]) rn
                    FROM [fim].[ObjectValueString] AS [o]
                    INNER JOIN [fim].[AttributeInternal] AS [ai]
                    ON [ai].[Key] = [o].[AttributeKey]
                    WHERE       
                    [o].[ObjectTypeKey] = 24 --Type for Persons
                 ) x
                 pivot
                    Max(Value)
                    for Name in (' + @cols + N')
                 ) p '
    exec sp_executesql @query;

    You could create new stored procedures which do not use the additional search criteria.
    For example: sp_get_all_room_names()
    or: sp_get_all_room_numbers()
    Alternately, when searching by ints, your stored procedure could accept a max and a min value. Your Java class which calls this stored proc could intelligently search for one value (both min/max the same) or all values (pick decent min/max values).
    For example: sp_get_room_numbers(min, max)
    I hope this gives you a few ideas to run with.

  • Add new field infotype "z" in logical database selection screen pnp

    Can add new field infotype "z" in logical database selection screen pnp
    I could explain how to realize
    Thanks

    In case to somebody it interests to him: TO EXTEND SCREEN OF SELECTION WITH OPTIONAL DELIMITERS The case that can be given in a screen of selection of a logical data base it does not appear a certain field that we need in the filter, the steps that will be due to follow are the following:
    u2022 To create a view of selection in agreement with the fields that we want to show To review the following Link http://help.sap.com/saphelp_46c/helpdata/es/6e/6ed638e70ef679e10000000a114084/content.htm u2022 To assign the view of selection to a class of report
    u2022 In the code of report to create select option in the selection screen that allows to introduce imput to leak and after start-of-selection to put the following code,
    "Allocation operative area to optional delimiter
      IF NOT p_aroper IS INITIAL.
        DATA: lt_texpr TYPE rsds_expr OCCURS 0 WITH HEADER LINE,
              wa_texpr TYPE rsds_expr,
              lt_rsds_expr_tab LIKE rsdsexpr OCCURS 10 WITH HEADER LINE,
              wa_rsds_expr_tab LIKE rsdsexpr.
        REFRESH lt_rsds_expr_tab.
        wa_rsds_expr_tab-arity = '0'.
        wa_rsds_expr_tab-fieldname = 'OBJID'.
        wa_rsds_expr_tab-option = 'EQ'.
        wa_rsds_expr_tab-low = p_aroper.
        wa_rsds_expr_tab-high = '00000000'.
        MOVE-CORRESPONDING wa_rsds_expr_tab TO lt_rsds_expr_tab.
        APPEND lt_rsds_expr_tab.
        REFRESH lt_texpr.
        wa_texpr-tablename = 'PA9004'.
        wa_texpr-expr_tab[] = lt_rsds_expr_tab[].
        MOVE-CORRESPONDING wa_texpr TO lt_texpr.
        APPEND lt_texpr.
      pnpdynse[] = lt_texpr[].
      ENDIF.
    English is the forum language.
    Edited by: Rob Burbank on May 18, 2011 11:41 AM

  • No Database Selected - error when running queries

    Hi all,
    I have just got a shiny new macbook at work. For some reason whenever I try to run a query I receive the error "No Database Selected".
    I am connected, I have even tried including a "USE MyFancySchema;", but to no avail.
    I am using Version 3.0.03 Build MAIN-03.45 with MySQL JDBC connector version5.1.14 to connect to MySQL 5.1. The same setup ran fine on my previous Linux laptop.
    Any ideas?

    Oh I hadn't set a default database in the connection settings.
    Edited by: user12063202 on Jan 24, 2011 7:30 AM

  • ORA-12842: Cursor invalidated during parallel execution Database driver err

    Hi gurus,
    I have got an PL/SQL package in DWH environment and sometimes it generates the follwoing error message:
    ORA-12842: Cursor invalidated during parallel execution Database driver error...
    When I restart the process, it runs successfully.
    Any ideas about this behaviour?
    Regards
    Bernd

    More info needed.
    Which Oracle version?
    Are you running up against a known bug? Check metalink.
    Cheers,
    Colin

Maybe you are looking for

  • Acrobat 9.4.4 crashes when open PDF forms

    We are currently rollout out a Win7 imange and using Microsoft Configuration Manager's task sequence to install Acrobat 9.4.4. to the image.  Acrobat works fine when opening regular PDF file.  However, Acrobat crashes everytime when opening a PDF for

  • IC WebClient (lead managment)

    Hello expertise I'm working on CRM 5.0 IC WebClient, I'm facing a problem in the Webclient that When I'm trying to create a lead I got an Error Message that the <b>Business transaction dose not supports lead</b>. Thanks <b>Khaled Fahim</b>

  • 10.4.6 -- no firewire devices show-up

    I upgraded to 10.4.6 on Sunday and everything was fine until this morning. Now, no firewire devices will appear (I have an iSight and two external drives). Please, please, please help!!! Thank you.

  • The keypad on my phone is kind of dead, anyone can help?

    I just purchased my blackberry curve online and received yesterday. At the beginning, everything was great, I can make phone calls, edit address book, change phone tunes etc. And 1 or 2 hours later, suddenly the screen kept showing "Uuouououou......"

  • Error "The Dimension of this page are out of range"

    Please help me with this error i continue to get while attempting to save my work in Illustrator CS3 "Acrobat PDF Format is having difficulties. The dimension of this page are out of range" The original artwork was massive so i figured it could have