Application Development and Automation 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: 
Read only

Comparison operator for character-type operands issue

Former Member
0 Likes
728

Hi Colleagues,

I am lost ....

I have the following values in my variables

INPUT_PATTERN1 = ZSD_O1100

WA_LOOKUP_FINDER-LINE = FROM /BIC/AZSD_O1100

But the If condition below is not executed ?

IF ( wa_lookup_finder-line CP input_pattern1 ).

ENDIF.

Could you inform me what to correct ?

Thanks

1 ACCEPTED SOLUTION
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
695

Try using IF wa_lookup_finder-line CP *ZSD_O1100 *.

Try using IF wa_lookup_finder-line CP *ZSD_O1100 *.

4 REPLIES 4
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
696

Try using IF wa_lookup_finder-line CP *ZSD_O1100 *.

Read only

Former Member
0 Likes
695

Line is not executed? Or is executed and returns non-zero code? If so, change to 'CS' contains string, since you're not really supplying a pattern.

Read only

samantak_chatterjee
Active Contributor
0 Likes
695

Hi Peter,

You can use the following wild card character '*'. It is recognizing the pattern. You can have a look at the documentation for a detailed explanation.

Sample Code


DATA: str1 TYPE string,
      str2 TYPE string.


str1 = 'FROM /BIC/AZSD_O1100'.
str2 = '*ZSD_O1100*'.

IF str1 CP str2.
BREAK-POINT.
ENDIF.

Hope this helps.

Thanks,

Samantak.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
695

Can you check this


concatenate '*' 'ZSD_O1100' '*' into INPUT_PATTERN1.
WA_LOOKUP_FINDER-LINE = 'FROM /BIC/AZSD_O1100'.
IF ( wa_lookup_finder-line CP input_pattern1 ).
endif.