Skip to Content
0
Apr 06, 2011 at 03:29 AM

Using Javascript in Conversion/Transformation File

863 Views

Hi All,

I am importing master data and hierarchy for cost center from ECC to BPC.

I have the following scenario:

External Internal Remarks

-


-


-


ABCDEFGHI ABCDEFGHI If it starts with "ABCDE", take in as it is

XXXXXFGHI12345 FGHI12345 If the length is 14, take in 5th to 14th characters

XXXXXFGHI1234 FGHI1234 If the length is 13, take in 5th to 13th characters

I tried to use this in my conversion file, but it failed:

External Internal

-


-


  • js:if(%external%.substring(0,5)="ABCDE") then %external%; else if(%external%.length=13) then

%external%.substring(5,13); else %external%.substring(5,14)

Since there is not many documentation on using javascript in BPC, could anyone advise if my syntax is correct or probably there should be better way of achieving that please?

Thank you very much.