cancel
Showing results for 
Search instead for 
Did you mean: 

how to use char. routine in BI7.0 transformation

Former Member
0 Kudos

I need to write a routine in BI7.0 transformation. The requirement is if master data contain "s", then change it to "1". Does anyone know how to make it in char. routine?

Before

1. abs sxc

2. absss

After

1. ab11xc

2. ab111

thanks,

Sudree

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

system say :

E:The field "SOURCE_FIELDS-field1" cannot be changed.

Pravender
Active Contributor
0 Kudos

Where you are writing this code?

Start routine or field routine?

Former Member
0 Kudos

I'm writing in field routine

Pravender
Active Contributor
0 Kudos

Or try this:

RESULT = SOURCE_FIELDS - field1.

REPLACE ALL OCCURRENCES OF 's' IN RESULT WITH '1'.

Former Member
0 Kudos

whe r u writing the code ?? start routine or field level routine??

Edited by: Bilvanth C on May 25, 2010 5:43 PM

Former Member
0 Kudos

this time syntax check is okay, but the error message will occure when I do a testing in test rule

Error in rule test: "REPLACE ALL OCCURENCES OF ...

" should be executed using a search string of the

length 0. The command would have caused an endless

loop.

Former Member
0 Kudos

I wrote it in field routine. Do I need to write syntax in start routine?

Pravender
Active Contributor
0 Kudos

Check the spelling:

REPLACE ALL OCCURRENCES OF

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Please use the below code:


REPLACE ALL OCCURRENCES OF '#' IN p_text WITH ''.
REPLACE cl_abap_char_utilities=>horizontal_tab IN p_text WITH ''.
REPLACE cl_abap_char_utilities=>cr_lf IN p_text WITH ''.

-Vikram

Pravender
Active Contributor
0 Kudos

You can use

REPLACE ALL OCCURRENCES OF 's' IN source_fields-field1 WITH '1'.

Former Member
0 Kudos

system say :

E:The field "SOURCE_FIELDS-field1" cannot be changed.