cancel
Showing results for 
Search instead for 
Did you mean: 

BPC Conversion file

former_member221145
Participant
0 Kudos
894

Hi Experts,

I am trying to acheieve the below condition in BPC conversion file using Java Script.

When GL account starts with 1 and ends with 1 and Value < 0 then GL+"L" Else GL

js:%external%.Value<0 ? %external%.toString()+"L": %external%.toString()

I have also tried the below

I have followed the syntax from the below threads

https://answers.sap.com/questions/11917893/conversion-file-question.html

https://answers.sap.com/questions/11288651/jsscript-in-conversion-files-with-if-then-else-syn.html?s...

https://www.w3schools.com/js/js_math.asp

Thank You,

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Value system variable can be used only in FORMULA column - not your case!

The only solution is to write UJD_ROUTINE BADI

P.S.

"I want to update the master data" - slightly confusing! May be you mean that you want to change target account?

former_member221145
Participant
0 Kudos

Hi Vadim,

When the Asset account balance is less than 0 then I want to map the GL Account to a different account.

In my example 1???????1 is the account in my external. When balance for asset account I'd beginning with 1 and ending with 1 and the balance of such accounts is negative then map the GL to a different GL account.

Thanks,

Rohit

former_member186338
Active Contributor
0 Kudos

rohit.padala

That's what I assumed!

And you have a clear answer - write badi.

About 2 hours for ABAP developer. It's simple!

Old but useful document: https://cupdf.com/document/how-to-use-start-end-routine.html?page=1

Unable to find it on SAP site.

Answers (1)

Answers (1)

former_member221145
Participant
0 Kudos

Hi Nikhil,

Value is a system variable which can be used in the formula field of the conversion file. Based on the transaction data value less than 0 then I want to update the master data.

Simple example would be

External

1???????1

Internal

Formula

If(Value<0?ACCOUNT ID+"S" : ACCOUNT ID)

Thanks Rohit

N1kh1l
Active Contributor

Value can only be used in FORMULA column and that too only for simple mathematical operations on the incoming values. Your requirement is to look up the incoming transaction data and based on its value adjust the account master data. This will not work in JS or any other standard transformation and conversion feature. Only way is to use BADI (UJD_ROUTINE). Also you are not updating master data, you are just mappping it to a different GL account in case of -ve balances.

Nikhil