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

Reports

Former Member
0 Likes
639

Hi,

I am working on 4.6c version, which is not supporting below syntax.

REPLACE ALL OCCURRENCES OF ',' IN wa_output-netwr WITH ''.

REPLACE ALL OCCURRENCES OF '.' IN wa_output-netwr WITH ''.

how to i change this above statemnet to execute.

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
612

Hi,

Here's your solution...

DATA: wv_var(20) type C.

wv_var =  'aze,rty,qwe,,rty'.
WRITE:/ wv_var.

TRANSLATE wv_var USING ', '.     "do not forget the space after coma!
WRITE:/ wv_var.

CONDENSE wv_var NO-GAPS.
WRITE:/ wv_var.

Regards

Mickael

6 REPLIES 6
Read only

Former Member
0 Likes
612

wihout having any coding also u can replace the same with ctrl+f where in u can replace i suppose

praveen

Read only

Former Member
0 Likes
612

Hello,

The REPLACE statement will only replace the first hit on the string. You can also do a loop using the replace.

while sy-subrc = 0.

REPLACE '.' WITH ' ' INTO wa_netwr.

REPLACE ',' WITH ' ' INTO wa_netwr.

endwhile.

If useful reward.

Vasanth

Read only

Former Member
0 Likes
612

Hi Prakash ,

What is the new value you want in place of , .

If that is " then try ''''.

Regadrs

Arun

Read only

Former Member
0 Likes
612

Hi,

Use the statement as bleow...

REPLACE ALL OCCURRENCES OF 'abc' IN myText WITH 'XYZ'.

Regards,

Ram

Read only

0 Likes
612

Hi,

You might also cosider the TRANSLATE command.

Pls check http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb33a5358411d1829f0000e829fbfe/frameset.htm for details.

Eddy

-


Pimp up the S(D)N site and earn points. Check this <a href="/people/eddy.declercq/blog/2007/02/01/pimp-up-the-jam log</a> for details

Read only

Former Member
0 Likes
613

Hi,

Here's your solution...

DATA: wv_var(20) type C.

wv_var =  'aze,rty,qwe,,rty'.
WRITE:/ wv_var.

TRANSLATE wv_var USING ', '.     "do not forget the space after coma!
WRITE:/ wv_var.

CONDENSE wv_var NO-GAPS.
WRITE:/ wv_var.

Regards

Mickael