Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8950

Issue with CA operator

$
0
0

Hello Experts,

 

I've a requirement, where I need to do validation on a field (gv_test1), which stored my results.

 

All I'm trying to do, is to check that if my variable 'gv_test1' has any special characters, which I've stored in a constant c_valchk.

 

For reference, here is my code.


constants: c_valchk(35)     type c value '<>?/`,./!@#$%&*-_+=~|\[{]}()"'.

data: gv_test1                   type char10.

    if gv_test1 ca c_valchk"ca
       clear: pwa_index_h1_postalcode.
    else.
       pwa_index_h1_postalcode = gv_test1.
    endif.

However, always my code goes and clear value in 'pwa_index_h1_postalcode' field, even when 'gv_test1' doesn't contain any special character. It never ever goes and copy value gv_test1 to pwa_index_h1_postalcode.

 

Can anybody see what mistake I'm making in my above code, and how to rectify it, please?

 

Many thanks in advance.


Viewing all articles
Browse latest Browse all 8950

Trending Articles