cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BPC Conversion file - using JS code

vsreeja
Explorer
0 Kudos

Hi All,

Please help us with the following scenario.

When we tried to load the transaction data from BW object to BPC, we have one field 'FISCALPER' that we need to convert to BPC format. Conversion logic for the same is as follows:

2006001 --> 2006.07

2006002 --> 2006.08

2006003 ---> 2006.09

2006004 --> 2006.10

2006005 --> 2006.11

2006006 --> 2006.12

2006007 ---> 2007.01

2006008 --> 2007.02

Is it possible to achieve the same using conversion file Java script.?

If so, please guide us.

Thanks and Regards,

Sreeja V

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member186338
Active Contributor

Easy:

js:(((parseInt(%external%.toString().slice(0,4))*12+parseInt(%external%.toString().slice(-2))+5)/12)^0).toString()
+"."+("0"+((parseInt(%external%.toString().slice(0,4))*12+parseInt(%external%.toString().slice(-2))+5)%12+1).toString()).slice(-2)

former_member186338
Active Contributor
0 Kudos

Easy, just search forum. This question was answered many times.

vsreeja
Explorer
0 Kudos

Incrementing the year using conversion file is not found in any forum. It wont be 2006 all the time.. This number may change and we cannot hard code the same as well.

????007 ---> (???? year + 1).01

Thanks and Regards,

Sreeja V