Skip to Content
author's profile photo Former Member
Former Member

Data retrival problem from BSEG table

Hi,

I am retriving data from BSEG table using BELNR, BUKRS, GJAHR in the where condition. I have to get 4 records which are present in the BSEG table. I am getting only 3 records from the select. What May be the problem in the retrival.

Kishore

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Apr 02, 2008 at 11:56 AM

    Hi,

    I have written a sample query on BSEG table . It is fetching the correct number of records.

    Just compare the actual values in BSEG .

    data: i_bseg type standard table of bseg.

    data: wa_bseg type bseg.

    data:v_belnr type BELNR_D.

    v_belnr = '100000000'.

    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

    EXPORTING

    input = v_belnr

    IMPORTING

    OUTPUT = v_belnr.

    .

    select * into table i_bseg

    from BSEG

    where BUKRS = '2580'

    and BELNR = v_belnr

    and GJAHR = '2006'.

    if sy-subrc eq 0.

    loop at i_bseg into wa_bseg.

    write : / wa_bseg-bukrs,

    wa_bseg-belnr,

    wa_bseg-gjahr.

    endloop.

    endif.

    Hope it helps you.

    Kind Regards,

    Ravi Sankar.Z

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 12:01 PM

    Hi,

    are you working in the same client as your information ?? have you proved in SE16 that the 4 records that you mention fulfill the conditions in WHERE ??

    Additionally, you write that your select condition is loke this:

    select * from BSEG

    where BELNR = something

    BUKRS = something

    GJAHR = something.

    If this is true, you might have some day a performance problem, ´cause you are not following the correct sequence of the key fields:

    select * from BSEG

    where BUKRS = something

    BELNR = something

    GJAHR = something.

    Something else. In the data base you might find the records like '0000012345' and you´re probably searching with '12345'. Pay attention to this point.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 12:13 PM

    I have taken 3 key fields in the where condition , we have 4 keyfields in the BSEG. i am selecting the 4th key field in the internal table..Is it may be reason....Do i need to take all the key fields in the internal table ....?

    Kishore

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 12:25 PM

    Hi,

    I am not suggesting you to use BSEG table,Because performancewise it is poor.

    Just know what you need to display exact detaisl and search

    for relevant tables.

    Regards,

    Chandu

    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.