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

Regarding Data Base Select Query

Hi All,

I want to extract the data from data base into my internal table

by not giving the exact value but the pattern.

Ex) I want to select the vendor starting with patter '12*'

from LFA table in my internal table.

Which select Query I should use for getting the

Vendor No. starting with pattern '12*' ?.

Points will be rewaded.

Thanks in Advance.

With Regards

Jitendra Gujarathi.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 09:38 AM
    select fld1 fld2 from lfa1
                     into table itab
                     where  lfnr like '12%'
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 09:39 AM

    select lifnr into table itab from lfa1 where <b>lifnr like '12%'.</b>

    it will fetch the record which starts with 12 only

    you may use lifnr like '%12%' also it will fetch the record which contain any 12 in it.

    be careful about leading zeroes lifnr may contain leading 0.

    regards

    shiba dutta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 09:41 AM

    Hi jitendra,

    1. simple

    2.

    select * from lfa1

    into table lfa1

    where lifnr like '12%'.

    regards,

    amit m .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 09:42 AM

    <b>CONCATENATE w_lifnr '%' INTO w_lifnr.

    select lifnr from lfa1 where lifnr like w_lifnr.</b>

    Regards,

    Pavan

    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.