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

pattern search in select query

Hi All,

I want to select those entries from JCDS table whose objnr field has 'OR' as the first two characters.

Thanks in advance.

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 Oct 18, 2006 at 10:10 AM

    Hi Pankai,

    try this:

    REPORT ZGRO_TEST.

    *

    tables: jcds.

    *

    select-options: s_objnr for jcds-objnr no-display.

    *

    s_objnr-SIGN = 'I'.

    S_OBJNR-OPTION = 'CP'.

    s_objnr-low = 'OR*'.

    append s_objnr.

    *

    select * from jcds where objnr in s_objnr.

    endselect.

    write: / SY-DBCNT.

    Regards, Dieter

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 10:36 AM

    Hi,

    select objnr from jcds into table itab

    <b>where objnr like 'OR%'.</b>

    Regards

    amole

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 10:02 AM

    Hi,

    Try this code:

    SELECT * FROM jcds INTO i_jcds
    WHERE objnr LIKE '%OR%'.

    best regards,

    Thangesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 10:03 AM

    HI Pankaj,

    Refer the code below. This should solve your issue.

    Example to select all customers whose name begins with 'M':

    DATA SCUSTOM_WA TYPE SCUSTOM.

    SELECT ID NAME FROM SCUSTOM

    INTO CORRESPONDING FIELDS OF SCUSTOM_WA

    WHERE NAME LIKE 'M%'.

    WRITE: / SCUSTOM_WA-ID, SCUSTOM_WA-NAME.

    ENDSELECT.

    Reward points if this helps.

    Manish

    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.