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: 

Wild Card * using CA CP CO NP etc.

Former Member
0 Kudos

hi,

there is a field called document number which is a

25 character field. It takes both alphabets numbers and

special characters. when i make this entry as say 410

the system saves this as 0000000000000000000000410

i.e. a field of size 25, in this case the field is having

a numeric value, however when i have a value as 0000410HEGDE i.e alphanumeric the system saves this as

0000410HEGDE.

Thus when i do a search i with 4* i get both the

values 410 and 0000410HEGDE

how can i avoid getting 0000410HEGDE when i do a 4* search.

is there anything that i can do with CA, CN, NA, CS, NP, CP, CO

the criteria should be 4* reutrning both values

then later i should sort our only 410 and display it

how should be the code say if

stdoknr-low has 4* and fdraw-doknr has 0000410HEGDE

thanks

Aravinda

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
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

4 REPLIES 4

jayanthi_jayaraman
Active Contributor
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

0 Kudos

thanks a lot jayanthi

it helped a lot

andreas_mann3
Active Contributor
0 Kudos

Hi Aravinda ,

try:

1) check document_nr cp '4'.

-> result : both values

2) check document_nr NA sy-abcde.

-> result : only val 0000000000000000000000410

nice weekend to all

and

regards

Andreas

0 Kudos

thanks a lot for the reply,

i got it solved

thanks again

happy weekend to you

Aravinda