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: 

Search operation of string

Former Member
0 Kudos

Hi Experts,

I have 2 variables (both are characters so search operations are possible)

1) 10,000.000

2) 10,0000.

I need to check if the a variable has both ', 'and '.'

Means the first varibale must return me true and the second one false

Let me know if there is solution , without Searching first with , and again Searching with .

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

You can use the CS (contain string) string operator .

Please check the code - -

DATA : w_var(15) TYPE c VALUE '10,000.000',
       w_var1(15) TYPE c VALUE '10,0000'.


IF w_var CS ','  AND w_var CS '.'.
  MESSAGE '1st variable is True ' TYPE 'I'.
ELSEIF w_var1 CS ','  AND w_var1 CS '.'.
  MESSAGE '2nd variable is True 1' TYPE 'I'.
ELSE.
  MESSAGE 'Booth are False' TYPE 'I'.
ENDIF.

Regards

Pinaki

2 REPLIES 2

Former Member
0 Kudos

Try:


  IF var CA '.,'.

 ELSE.

ENDIF.

Former Member
0 Kudos

Hi ,

You can use the CS (contain string) string operator .

Please check the code - -

DATA : w_var(15) TYPE c VALUE '10,000.000',
       w_var1(15) TYPE c VALUE '10,0000'.


IF w_var CS ','  AND w_var CS '.'.
  MESSAGE '1st variable is True ' TYPE 'I'.
ELSEIF w_var1 CS ','  AND w_var1 CS '.'.
  MESSAGE '2nd variable is True 1' TYPE 'I'.
ELSE.
  MESSAGE 'Booth are False' TYPE 'I'.
ENDIF.

Regards

Pinaki