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: 

RELATED TO WHERE CONDITION--urgent

Former Member
0 Kudos

I have requirement like in function module import parameters are project id, project name, project description and all the input parameters should accept the wild Card input(e.g., miga).

in where clause what i have to write to fetch the records from the table zproject.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Just check whether this can help you.

CP (Contains Pattern)

The logical expression

<f1> CP <f2>

is true if <f1> matches the pattern <f2>. If <f2> is of type C, you can use the following wildcards in <f2>:

• for any character string: *

• for any single character: +

Trailing spaces are ignored and the comparison is not case-sensitive. If the comparison is true, the system field SY-FDPOS contains the offset of <f2> in <f1> . If it is false, SY-FDPOS contains the length of <f1>.

If you want to perform a comparison on a particular character in <f2>, place the escape character # in front of it. You can use the escape character # to specify

• characters in upper and lower case

• the wildcard character "" (enter:#)

• the wildcard character "" (enter: # )

• the escape symbol itself (enter: ## )

• blanks at the end of a string (enter: #___ )

'ABcde' CP 'b' true

'ABcde' CP '#b' false

Try this also.

select * from db into table itab where f1 like '%120%'.

Reward points by clicking the star on the left of reply,if it helps.

5 REPLIES 5

gopi_narendra
Active Contributor
0 Kudos

select * from ZPROJECT where PROJID like '%PROJ'.

You can use %(Percentage) symbol as a wild character

Regards

Gopi

0 Kudos

ok fine,

but my project id is defined with Range type.

my query look like

IF LR_PROJ_NUM[] IS NOT INITIAL.

LV_FLG = 'X'.

CONCATENATE 'PROJECT_NUM IN' ' LR_PROJ_NUM ' INTO LV_TEXT.

SELECT * FROM /MIGA/PROJECT INTO CORRESPONDING FIELDS OF TABLE ET_PROJ_DTL

WHERE (LV_TEXT).

in lv_text how can i mention wildcard character

Former Member
0 Kudos

use % symbol in where clasue,

like

where matnr EQ %1234%

Former Member
0 Kudos

Hi Venu,

You need to use LIKE

WHERE prj_id LIKE p_prjid.

Regards,

Atish

Former Member
0 Kudos

Hi,

Just check whether this can help you.

CP (Contains Pattern)

The logical expression

<f1> CP <f2>

is true if <f1> matches the pattern <f2>. If <f2> is of type C, you can use the following wildcards in <f2>:

• for any character string: *

• for any single character: +

Trailing spaces are ignored and the comparison is not case-sensitive. If the comparison is true, the system field SY-FDPOS contains the offset of <f2> in <f1> . If it is false, SY-FDPOS contains the length of <f1>.

If you want to perform a comparison on a particular character in <f2>, place the escape character # in front of it. You can use the escape character # to specify

• characters in upper and lower case

• the wildcard character "" (enter:#)

• the wildcard character "" (enter: # )

• the escape symbol itself (enter: ## )

• blanks at the end of a string (enter: #___ )

'ABcde' CP 'b' true

'ABcde' CP '#b' false

Try this also.

select * from db into table itab where f1 like '%120%'.

Reward points by clicking the star on the left of reply,if it helps.