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

Reg: REPLACE statement

Former Member
0 Likes
590

Hi all,

I am using the below shown statement:

lv_data = ' "YellLive","Acc1st,"January",2009,"Account","Summary_",sch'.

REPLACE ALL OCCURRENCES OF '","' in lv_data with ','.

REPLACE ALL OCCURRENCES OF '",' in lv_data with ','.

REPLACE ALL OCCURRENCES OF ',"' in lv_data with ','.

Basically i want to remove the (") from the variable LV_DATA

Above statements are working fine in ECC 6.0, but not in 4.6C (as, 'ALL OCCURRENCES OF' is not allowed here).

I have to use the same logic in 4.6C

Can someone suggest some solution, but even i dont want to Iterate the Variable LV_DATA and SEARCH, as it will cause Performance problem (as this logic is to be used on the bulk of data in loop).

Thanks and regards,

Pankaj.

4 REPLIES 4
Read only

Former Member
0 Likes
543

Hi,

Try with Translate lv_data using '" '.

Regards,

Suresh.

Read only

Former Member
0 Likes
543

use a FM SSM_REPLACE_CHAR_BY_SPACE

Function module              SSM_REPLACE_CHAR_BY_SPACE
 Import parameters               Value
  INPUT_STRING                    "YELLLIVE","ACC1ST,"JANUARY",2009,"ACCOUNT","SUMMARY_",SCH'
  CHAR                            "

  Export parameters               Value
  OUTPUT_STRING                    YELLLIVE , ACC1ST, JANUARY ,2009, ACCOUNT , SUMMARY_ ,SCH'

Read only

0 Likes
543

Yes, I can use TRANSLATE stm. or the mentioned FM 'SSM_REPLACE_CHAR_BY_SPACE', but I want to remove the spaces also (i want to remove " with blank value and not with SPACE) and that too without using SPLIT statement.

Is there any possible solution?

Thanks and in advance.

Pankaj.

Read only

andreas_mann3
Active Contributor
0 Likes
543

you must program a loop for yout data in 4.6C, because addition "ALL OCCURRENCES "

doesn't exist.

or copy and modify a fm like PREPARE_STRING

A.