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

Regarding LIKE statement in SELECT query

Former Member
0 Likes
451

Hi,

I am having a select-option <b>s_job</b> in my selection-screen.

In the program in select query i am writing condition in where as below:

<b>Select * INTO t_tbt

FROM tbtco

WHERE status EQ 'R' AND

jobname IN s_job.</b>

Now as per new requirement i can give <b>s_job</b> input as <b>Z122*</b>, so as per that i need to change select query.

how can i change query?

If i change where condition to <b>jobname LIKE 's_job%'</b> will that be fine.

Please clarify!

Thanks,

Deep.

1 ACCEPTED SOLUTION
Read only

former_member189059
Active Contributor
0 Likes
413

data: lv_temp(50). " put one more than your job variable size

Loop at s_job.

concatenate s_job-low '%' into lv_temp

Select * appending table t_tbt
FROM tbtco
WHERE status EQ 'R' AND
jobname like lv_temp.

endloop.
2 REPLIES 2
Read only

Former Member
0 Likes
413

no need to change the query if you are giving input Z122* in your select option s_job then your query will work fine.

Select * INTO t_tbt

FROM tbtco

WHERE status EQ 'R' AND

jobname IN s_job.

Only think you can not give range like z122* to z140* in your select option. Only single value is allowable for pattern.

regards

shiba dutta

Read only

former_member189059
Active Contributor
0 Likes
414

data: lv_temp(50). " put one more than your job variable size

Loop at s_job.

concatenate s_job-low '%' into lv_temp

Select * appending table t_tbt
FROM tbtco
WHERE status EQ 'R' AND
jobname like lv_temp.

endloop.