Application Development and Automation 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: 
Read only

Problem with select query !

Former Member
0 Likes
731

Hello All,

Can we do something like this for a select query ???

select * from ZTABLE
   into table itab
   where FIELD1 = '000000000000000000000925'
     and  FIELD(2) eq '92'.

My field2 is of type Character, and i need to check if there are any entrier that start with `92`, basically do `92*` as we do in se16.

Thanks,

Tatvagna.

1 ACCEPTED SOLUTION
Read only

former_member491305
Active Contributor
0 Likes
710

Hi,

select * from ZTABLE

into table itab

where FIELD1 = '000000000000000000000925'

<b> and FIELD(2) like '92%'.</b>

6 REPLIES 6
Read only

Former Member
0 Likes
710

Hi

see following code :

*select data from EKPO

DATA : V1(3) VALUE '25%',

V2(3) VALUE '45%',

V3(3) VALUE '55%'.

SELECT EBELN EBELP MATNR WERKS PSTYP MENGE MEINS NETPR MWSKZ NAVNW

INCO1 INCO2 LGORT UNTTO UEBTO LOEKZ KNTTP WEPOS REPOS

WEUNB PEINH INFNR BANFN BNFPO ANFNR ANFPS TXZ01 WEBRE

from ekpo into table i_ekpo

where ( ebeln like v1 or

ebeln like v2 or

EBELN LIKE V3 )

AND WERKS NOT IN ('ADMM','LGHS','XO01','NGM1','ADMN')

AND LOEKZ EQ SPACE

AND ELIKZ EQ SPACE.

Reward popints if helpful

Regards.

Srikanta Gope

Read only

former_member491305
Active Contributor
0 Likes
711

Hi,

select * from ZTABLE

into table itab

where FIELD1 = '000000000000000000000925'

<b> and FIELD(2) like '92%'.</b>

Read only

Former Member
0 Likes
710

Hi,

You can follow the same logic in the select query also.

select *

from ztable

where field2 like '92%'.

Read only

Former Member
0 Likes
710

declare a parameter no-display and give it the default '92*' or a range...

parameters: p_field like ztable-field2 default '92*' NO-DISPLAY.

then

select * from ZTABLE

into table itab

where FIELD1 = '000000000000000000000925'

and FIELD(2) eq p_field2.

hope this helps

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
710

Hi,

select * from ZTABLE

into table itab

where FIELD1 = '000000000000000000000925'

and FIELD <b>LIKE '%92%'.</b>.

Regards,

Sesh

Read only

Former Member
0 Likes
710

Thanks to all.

My problem has been solved.

Keep Rocking...!!

Tatvagna.