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: 

Special characters in short text to get replaced...

Former Member
0 Kudos

Hi,

Iam working on a code.

Now I am doing something like follows:

LOOP AT IT_FMTABLES into IT_FMTAB.

P_TABLE = IT_FMTAB-STRUCTURE.

ENDLOOP.

IT_FMTAB is a structure and IT_FMTABLES is a internal table. There is a short text name gets populated in IT_FMTAB-STRUCTURE.

I want if short text (IT_FMSTRUCTURE) contains any of the fields like / or : charcters it should get replaced by '_'

Thanks.

Regards,

Rajesh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI Rajesh

Use REPLACE..

REPLACE ALL OCCURRENCES OF '/' IN IT_FMSTRUCTURE WITH '_'.

REPLACE ALL OCCURRENCES OF ':' IN IT_FMSTRUCTURE WITH '_'.

Regards

SAB

4 REPLIES 4

Former Member
0 Kudos

HI Rajesh

Use REPLACE..

REPLACE ALL OCCURRENCES OF '/' IN IT_FMSTRUCTURE WITH '_'.

REPLACE ALL OCCURRENCES OF ':' IN IT_FMSTRUCTURE WITH '_'.

Regards

SAB

0 Kudos

Hi,

How can I combine these two replace statement in one ?

Replace all occurrences of ':' in IT_FMTAB-STRUCTURENAME with 'to'.

Replace all occurrences of '/' in IT_FMTAB-STRUCTURENAME with '_'.

Regards,

Rajesh.

0 Kudos

Try:

translate IT_FMTAB-STRUCTURENAME using '/_:_'.

Guenther

0 Kudos

HI,

I think we cant combine two replace statements...

u can use 2 replace statements nothing wrong in that..

U can use TRANSLATE command.

<b>TRANSLATE IT_FMSTRUCTURE USING '/_:_'.</b>

Regards

SAB