on 2022 Aug 10 7:04 PM
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://www.w3schools.com/js/js_math.asp
Thank You,
Request clarification before answering.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
6 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.