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

find record

Former Member
0 Likes
695

hi expert

how i can select record which the user keyin the key as *8C01 , and i want to find all record which end with xxxxxxxxx8C01?

select * into table ta_upd_ywch

from ywch

where txbtch in so_btch

how can i change the coding?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
675

Hi,

Use like in select statement:

SELECT name FROM trdir INTO TABLE trdir_tab

WHERE ( name LIKE 'SAPLZ%' OR name LIKE 'SAPLY%' ).

Thanks,

Krishna...

5 REPLIES 5
Read only

Former Member
0 Likes
676

Hi,

Use like in select statement:

SELECT name FROM trdir INTO TABLE trdir_tab

WHERE ( name LIKE 'SAPLZ%' OR name LIKE 'SAPLY%' ).

Thanks,

Krishna...

Read only

0 Likes
675

hmm how can i select any user input? user can keyin anything ... maybe *123 , *1234 .

Read only

Former Member
0 Likes
675
select * into table ta_upd_ywch
from ywch
where txbtch like p_btch.

Best regards,

Prashant

Read only

Former Member
0 Likes
675

no need to change the code. it will work as you have


select * into table ta_upd_ywch
from ywch
where txbtch in so_btch

Read only

Former Member
0 Likes
675

Hi,

Hope the following code solves your problem:

TABLES: mara.

SELECT-OPTIONS s_matnr FOR mara-matnr OBLIGATORY.

DATA: it_mara TYPE TABLE OF mara.

SELECT * INTO TABLE it_mara
FROM mara
WHERE ( matnr IN s_matnr
OR matnr LIKE 'MAT%' ).

IF sy-subrc EQ 0.
  WRITE:/ sy-dbcnt.
ENDIF.

In your case you can write the query as

select * into table ta_upd_ywch
from ywch
where ( txbtch in so_btch
or txbtch like '%8C01' ).

Regards,

Lavanya.