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

Comparing strings

Former Member
0 Likes
424

hello,

I have to write a routine in the update rules where i want to check the value of a keyfigure and then determine the result. For example, Workcenter = 2030-1,

2030-2 , 2030-3, 3040-1, 3040-2, etc. Now i want to write a code, like

IF COMM_STRUCTURE-WORKCENTER LIKE '2030__' .

RESULT =1

ENDIF.

here i just want to check the first 4 letters, if the first 4 letters match than i want to perform the if statement. What operator should i use to match only a part of the string.

Thanks in advance.

Laura.

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
402

Try like this:

IF COMM_STRUCTURE-WORKCENTER+0(4) = '2030' .
  RESULT =1 
ENDIF.

Regards,

Naimesh Patel

2 REPLIES 2
Read only

naimesh_patel
Active Contributor
0 Likes
403

Try like this:

IF COMM_STRUCTURE-WORKCENTER+0(4) = '2030' .
  RESULT =1 
ENDIF.

Regards,

Naimesh Patel

Read only

former_member156446
Active Contributor
0 Likes
402

hi laura

the better option for you will be build a range for ur selection..

ranges: ra_x type your field

<b>sample</b>

MOVE 'I' TO ra_kunnr-sign.

MOVE 'EQ' TO ra_kunnr-option.

MOVE '<b>2030-*</b>' TO ra_kunnr-low.

APPEND ra_kunnr.

CLEAR ra_kunnr.