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

IF, CONTAIN

Former Member
0 Likes
1,566

Hi experts,

I dont remember how can i do this :

IF xz99bw52-matnr like 'GP*' and xz99bw52-charg like N' or xz99bw52-charg like 'P'.

else.

endif.

The error appears with the like and the * doesnt run.

any idea?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,529

Hello,

Please check the syntax again

IF xz99bw52-matnr like 'GP*' and xz99bw52-charg like<b> N'</b> or xz99bw52-charg like 'P'.

or

IF xz99bw52-matnr like 'GP' and xz99bw52-charg like <b> 'N'</b> or xz99bw52-charg like '*P'.

Regards

Byju

Hi experts,

I dont remember how can i do this :

IF xz99bw52-matnr like 'GP*' and xz99bw52-charg like N' or xz99bw52-charg like 'P'.

else.

endif.

The error appears with the like and the * doesnt run.

any idea?

10 REPLIES 10
Read only

Former Member
0 Likes
1,529

try changing '*' with '%'

Read only

Former Member
0 Likes
1,529

Hi,

do this way.

IF xz99bw52-matnr like 'GP%' and xz99bw52-charg like '%N' or xz99bw52-charg like '%P'.

else.

endif.

rgds,

bharat.

Read only

0 Likes
1,529

The error is :

Relational operator "LIKE" is not supported.

Read only

0 Likes
1,529

try like this

if var <b>CP</b> '*N'

it will be CP and *

regards

shiba dutta

Read only

0 Likes
1,529

sorry for the earlier post, the relational operator you have to use is CO which stands for contains. there are also a set of operators like CN, CP, CA, NA and so on. read the f1 help for all these to get a clear idea.

Read only

Former Member
0 Likes
1,530

Hello,

Please check the syntax again

IF xz99bw52-matnr like 'GP*' and xz99bw52-charg like<b> N'</b> or xz99bw52-charg like 'P'.

or

IF xz99bw52-matnr like 'GP' and xz99bw52-charg like <b> 'N'</b> or xz99bw52-charg like '*P'.

Regards

Byju

Read only

Former Member
0 Likes
1,529

Hi,

You can use Contains Pattern(CP) instead of 'Like' in the 'IF' statement.

Code will be as follows:

IF xz99bw52-matnr CP 'GP' and xz99bw52-charg CP 'N' or xz99bw52-charg CP '*P'.

else.

endif.

Hope this helps...

Reward if helpful....

Regards,

Dilli

Read only

Former Member
0 Likes
1,529

Hi,

use cs->contains string eg: 'M'

use cp->contains pattern eg: 'M%' or '%M',...

rgds,

bharat.

Read only

Former Member
0 Likes
1,529
  
RANGES : R_CHARG FOR EKES-CHARG.

  CLEAR R_CHARG.
  R_CHARG-SIGN = 'I'.
  R_CHARG-OPTION = 'CP'.
  R_CHARG-LOW = '*N'.
  APPEND R_CHARG.
  
  CLEAR R_CHARG.
  R_CHARG-SIGN = 'I'.
  R_CHARG-OPTION = 'CP'.
  R_CHARG-LOW = '*P'.
  APPEND R_CHARG.  

IF xz99bw52-matnr(2) = 'GP' and xz99bw52-charg IN R_CHARG.

else.
endif.

This will work for sure.

Read only

0 Likes
1,529

hi friend

in my output screen i displayed valuation type(charg) and batch(clabs) from mchb table.

my requirement is valuation type values want to display as heading title ,under this respective batch values want to display.

give some ideas ..............

regards

kannan.k.s