Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

pattern search in select query

Former Member
0 Kudos

Hi All,

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

Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

Hi,

Try this code:

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

best regards,

Thangesh

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

select objnr from jcds into table itab

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

Regards

amole