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

Re: Is it possible to match a pattern in in a case statement?

$
0
0

You can do something like this with regular expressions. But the case abap_true and the repetition of the variable cond_recort feels a bit ugly

 

 

CASE abap_true.

  WHEN cl_abap_matcher=>matches( pattern ='ST'

                                text    = cond_record ).

  WHEN cl_abap_matcher=>matches( pattern ='VAT'

                                text    = cond_record ).

  WHEN cl_abap_matcher=>matches( pattern ='CST.+'

                                text    = cond_record ).

WHENOTHERS.

ENDCASE.

 

Christian


Viewing all articles
Browse latest Browse all 8620

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>