Select query giving dump

Hi,
We have a select query written as below:
SELECT  counter
            stokz
            pernr
            workdate
            rnplnr
            catshours
      FROM catsps
      INTO TABLE t_catsps
      WHERE pernr IN r_pernr
      AND   workdate IN s_wrkdt
      AND   rnplnr IN s_ntwrk
      AND   belnr IN s_docno
      AND   transfer NE 'X'.
Here, the range which we are using has a record of more than 16000. At this particular portion of the code the program dumps. I suspect it is due to the excessive data records in the ranges option. Is there any remedy for this situation. Please help!

Hi,
check the inetrnal table strcure field are of same type of catsps table field which you are fetching
Or try to USe into corresponding fields of table t_catsps.
"check the inetrnal table strcure field are of same
"type of catsps table field which you are fetching
SELECT  counter
             stokz
             pernr
             workdate
             rnplnr
             catshours
       FROM catsps
       INTO TABLE t_catsps   'Or try to USe into corresponding fields of table t_catsps
       WHERE pernr IN r_pernr
       AND   workdate IN s_wrkdt
       AND   rnplnr IN s_ntwrk     "check rnplnr and  s_ntwrk     are of same type
       AND   belnr IN s_docno      "Check belnr and s_docno are of same type
       AND   transfer NE 'X'.
"hadle sy-subrc
prabhudas
Edited by: Rob Burbank on Sep 22, 2010 9:32 AM

