11-05-2007 7:03 AM
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.
11-05-2007 7:06 AM
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.
11-05-2007 7:05 AM
select * from ZPROJECT where PROJID like '%PROJ'.
You can use %(Percentage) symbol as a wild character
Regards
Gopi
11-05-2007 7:53 AM
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
11-05-2007 7:05 AM
11-05-2007 7:05 AM
Hi Venu,
You need to use LIKE
WHERE prj_id LIKE p_prjid.
Regards,
Atish
11-05-2007 7:06 AM
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.