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

CHARACTER SHIFT

Former Member
0 Likes
1,098

HI ALL,

HOW DO WE SELECT CHARACTERS BETWEEN TWO WORDS LIKE.

IF I HAVE ABAPSAPABAP.

I WANNA SELECT SAP FROM THE ABOVE WORD .

THE LENGTH OF THE WORD IN BETWEEN MIGHT CHANGE

LIKE IT MIGHT BE

ABAPSADGABAP

ABAPSDFGGTGHABAP

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
753

hi,

I think there are more ways to go:

1.

REPLACE 'ABAP WITH '' IN string.

CONDENSE string NO-GAPS.

Now string contains only the middle word.

2.

SPLIT string AT 'ABAP' INTO itab.

Now itab has only one line with the middle word.

hope this helps

ec

5 REPLIES 5
Read only

JozsefSzikszai
Active Contributor
0 Likes
754

hi,

I think there are more ways to go:

1.

REPLACE 'ABAP WITH '' IN string.

CONDENSE string NO-GAPS.

Now string contains only the middle word.

2.

SPLIT string AT 'ABAP' INTO itab.

Now itab has only one line with the middle word.

hope this helps

ec

Read only

Former Member
0 Likes
753

Hi ,

Do you want SAP as a word or as diff characters .

Either you can use patterns CP

or you use CA 'SAP' .

Please elaborate about the requirements .

Read only

Former Member
0 Likes
753

Hi,

You can use CS ( Compare string) operator to acheive this.

Shruthi

Read only

Former Member
0 Likes
753

Hi ,

According to u first 4 digits and last 4 didgits are fixed.

so

1. find out the length of the string and make the first 4 digits and last 4 digits as blanks by using off set...and replace...

for example if u get string length as 10 .

replace string+0(4) by space.

replace string+6(4) by space.

condense string ...

u will get middle value of the string.

Thanks,

Read only

Former Member
0 Likes
753

GOT THE SOLUTION GUYS.

THANKS FOR YOUR HELP