Skip to Content
0

Invalid Special Characters in transformation and conversion files

Jan 16 at 08:37 AM

145

avatar image

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

trans.png (9.9 kB)
conv.png (4.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Vadim Kalinin Jan 16 at 08:45 AM
0

Please read any online JavaScript tutorial about regular expressions!

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

/.../ - regular expression

\/ - escaped /

g - all matches

Show 7 Share
10 |10000 characters needed characters left characters exceeded

If you need to replace different characters:

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

etc...

0

Thanks Vadim,

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

Regards

Jordan

0

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

0

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

0

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

toString will help!

1

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

0

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

0