Skip to Content
author's profile photo
Former Member

Sap Dump for Select UP TO 1 ROWS

Hi All,

I'm working on one issue where same sql only for 1 record working fine on quality server but giving dump on production server..i'm unable to check the sap dump as it's on client server...

Can this is related something to Mass data in production server?

GV_QLIST = 'BSEGBELNR BSEGGJAHR BKPF~BUKRS'

GV_QFROM = 'BSEG'.

GV_QWHERE = ''.

SELECT (gv_qlist) FROM (gv_qfrom)

INTO CORRESPONDING FIELDS OF TABLE <itab> UP TO 1 ROWS

WHERE (gv_qwhere).

Regards,

Anuj jain

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

12 Answers

  • Posted on Apr 27, 2011 at 07:25 AM

    Hi,

    BKPF-BUKRS is not in BSEG, you should use BSEGBUKRS.

    The empty WHERE-clause may also be a problem! You can use WHERE-option GJAHR > 0" for example.

    Regards,

    Klaus

    Edited by: Klaus Babl on Apr 27, 2011 9:27 AM

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Apr 27, 2011 at 07:27 AM

    Hi,

    Is this SELECT statement exactly as the one you have?

    I ask because you are trying to select BKPF-BUKRS from BSEG table. Is this a typo?

    Regards,

    Ernesto.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 27, 2011 at 07:28 AM

    Hi,

    U have to use inner join here as u are selecting from two tables BSEG and BKPF.

    check the correct query.,

    GV_QLIST = 'BSEGBELNR BSEGGJAHR BKPF~BUKRS'

    GV_QFROM = 'BSEG'.

    GV_QFROM1 = 'BKPF'.

    GV_QWHERE = ''.

    SELECT (gv_qlist) FROM (gv_qfrom)

    INNERJOIN (gv_qfrom1) on <common field>

    INTO CORRESPONDING FIELDS OF TABLE <itab> UP TO 1 ROWS

    WHERE (gv_qwhere).

    or change BKPFBUKRS to BSEGBUKRS in GV_QLIST = 'BSEGBELNR BSEGGJAHR BKPF~BUKRS'

    hope this helps.,

    Thanks & Regards

    Kiran

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Apr 27, 2011 at 07:53 AM

    Sorry guys,

    This was just a writing mistake

    Actual sql is

    GV_QLIST = 'BSEGBELNR BSEGGJAHR BSEG~BUKRS'

    GV_QFROM = 'BSEG'.

    GV_QWHERE = ''. means no value in where clause

    SELECT (gv_qlist) FROM (gv_qfrom)

    INTO CORRESPONDING FIELDS OF TABLE <itab> UP TO 1 ROWS

    WHERE (gv_qwhere).

    and I have to use BSEG table without any inner join..... n remember this query is working fine in Quality server but not in Production.

    Regards,

    Anuj jain

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      ... you still have the chance to reveal what kind of error/exception is in the dump. There is a short text and a 'what happened' as well as an error analysis.

      Post here as much as you can copy and very soon this thread will be closed.

      Regards,

      Clemens

  • author's profile photo
    Former Member
    Posted on Apr 27, 2011 at 10:09 AM

    Is this dump generated in debug mode?

    I say this beacause it's normal that a SELECT UP TO 1 ROWS give a dump in debug.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Apr 27, 2011 at 10:10 AM

    Dear Klaus,

    Dynamic internal table has right structure and all three fields are key fields of bseg which must be present in all server and important thing this is working on quality server....

    My Only one concern is suppose if table BSEG has a very very huge data in production server but still in this case it should not me give time_out or any database dump for getting only one record.

    Regards,

    Anuj jain

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Apr 27, 2011 at 10:11 AM

    No Debug Mode..

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Check the SAP Help.

      "Addition 1

      ... UP TO n ROWS

      Effect

      This addition restricts the number of rows in the result set. A data object of the Type i is expected for n. A positive number in n indicates the maximum number of rows in the result set. If n contains the value 0, all selected rows are passed to the result set. If n contains a negative number, an exception that cannot be handled is raised.

      Notes

      If the addition ORDER BY is also specified, the rows of the hit list are sorted on the database server and only the number of sorted rows specified in n are passed to the result set. If the addition ORDER BY is not specified, n is filled with any number of rows in the result set that meet the WHERE condition."

      As you do not have a WHERE condition, all of the ROWS in BSEG will be selected and placed in "n". In Quality that number is not so big (debug and check the value n in Quality, is it 1?) but in PRD, it might be huge.

      Regards,

      Ernesto.

  • author's profile photo
    Former Member
    Posted on Apr 27, 2011 at 10:22 AM

    Dear Tony,

    Endselect is not required if we are using sql with TABLE keyword like INTO CORRESPONDING FIELDS OF TABLE <itab> .

    Regards,

    ANuj jain

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Apr 27, 2011 at 10:27 AM

    Hi,

    Here in UP TO n ROWS is 1 which is a Positive number...

    so it'll working fine.

    Regards,

    Anuj jain

    Add comment
    10|10000 characters needed characters exceeded

    • Maybe without where all entries will be read and 1st random one will be passed from database to report.

      Why don't you use SELECT SINGLE without where for receiving a single random entry?

      It will be rather more faster than your SELECT!

  • author's profile photo
    Former Member
    Posted on Apr 27, 2011 at 11:39 AM

    Anuj,

    as the production users to send you the screen dump, dont reach to any kind of conclusion without looking at the dump,

    I can see many reasons of DUMP.

    Can be tim out,

    Can be because of the Empty where clause. etc etc...

    can even be because the buffer is full

    So first check the DUMP.. then it wll be very easy to analyse..

    Add comment
    10|10000 characters needed characters exceeded