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: 

Itab - replace all occurences of

Former Member
0 Kudos

Hi all,

I want to replace all occurences of '--' with '?'.

REPLACE ALL OCCURRENCES OF '--'

IN TABLE gt_wf WITH '?'.

But then all next fields will be shifted by one place because '--' are two characters and '?' is just one character.

When I would replace '--' with '??' there would be no problem.

Adding a space has no success in the end of the ?.

I think a line in the itab will be seen as one big string.

Regards

1 ACCEPTED SOLUTION

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

data: lv_string type string.

lv_string = 'test--string'.

REPLACE ALL OCCURRENCES OF '--'

IN lv_string WITH `? `.

write: lv_string.

observe, i have used `? ` instead of '? '. basically use ` instead '

Edited by: ssm on Aug 11, 2011 5:30 PM

3 REPLIES 3

Varamanoj
Participant
0 Kudos

Hi,

will it would be usfule if you replace all occurrences of '--' with ' ?' i.e. space and a ?.

Best Regards

Manoj

Former Member
0 Kudos

Hi,

no the ? must be the first character

Regards

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

data: lv_string type string.

lv_string = 'test--string'.

REPLACE ALL OCCURRENCES OF '--'

IN lv_string WITH `? `.

write: lv_string.

observe, i have used `? ` instead of '? '. basically use ` instead '

Edited by: ssm on Aug 11, 2011 5:30 PM