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

Not Like in Select Statement

Former Member
0 Likes
8,717

Hi All,

My requirement is not to select the entries for the T024 table where the eknam is either starts with 'NOT VALID' or blank.

For that, I have written the select statement using NOT LIKE,

Will this negation in the select statement cause extra execution tiem?

If so, can you give some hint for alternative statement.

SELECT EKGRP EKNAM FROM T024 INTO TABLE IT_T024

IT_PURC WHERE EKGRP = S_EKGRP AND EKNAM NOT LIKE 'NOT VALID%' AND EKNAM NOT LIKE ' '.

Thanks,

Kal Chand

Hi All,

My requirement is not to select the entries for the T024 table where the eknam is either starts with 'NOT VALID' or blank.

For that, I have written the select statement using NOT LIKE,

Will this negation in the select statement cause extra execution tiem?

If so, can you give some hint for alternative statement.

SELECT EKGRP EKNAM FROM T024 INTO TABLE IT_T024

IT_PURC WHERE EKGRP = S_EKGRP AND EKNAM NOT LIKE 'NOT VALID%' AND EKNAM NOT LIKE ' '.

Thanks,

Kal Chand

2 REPLIES 2
Read only

Former Member
0 Likes
3,334

Hello,

For the first condition: not starting with 'NOT VALID' , I don't know other way apart from yours: EKNAM NOT LIKE 'NOT VALID%'.

For the second one, not starting with blank: EKNAM NOT LIKE ' '. Does it work? I think it compares if EKNAM is different from blank which can be done using: EKNAM NE ' '.

I hope it will help you.

Read only

Former Member
0 Likes
3,334

Hi All,

I have used the string comparison operator "CS" in the internal table loop.

DATA V_STR1(9) VALUE 'NOT VALID'.

LOOP AT IT_T024.

IF IT_T024-EKNAM CS V_STR1.

CONTINUE.

ENDIF.

ENDLOOP.

Thanks,

Kal Chand