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

I need help with select ABAP sentnce

How can i write the select sentence (see below). i would like to select from the table BLART = KN and KR. How can I put this into the select sentence?

SELECT * FROM bsak into corresponding fields of table int2

WHERE ( BLART = 'KN' ).

br

saso

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • Posted on Jan 07, 2008 at 12:43 PM
    SELECT * FROM bsak into corresponding fields of table int2
    WHERE BLART = 'KN' OR BLART = 'KR' .

    "AND" would not make sense, as there can only be one document type per entry.

    Cheers

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 12:43 PM

    Hi,

    Do like this,

    SELECT * FROM bsak into corresponding fields of table int2

    WHERE BLART IN ('KN', 'KR').

    Rewards points if helpful.

    Regards,

    Srinivas Ch

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 12:53 PM

    Hi,

    Chnage the code as below :

    SELECT * FROM bsak into corresponding fields of table int2

    WHERE ( BLART = 'KN' or BLART = 'KR' ).

    Thanks,

    Sri.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 04:49 PM

    the best thing you can do is not do it because of performance issues. There is no key on document type in BSAK. If you use BKPF and BSEG instead, you may be able to use an index.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2008 at 06:28 PM

    SELECT *

    FROM bsak

    INTO CORRESPONDING FIELDS of table int2

    WHERE ( BLART = 'KN' or BLART = 'KR' ).

    for clear cut select statement, can you send me the code you have written. I can modify the same for better solution.

    Regards,

    Kishore

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 11:07 AM

    Hi Saso ,

    Try this Code,

    data : itab type Standard table of bsak.

    parameter :P_bukrs like bsak-bukrs.

    select *

    from bsak

    into corresponding fields of table itab

    where bukrs eq p_bukrs

    and blart = 'KR' OR blart = 'KN'.

    if sy-subrc = 0 .

    endif.

    Bye

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 12:06 PM

    Hi you may use the following select statement...

    select *

    from bsak

    into corresponding fields of table itab

    where bukrs eq p_bukrs

    and blart IN ( 'KR' ,''KN' ).

    This yields high performance...

    Regards,

    Sirisha...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 12:09 PM

    Hi,

    Do like this

    SELECT * FROM bsak into corresponding fields of table int2

    WHERE BLART in ( 'KN','KR' ).

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 01:06 PM

    Hi, I found the soluton, Thanks

    SELECT * FROM bsak into corresponding fields of table int2

    WHERE ( BLART = 'KN' ) OR

    ( BLART = 'KR' ) .

    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.