cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid Special Characters in transformation and conversion files

former_member246680
Participant
0 Kudos

Hi all,

I perused through many posts on this but im struggling to get my java script right.

I have master data from BW which contains invalid special characters and would like to replace them with valid ones for example replace “/” with “_”. In some cases I have different invalid characters in one member and I would like the correct script to change this in my conversion.

e.g. 1/456-3-4 needs to change to 1_456_3_4

I am using this javascript but it still gives warning when I run package.

Transformation:

Conversion: Im my conversion tab I have:

Many thanks

Jordan

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Please read any online JavaScript tutorial about regular expressions!

js: %external%.replace(/\//g,"_")

/.../ - regular expression

\/ - escaped /

g - all matches

former_member186338
Active Contributor
0 Kudos

If you need to replace different characters:

js: %external%.toString.replace(/\//g,"_").replace(/-/g,"_")

etc...

former_member246680
Participant
0 Kudos

Thanks Vadim,

You script works, it rejects members with no special characters though

Regards

Jordan

former_member186338
Active Contributor
0 Kudos

"it rejects members with no special characters though" - what do you mean???

former_member246680
Participant
0 Kudos

Hi Vadim

I have the following members:

1021102

1425312

1/425.312

1/021.102

When I run package with the conversion file for special characters, the members with the special characters are written to BPC but the ones with no special characters are rejected (the first 2 but these should be written too)

Regards

Jordan

former_member186338
Active Contributor

js: %external%.toString.replace(/\//g,"_").replace(/-/g,"_")

toString will help!

former_member246680
Participant
0 Kudos

Thanks Vadim,

Does this conversion also work when you are also moving transactional data from BW to BPC.

Example,

I have GL 1/12356 in BW which has been converted to 1_12356 in BPC. I want to transfer transactional data from 1/12356 from BW to BPC 1_12356.

Regards

Jordan

former_member186338
Active Contributor
0 Kudos

For sure the same conversion has to be used for transactional data!

Answers (0)