Similar Messages

  • Select query giving Time out dump

    Hi All,
        I have written a select query on a table in BW system.The code for the same is attached below.The table contains some 6,00,000 records.This query is giving a time out error.Kindly look into the query and advice ways to make it work.Thanks.
        IF NOT lt_temp[] IS INITIAL.
          SELECT /bic/zprrmatnr objvers /bic/zprclwynr /bic/zprrmdlr
                 FROM  /bic/pzprrmatnr
                 INTO CORRESPONDING FIELDS OF TABLE lt_zprrmatnr
                 FOR ALL ENTRIES IN lt_temp
                 WHERE /bic/zprclwynr = lt_temp-temp
                 AND   objvers = 'A'.
        ENDIF.
    Thanks and Regards,
    Faisal

    Not only is it BW, it is also a customer table. Have a look here on how to research yourself:
    Please Read before Posting in the Performance and Tuning Forum
    Thomas

  • Select query giving error

    Hi can Some one help me how to fit the query in the Main query, I need to selete SYS_ID the below Work around query is getting the output correctly
    but when i tried to put in the main query am getting ORA-00933 not sure how to fix this. Can some one advice me where am making wrong.
    Work Around query :
       SELECT ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
               IN ( SELECT MEDCO.RE_MEDCD_ID_NUM 
                 FROM N09.T_MEDCD_ID MEDCO
              INNER JOIN N09.T_POLY POLY
                    ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID) AS B_SYS_ID
    Need to integerate the above column in the below query.
    Main Query :
    SELECT 'Diff' AS SC,
         POLY.ID,
          ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
               IN ( SELECT MEDCO.RE_MEDCD_ID_NUM 
                 FROM N09.T_MEDCD_ID MEDCO
              INNER JOIN N09.T_POLY POLY
                    ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID) AS B_SYS_ID,
        NULL AS BEG_DT,
      NULL AS ID,
    FROM
       N09.T_POLY POLY
    Oracle Version : 10gR2
    Thanks in advance.

    Hi,
    Hillbird wrote:
    Hi Frank,
    Thanks for your responces. The Error am getting is at line number 7 & col# 55 -- ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID) AS B_SYS_ID,.
    I also changed the alias name in thesubquery as S-poly and left the main query alias as POLY. You still haven't posted a completed query, or any sample data and results.
    But still i am getting the same error message.
    Error Message
    ORA-00933 : Sql command not properly ended
    oo933 00000 - "Sql command not properly ended"
    Vendor Code 933 Error at line 7 column 55
    Iam framing a select query, The work around query is used to checkhow to reterive the value from the DB and with the business rules. on which the framing
    select query the B_sys_id comes in column 3 and i still have more columns to select. Hence i even tried as below
    SELECT 'Diff' AS SC,
    POLY.ID,
    ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
    IN ( SELECT MEDCO.RE_MEDCD_ID_NUM 
                 FROM N09.T_MEDCD_ID MEDCO
                 WHERE POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID),
    NULL AS BEG_DT,
    NULL AS ID,
    FROM
    N09.T_POLY POLY
    But still the same error message i got.
    Hence i just tried as below
    SELECT 'Diff' AS SC,
    1 as dummy,
    2 as dummy_1,
    ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
    IN ( SELECT MEDCO.RE_MEDCD_ID_NUM 
                 FROM N09.T_MEDCD_ID MEDCO
              INNER JOIN N09.T_POLY POLY
    ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID)
    This is working.
    Can you please let me know what is that i need to do if i want to add more columns in the select clause after
    this line ON POLY.REUNIQUE_ID = MEDCO.RE_UNIQUE_ID)_
    Thanks.
    A query (not counting sub-queries) has, at most, only one of each type of clause: one SELECT clause, followed by one FROM clause, followed (optionally) by one WHERE clause. All items to be returned go together in the one SELECT clause. All tables needed are named in the on FROM clause. All filtering conditions go together in the one WHERE clause.
    Perhaps you meant something like this:
    SELECT  'Diff'           AS SC
    ,          POLY.ID
    ,           ALTID.B_SYS_ID
    ,       NULL AS BEG_DT
    ,     NULL AS ID
    FROM     N08.B_ALT_ID_TB ALTID
    JOIN    N09.T_POLY     POLY   ON  altid.column_a  = poly.column_b
    WHERE      ALTID.B_ALT_ID     IN (
                          SELECT  MEDCO.RE_MEDCD_ID_NUM 
                             FROM    N09.T_MEDCD_ID           MEDCO
                             WHERE   POLY.RE_UNIQUE_ID      = MEDCO.RE_UNIQUE_ID
                      )With the little information I have, I can't even guess what the real join condition(s) might be. I used
    ON  altid.column_a  = poly.column_bjust to show the correct syntax.

  • SAP Query giving dump

    Hi all,
    I have a sap query. When query is called using T.code its working fine and if i execute the query through SQ01 then its giving me dump.
    Message is  Error when attempting to IMPORT object "PARVW".
    It says the object in the dataset had a different type from the target object in the program
    So, I thought the problem may be with the Query Variant. I tried to change the query variant through Sq01->goto->maintain variant
    provided the Variant name(only 1 variant is available). selected radio button VALUES and click on Display or Change button here also its giving the same dump.
    Then I tried to remove the PARVW from selection field in SQ01 in change mode ->Basic list, on the left hand side displays the field and 2 check boxes are there one for LIst field and other of Selection. But the check box for Selection is input disabled.
    Can anyone please let me know how can i avoid the dump.
    I gave a search  in SCN and google, but couldn't find any appropriate solution.

    Query  area  is Global Area (Cross Client).
    I'm able to solve the dump probelm. Now i want to design a selection screen for my query. suppose the selection is as follows in one block
    program selections.
    field1
    field2
    field3
    I want it to be displayed in 2 different blocks block 1 and block2
    General Data selection
    field1
    Program Specific
    field2
    field3
    how can we do this one?
    thanks in advance
    Edited by: Mr A on Mar 5, 2010 8:37 PM
    Edited by: Mr A on Mar 5, 2010 8:40 PM

  • Select query giving ora-01555. Need help with tuning

    Hi,
    Following query of mine fails with ORA-01555:
    select xx from a where a.xx NOT IN (select xx from b where status=0)
    Tables a & b have million rows approx. How can I tune the query (to remove "NOT IN").
    The explain plan is:
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=705828732 Card=55061 Bytes=3468843)
    1 0 FILTER
    2 1 TABLE ACCESS (FULL) OF 'A' (Cost=1773 Card=55061 Bytes=3468843)
    3 1 PARTITION RANGE (ITERATOR)
    4 3 PARTITION LIST (ALL)
    5 4 TABLE ACCESS (FULL) OF 'B' (Cost=12819 Card=45553 Bytes=2596521)
    Thanks,
    Prachi

    You could try:
    select xx from a
    minus
    select xx from b
    where  status = 0;But it's not likely to be any better and it won't solve your ora-1555.
    The problem is not your select statement but some other process that is updating the rows you need and overwriting rollback segments.
    Do you have a large update process that is committing in a cursor for loop?

  • ST05 Trace on a select query on BSEG table

    hi all,
    this is my select query on table BSEG table:
      SELECT bukrs
             belnr
             gjahr
             buzei
             KOART
             mwskz
             kostl
             lifnr
             aufnr
             werks
             ebeln
             txjcd
             projk FROM bseg
                   INTO TABLE i_bseg
                   FOR ALL ENTRIES IN i_ad_tab
                  WHERE bukrs EQ i_ad_tab-bukrs  AND
                        belnr EQ i_ad_tab-belnr  AND
                        gjahr EQ i_ad_tab-gjahr.
    when i m doing SQL trace ST05 on this query and in the detail statement showed the following query
    SELECT
      "MANDT" , "BUKRS" , "BELNR" , "GJAHR" , "PAGENO" , "TIMESTMP" ,
      "PAGELG" , "VARDATA"
    FROM
      "RFBLG"
    WHERE
      "MANDT" = ? AND  "BUKRS" = ? AND  "BELNR" = ? AND  "GJAHR" = ?
    ORDER BY
      "MANDT" , "BUKRS" , "BELNR" , "GJAHR" , "PAGENO"
    what is RFBLG table in SE11, but could not find it.
    what is RFBLG?also, the above select query giving me performance issues.. the "for all entries" clause is used as per norms...
    please suggest a solution..

    hi
    good
    The famous BSEG table is a cluster table.
    It is as was correctly stated part of the Accounting Document Segment. It is part of the Pool cluster RFBLG and lives in the package: FBAS (Financial accounting 'Basis').
    You can't read a cluster table exactly the way you read a database (old speak, transparent table).
    You can use a program to read called RFPPWF05
    Note 435694: Display BSEG item by calling FB09D (modified FB09)
    Other possiblity: Other possibility: CALL DIALOG 'RF_ZEILEN_ANZEIGE', but since this is a dialog I don't think this would work.
    In any event go to FBAS Package (development class) to see your business objects, class library and functions.
    you must use keyfields bukrs , belnr, gjahr
    (so 1st select table bkpf) to select bseg.
    or use secondary index tables:
    bsas, bsis, bsik, bsak, bsid, bsad
    Regards,
    Raj.

  • Select query output needed

    Hi
    SELECT CUREPRESS,PRODUCTIONCODE,YYYYMMDD STARTDATE,
    CASE
    WHEN SCHEDULE1 = 0 AND SCHEDULE2 = 0 AND SCHEDULE3 >0 AND ROUND(30-SCHEDULE3/CURECAPACITY*24,0)>24 THEN
              ROUND(30-(SCHEDULE3/CURECAPACITY*24),0)-24
    WHEN SCHEDULE1 = 0 AND SCHEDULE2 = 0 AND SCHEDULE3 >0 AND ROUND(30-SCHEDULE3/CURECAPACITY*24,0)<=24 THEN
              ROUND(30-SCHEDULE3/CURECAPACITY*24,0)
    WHEN SCHEDULE1 = 0 AND SCHEDULE2 >0 AND SCHEDULE3 >0 THEN
    ROUND(22-SCHEDULE2/CURECAPACITY*24,0)
    WHEN SCHEDULE1 > 0 AND SCHEDULE2 >0 AND SCHEDULE3 >0 THEN
    ROUND(14-SCHEDULE1/CURECAPACITY*24,0)
    END STARTDATE1
    FROM (
    SELECT curepress,PRODUCTIONCODE,YYYYMMDD,schedule1,schedule2,schedule3,curecapacity
    FROM ORGCURESCHEDULEDAY A
    WHERE YYYYMMDD = (SELECT MIN(YYYYMMDD)
    FROM ORGCURESCHEDULEDAY B
    WHERE A.PRODUCTIONCODE=B.PRODUCTIONCODE
    AND A.CUREPRESS =B.CUREPRESS )
    )GROUP BY PRODUCTIONCODE,CUREPRESS,YYYYMMDD,SCHEDULE1,SCHEDULE2,SCHEDULE3,CURECAPACITY
    ORDER BY CUREPRESS,PRODUCTIONCODE
    The above query gives 4 column values like..!!
    curepress productioncode startdate startdate1
    0101      IO72A     20110412     22 -------> case statement gives this value as startdate1
    0101      OQ36A     20110221     6
    I want to display the output like startdate1 as (startdate + statedate1)
    curepress productioncode startdate startdate1
    0101      IO72A     20110412     20110412 22.00
    0101      OQ36A     20110221     20110221 06.00
    please help me ...!!
    regards
    Karanam

    Please don't duplicate your questions.
    select query giving error
    Locking this thread.

  • Select query written on view giving dump

    Hi All,
    I have written the following query on COAS view in my code:
          SELECT aufnr bukrs INTO TABLE gt_aufnr
            FROM coas
              WHERE
                    aufnr IN r_aufrm AND
                    auart IN s_auart AND
                    autyp = c_autyp_01 AND
                    kokrs = c_kokrs_mbca.
    When records in range r_aufrm are too many like 6000 or so it gives me a run time error on this query - DBIF_RSQL_INVALID_RSQL. Error description says size of select query is large.
    Question : Is this bug coming because I am using the view. If i select the records on table AUFK (only table on which the view is created), will it rectify the problem?? I am asking this because it's in production and I cant make any change and test then and there.
    Note: the range r_aufrm contains two types of records for AUFNR - 1. with sign GE and others with sign LE. So I cannot use for all entries. If I still can, please tell me how?
    Thanks a looot!
    Waiting for the response,
    Navita

    Thanks All!!
    I think, this range limit has caused the problem. Range limit is 999 records.
    Just one question I have. At runtime when I check the number of entries in r_aufrm in the query, I get 6000 entries. So, does it allow 6000 records to enter the range variable even if it has a limit of 999. Is it the case that, in select query only it will throw a dump if records in range exceed 999??
    SELECT aufnr bukrs INTO TABLE gt_aufnr
    FROM coas
    WHERE
    aufnr IN r_aufrm AND
    auart IN s_auart AND
    autyp = c_autyp_01 AND
    kokrs = c_kokrs_mbca.
    Please clear my doubt.
    Thanks a lot for ur help!!!!
    Navita

  • Select query dump

    Hi all,
    tables: ikpf,iseg.
    TYPES: BEGIN OF i_ikpf,
           werks TYPE ikpf-werks,    "Plant
           lgort TYPE ikpf-lgort,    "Storage location
           iblnr TYPE ikpf-iblnr,    "Physical Inventory Document
           gjahr TYPE ikpf-gjahr,    "Fiscal Year
           zldat TYPE ikpf-zldat,    "Last Count Date
           sobkz TYPE ikpf-sobkz,
           bldat TYPE ikpf-bldat,
           gidat TYPE ikpf-gidat,
           budat TYPE ikpf-budat,
           END   OF i_ikpf.
    DATA:  it_ikpf  TYPE STANDARD TABLE OF i_ikpf              ,
           wa_ikpf  TYPE i_ikpf                                .
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS  : s_matnr FOR iseg-matnr,
                      s_werks FOR ikpf-werks,
                      s_lgort FOR ikpf-lgort,
                      s_iblnr FOR ikpf-iblnr,
                      s_gjahr FOR ikpf-gjahr,
                      s_zldat FOR ikpf-zldat,
                      s_abcin FOR iseg-abcin.
    SELECTION-SCREEN: END OF BLOCK b1     .
    SELECT iblnr gjahr werks lgort sobkz bldat gidat zldat budat
      from ikpf
      INTO TABLE it_ikpf
      WHERE werks IN s_werks and
            lgort IN s_lgort and
            iblnr IN s_iblnr and
            gjahr IN s_gjahr and
            zldat IN s_zldat.
    select query is giving dump as " data could not be placed in an output area"
    thanks in advance,

    When selecting the fields, order of fields selection and fields in internal table should be same.
    Check the below code
    tables: ikpf,iseg.
    TYPES: BEGIN OF i_ikpf,
    iblnr TYPE ikpf-iblnr, "Physical Inventory Document
    gjahr TYPE ikpf-gjahr, "Fiscal Year
    werks TYPE ikpf-werks, "Plant
    lgort TYPE ikpf-lgort, "Storage location
    sobkz TYPE ikpf-sobkz,
    bldat TYPE ikpf-bldat,
    gidat TYPE ikpf-gidat,
    zldat TYPE ikpf-zldat, "Last Count Date
    budat TYPE ikpf-budat,
    END OF i_ikpf.
    DATA: it_ikpf TYPE STANDARD TABLE OF i_ikpf ,
    wa_ikpf TYPE i_ikpf .
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_matnr FOR iseg-matnr,
    s_werks FOR ikpf-werks,
    s_lgort FOR ikpf-lgort,
    s_iblnr FOR ikpf-iblnr,
    s_gjahr FOR ikpf-gjahr,
    s_zldat FOR ikpf-zldat,
    s_abcin FOR iseg-abcin.
    SELECTION-SCREEN: END OF BLOCK b1 .
    SELECT iblnr
           gjahr
           werks
           lgort
           sobkz
           bldat
           gidat
           zldat
           budat
    from ikpf
    INTO TABLE it_ikpf
    WHERE werks IN s_werks and
    lgort IN s_lgort and
    iblnr IN s_iblnr and
    gjahr IN s_gjahr and
    zldat IN s_zldat.
    Other wise use "INTO CORRESPONDING FIELDS" while selecting.
    Hope this helps u.

  • I am getting dump error while running one report in one select query

    Hi,
    While running a report program, I am getting a dump error in one select query. So could you please correct the select query so that I can't face the dump error.
    SELECT vbeln parvw kunnr INTO CORRESPONDING FIELDS OF TABLE l_t_vbpa
      FROM vbpa
      FOR ALL ENTRIES IN l_t_backorder_item
      WHERE vbeln = l_t_backorder_item-vbeln AND
      ( ( parvw = c_we AND kunnr IN rng_shipto ) OR  ( parvw = c_ag AND
      kunnr IN rng_soldto ) ) .
    <removed by moderator>
    Best Regards,
    BDP
    Edited by: Thomas Zloch on Apr 30, 2010 12:31 PM

    Hi Bansidhar,
    It would be helpful if you could tell what type of dump it is.
    If it is a timeout you should check whether l_t_backorder_item is empty - in this case ALL document numbers are selected. f you get the timeout with a populated table consider converting the l_t_backorder_item table into one ore more ranges tables - the select with ranges tables is way quicker than 'for all entries'. But take care the ranges table has not to many entries - the SAP SQL converter puts this into one huge SQL statement and this might become too big to be handled by the database (depends on the actual underlying database).
    I would also consider splitting the SELECT into two (2nd one with 'appending into table') to make the code easier to understand It also helps the database system determining a strategy for the select.
    Regards,
    Gerd Rother

  • Dynamic data select from table is giving dump

    Hello Experts,
       Below statement is giving Dump after it move all the data in my dynamic table.
    When i see in debug. All my recored are avilable in <T_TAB> Table.
    SELECT * FROM (pa_tab) INTO CORRESPONDING FIELDS OF TABLE <T_TAB>.
    > IF SY-SUBRC = 0.
    Information on where terminated
    The termination occurred in the ABAP program "ZFIR_ZTABLE_UPLOAD" in
    "F_DOWNLOAD".
    The main program was "ZFIR_ZTABLE_UPLOAD ".
    The termination occurred in line 403 of the source code of the (Include)
    program "ZFIR_ZTABLE_UPLOAD"
    of the source code of program "ZFIR_ZTABLE_UPLOAD" (when calling the editor
    4030).
    Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
    the
    procedure "F_DOWNLOAD" "(FORM)" but was not handled locally, not declared in
    the
    RAISING clause of the procedure.
    The procedure is in the program "ZFIR_ZTABLE_UPLOAD ". Its source code starts
    in line 399
    of the (Include) program "ZFIR_ZTABLE_UPLOAD ".
    please help me.
    Regards,
    Amit
    Message was edited by:
            Amit Gupta

    Hi Amit,
    Check if you are doing the following in your program
    FIELD-SYMBOLS <T_TAB> TYPE STANDARD TABLE.
    DATA: g_tabref type ref to data.   "Reference to your table structure
    CREATE DATA g_tabref type standard table of (pa_tab).
    ASSIGN g_tabref->* to <T_TAB>.
    SELECT * FROM (PA_TAB) INTO TABLE <T_TAB>.
    Hope this solves your problem.
    Let me know if you require any further info.
    Enjoy SAP. Reward points of useful
    Rajasekhar

  • Dump in select query

    Hi Experts ,
    The following select query creates a dump called time out error, May be this is taking long time to execute . Please tell me how to fine tune this select query?
    select v1vbeln v2matnr
             v2werks v1fkdat
             v1knumv v1fkart
             v1sfakn v2posnr
             v2vgbel v2ntgew
             v2gewei v1land1
             v2autyp v1vbtyp
             v1~vkorg
             v1~vtweg
             v1~spart
        into table i_billing
        from vbrk as v1 inner join
             vbrp as v2 on
             v1vbeln = v2vbeln
       where v1~vbeln in so_vbeln
         and v1~vkorg in so_vkorg
         and v1~vtweg in so_vtweg
         and v1~spart eq p_spart
         and v1~fkart in so_fkart
         and v1~fkdat in so_fkdat
         and v1~vbeln in so_vbeln
         and ( v1~vbtyp eq '5'
          or v1~vbtyp eq '6'
          or v1~vbtyp eq 'M'
          or v1~vbtyp eq 'S'
          or v1~vbtyp eq 'N'
          or v1~vbtyp eq 'O' )
         and ( v2~vgtyp eq 'J'
          or  v2~vgtyp eq 'T' )
       If is a kit o a dis only get positions
          and ( ( v2~zzkit eq '' and
                  v2~zzdis eq '' )
                 or ( ( v2~zzkit ne '' or
                        v2~zzdis ne '' ) and
                 ( v2~uepos <> '000000' ) ) ).
    Thanks in advance .

    hi,
    post it on ABAP forum and not on PI forum
    Regards,
    Michal Krawczyk

  • Dump error in select query

    Hey Gurus,
    i am working on a requirement in which select query is fetching 8 fields from a ZTABLE.
    IF NOT IT_ZQAPP1[] IS INITIAL.
      SELECT AUFNR VORNR PROBNR PIPENO NVORNR SHIFT
      PSTAT PRODAT FROM ZQAPP INTO CORRESPONDING FIELDS OF TABLE IT_ZQAPP_B
      FOR ALL ENTRIES IN IT_ZQAPP1
      WHERE AUFNR = IT_ZQAPP1-AUFNR
      AND WERKS IN P_WERKS
      AND PRODAT LE P_PRODAT.
    it works fine for lesser data but throws a dump error TSV_TNEW_PAGE_ALLOC_FAILED for entries more than 70000,
    and my requirement is to fetch more than a lac record.
    Kindly Suggest the corrections.
    Thanks in Advance...

    Hi!
    This error occurs typically, when there is no more memory for your ABAP session. This means, you have to do one of the followings:
    - restrict your report for smaller intervals, like process only 1 month instead of 6 months together
    - rewrite your program, and eliminate/refresh/free the unneccesary internal tables, or columns from internal tables. You might even try to remove unneccesary lines from internal tables
    - use SELECT - ENDSELECT instead of SELECT ... INTO statement. This could slower your program, but you'll need less memory usage
    Check your memory usage always, with SM04 transaction (Goto - Memory menu).
    Regards
    Tamá

  • Dump in a Select query

    Hi All,
    I am getting a dump & the dump says " TIME LIMIT EXCEEDED". The code as  below:-
    LOOP AT it_gen1 INTO wa_gen1.
            SELECT  vbelv posnv
              FROM  vbfa
        INTO TABLE  li_vbfa
             WHERE  vbeln = wa_gen1-bil_number
               AND  posnn = wa_gen1-itm_number.
            DESCRIBE TABLE li_vbfa  LINES gv_count .
            READ TABLE  li_vbfa  INDEX gv_count  .
            IF sy-subrc =  0 .
              MOVE: li_vbfa-vbelv TO gv_vbelv1,
                    li_vbfa-posnv TO gv_posnv.
            ENDIF .
            CALL FUNCTION 'SD_DOCUMENT_PARTNER_READ'
              EXPORTING
                i_parvw   = 'ZS'
                i_posnr   = gv_posnv
                i_vbeln   = gv_vbelv1
              IMPORTING
                e_vbpa    = li_vbpa
                e_vbadr   = li_vbadr
              EXCEPTIONS
                not_found = 1
                OTHERS    = 2.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
            MOVE  li_vbpa-kunnr  TO  wa_gen2-kunnr .
            MOVE-CORRESPONDING wa_gen1 TO wa_gen2.
            APPEND  wa_gen2 TO it_gen2  .
          ENDLOOP.
    If I use Function Module   CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' before ENDLOOP this will overcome the error says one of my friend.
    Is this a feasible solution for this error?
    Thanks in dvance....

    Hi All,
    Thanks for all your inputs. This issue is resolved now. I have used ranges in the select query & removed FOR ALL ENTRIES construct. The select query is working very fastly now with correct data.
    The code with the changes as below :-
            LOOP AT it_gen1 INTO wa_gen1.
              CLEAR r_bil_number.
              CLEAR r_itm_number.
              r_bil_number-option = 'EQ'.
              r_bil_number-sign = 'I'.
              r_bil_number-low = wa_gen1-bil_number.
              COLLECT r_bil_number.
              r_itm_number-option = 'EQ' .
              r_itm_number-sign = 'I'.
              r_itm_number-low = wa_gen1-itm_number.
              COLLECT r_itm_number.
            ENDLOOP.
            SELECT vbelv
                   posnv
                   vbeln
                   posnn
                   vbtyp_n
                   vbtyp_v                     
                   FROM vbfa
                   INTO TABLE li_vbfa
             WHERE vbeln IN r_bil_number
             AND posnn   IN r_itm_number
             AND vbtyp_n = c_m.
    Regards
    Abhii.

  • Dump for a select query

    Hi Gurus,
    I have a select query as follows:
        SELECT
                   vbap~vbeln
                   vbap~posnr
                   vbap~matnr
                   vbap~arktx
                   vbap~pstyv
                   vbap~abgru
                   vbap~prodh
                   vbap~netwr
                   vbap~werks
                   vbap~kwmeng
                   vbap~prctr
                   vbap~ps_psp_pnr
                               FROM vbap
                INTO TABLE i_item_vbap
                FOR ALL ENTRIES IN i_reg_vbak
                WHERE
                vbap~vbeln EQ i_reg_vbak-vbeln AND
                vbap~matnr IN s_matnr          AND
                vbap~werks IN s_werks          .
    However, when I execute the program, I get the dump saying as:
    I get this exception "DBIF_RSQL_INVALID_RSQL", assigned to CLASS  "CX_SY_OPEN_SQL_DB"
    Please help me in understanding this.
    Also, there are only 85 entries in i_reg_vbak, plus not many values are there for s_matnr and s_werks.
    I tried executing this query w/o for all entries, but still it gave a dump.
    Waiting for your reply, thanks!

    hello
    SELECT
    vbap~vbeln
    vbap~posnr
    vbap~matnr
    vbap~arktx
    vbap~pstyv
    vbap~abgru
    vbap~prodh
    vbap~netwr
    vbap~werks
    vbap~kwmeng
    vbap~prctr
    vbap~ps_psp_pnr
    from vbap into corresponding fields of table it_vbap.
    if u use any  fields of vbap on selection scrren then mention as
    eg: where vbeln in s_vbeln etc.
    with regards,
    sumanth reddy

