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: 

IF, CONTAIN

Former Member
0 Kudos

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

Former Member
0 Kudos

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

10 REPLIES 10

Former Member
0 Kudos

try changing '*' with '%'

Former Member
0 Kudos

Hi,

do this way.

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

else.

endif.

rgds,

bharat.

0 Kudos

The error is :

Relational operator "LIKE" is not supported.

0 Kudos

try like this

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

it will be CP and *

regards

shiba dutta

0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

use cs->contains string eg: 'M'

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

rgds,

bharat.

Former Member
0 Kudos
  
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.

0 Kudos

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