Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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 a 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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 a comment
    10|10000 characters needed characters exceeded

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

    No Debug Mode..

    Add a 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
    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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.