Maybe you are looking for

  • Windows 7 Ultimate (64-bit) Create a System Image Failure (error code: 0x80780119)

    Hello, I recently bought a new 1 TB hard drive, and I want to move everything from my original 250 GB to the new one. I have read from numerous sources that Creating a System Image through Windows 7, and then restoring that system image using the Win

  • Does Spry meet every requirement of this project?

    Hello everyone, I can't decide whether Spry can be used in my project since I am a newbie in the Ajax world. The main task of this project relates to online examining in all middle schools of a province. The structure of each testing paper is rather

  • HT1338 the Macbook Pro would not even detect the external monitor.

    My Macbook pro will not connect to an external monitor after moving it. It has been running on this same monitor for 8 months. I switched to a new Desk last night, after hooking it up, the Macbook Pro would not even detect the external monitor. It wa

  • Can't connect external usb drive

    I bought a WD mybook essential 500gb drive to use with my macbook pro. It worked for about a day, and then it would randomly connect and disconnect from the computer, and eventually wouldn't appear in disk utility at all. I searched the internet for

  • Home screen still says I have a text msg, but I can't find it.

    My home screen still shows I have a text msg, but when I go into SMS/MMS it's not there.  I can't find this "text msg" that the home screen says I still have.  My inbox says I have 75 items and 1 unread as well.  But I can't locate this msg. I've tri