on 2019 Nov 20 4:20 AM
Hi,
I am looking for a way to round up currently by default is 7 decimal to 6 decimal.
Currently using below code but not successful as i am using ABAP calculation engine instead of JAVA calculation engine.
*XDIM_MEMBERSET CATEGORY = ACTUAL_DEC_YE
*XDIM_MEMBERSET R_ENTITY = GLOBAL
*XDIM_MEMBERSET MEASURES = PERIODIC
*XDIM_MEMBERSET R_ACCT = HYTD
*XDIM_MEMBERSET TIME = 2021.JAN
*WHEN R_ACCT
*IS "HYTD"
*REC(EXPRESSION=(1*(%VALUE%).toFixed(6)))
//*REC(EXPRESSION=Math.round(%VALUE%*100)/100) -> not possible due to ABAP calculation engine.
*ENDWHEN
*COMMIT
I got error produce by the LOG as below. Not sure what else should i do.
#dim_memberset=5
CATEGORY:ACTUAL_DEC_YE,1 in total.
R_ENTITY:GLOBAL,1 in total.
MEASURES:PERIODIC,1 in total.
R_ACCT:HYTD,1 in total.
TIME:2021.JAN,1 in total.
REC :(1*(%VALUE%).toFixed(6))
------------ ABAP Code Generation Error:4 -------------
MESSAGEGZGIncomplete arithmetic expression: ")" missing at end of statement.
Line12 WordCOMPUTE
-------- Code ---------
program.
class main definition.
public section. methods
METH1 importing
P1 type decfloat34
exporting RET type decfloat34
raising CX_SY_ZERODIVIDE.
endclass.
class main implementation.
method METH1.
"(1*(%VALUE%).toFixed(6))
RET = ( 1 * ( P1 ) .toFixed ( 6 ) ).
endmethod.
endclass.
-------- Input formulas ---------
(1*(%VALUE%).toFixed(6))
------------ ABAP Code Generation Error Ends ------------
UJK_VALIDATION_EXCEPTION:Incomplete arithmetic expression: ")" missing at end of statement.
Thanks in advance.
Request clarification before answering.
Hi Vadim,
Currently the BADI is rounding to 0 decimal. Was looking at any other alternative via script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are using ABAP calculation engine, then use write back badi and perform rounding in this badi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 6 | |
| 2 | |
| 2 | |
| 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.