cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP BPC Transformation File/ Conversion File using IF Statement with a greater than sign

Former Member
0 Kudos
1,256

Hi All,

We are currently busy with the upload of transactional data using a Transformation/ conversion file.

Part of the transformation we need to determine value based on the first 2 integer values of a col. If the value is less than 50 we asign one value greater than 50 we asign a diffrent value

unfortunatly you can't use < or > in the transformation (as below)

          P_FLOW=*if (*COL(4,1:2) < *STR(1) then *STR(P99);*STR(F_NONE))


I've tried to use a conversion file (JavaScript), but with out any sucess.


*js:if(%external% < 50)  { "P99" } else { "F_NONE" }
*

js:if(parseInt(%external%) < 50)  { "P99" } else { "F_NONE" }

*js: if(parseInt(%external%) < 50) then P99; else F_NONE

  (Few more flavours of javascript)


Which is the (best) solution regarding Transformation files and assign single values based on a range values? Can I use Javascript If Stement?


Thanks you for your time

Regards

Jacues

View Entire Topic
gautam_poddar2
Participant
0 Kudos

Hi Jacues/ Vadim

We are facing the same issue. Request you to please share the final script that worked for you


The Requirement is that if the Amount is less than zero then it should insert N_ before the Account and give the value as N_AccountID otherwise it should insert P_ and give the value as P_AccountID

I was trying with the folloing Script

ACCOUNT=*IF(ZZAMNT(1:1) = *Str(less than 0) then *Str(N_)+ /CPMB/FQD03K7 ; *Str(P_)+/CPMB/FQD03K7)

Thanks in advance  for your guidance

Regards

Riddhima

former_member186338
Active Contributor
0 Kudos

Topic is about different thing - conversion file using Java Script. Not sure that it's possible to implement your requirements...

Vadim

Former Member
0 Kudos

Hi Riddhima,

Here is the final script:

Transformation File:

  

P_FLOW=*COL(4,1:2)

*CONVERSION
P_FLOW=FinQube.xls!CONVERSION

Conversion File:

   

EXTERNALINTERNAL
*js:((parseInt(%external%) < 50) ? "P99" : "F_NONE" )

Regards

Jacques