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

String functions

Former Member
0 Likes
409

Hi All,

I have the following value /1BCDWB/CL_EX_WBTF9D0CDCD5

How can i get the above value to look like /1BCDWB/WBTF9D0CDCD5

I am currently using this

**********************************************************************

DATA: PATT TYPE STRING VALUE `CL_EX_`,

RESULT_TAB TYPE MATCH_RESULT_TAB.

FIELD-SYMBOLS <MATCH> LIKE LINE OF RESULT_TAB.

FIND ALL OCCURRENCES OF PATT IN /1BCDWB/CL_EX_WBTF9D0CDCD5 RESULTS RESULT_TAB.

LOOP AT RESULT_TAB ASSIGNING <MATCH>.

write:/ <MATCH>-OFFSET, <MATCH>-LENGTH "in this case offset is 8, length is 6

ENDLOOP.

**************************************************************************

How can i use the above offset and length values to get a result like /1BCDWB/WBTF9D0CDCD5 ?

Thanks and Regards

Dev

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
376

Hi ,

try to use the REPLACE .

regqrds,

Rama reddy

2 REPLIES 2
Read only

Former Member
0 Likes
377

Hi ,

try to use the REPLACE .

regqrds,

Rama reddy

Read only

Former Member
0 Likes
376

well with offset you could do this, but it´ll be quite a lot of work an brain power.

So i´d propose a way easier solution.

replace all occurences of 'CL_EX_' in lv_your_string with space.

condense lv_your_string.