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

Rounding Problem and BADI for Rounding

former_member182305
Active Participant
0 Kudos
794

Hello Experts,

We have a requirement where we need to retract BPC data to ECC. The problem is that upto 7 decimal places are stored in BPC and when sending information to ECC it can't be store because just 2 decimals are accepted.

We implemented Write Back Badi to round with the code that Sivakiran shares in the next post: .

The problem is the performance and the filters. We  have for filters just DM. The problem with the DM is that we have other DM processes the the customer runs and some are affected by this BADI. My question in this case is, Is it possible to add Filters or do something to run the BADI when running specific DM?

Since we are on Testing phase, we deactivate the BADI to test the other DM processes and I am trying to Round the Data in the accounts using a tranformation file for the PostPrimary Badi. My tranformation file is

*OPTIONS
FORMAT = DELIMITED
HEADER = YES
DELIMITER = ,
AMOUNTDECIMALPOINT = .
SKIP = 0
SKIPIF =
VALIDATERECORDS=YES
CREDITPOSITIVE=YES
MAXREJECTCOUNT=
ROUNDAMOUNT=2 [This condition doesn't work]
*MAPPING
SIGNEDDATA=SIGNEDDATA
*CONVERSION
SIGNEDDATA=Round1.xls

My conversion data is the next:

EXTERNALINTERNALFORMULA
**Math.round(Value*100)/100

The tranformation file doesn't work either.

I haven't find the way to do the proper rounding according the requirements.

Could you give me an orientation?

Other way is the one in next post, but didn't understood, plus we perform a std script for currency conversion.

Is it possible to do the code *REC( EXPRESSION=Math.round(

for the next scirpt logic??

How can I include it?

*RUN_PROGRAM CURR_CONVERSION

CATEGORY=%CATEGORIA_SET%

CURRENCY=%MONEDA_SET%

TID_RA=%PERIODO_SET%

RATEENTITY=Global

ENTITY=%CECOS_SET%

*ENDRUN_PROGRAM

Could you help me??

Thanks in advance for the post.

Best regards.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear experts,

I have another question related to rounding. BPC saves data up to 7 places after the decimal point. Is there a BPC 10.0 NW parameter that could be changed in order to save up to 9 places after the decimal point or any other setting or solution to be implemented? Is this techniclaly possible to be done in BPC 10.0 NW.

Thank you kindly for the answers,

Ralitsa

former_member186338
Active Contributor
0 Kudos

7 places after decimal point is a limit!

By default it's 13 integer and 7 decimal, can be increased to 24 integer and 7 decimal...

Read note http://service.sap.com/sap/support/notes/1829297

Vadim

former_member186338
Active Contributor
0 Kudos

Hi Sebastian,

Can you clearly specify your real requirements?

"We have a requirement where we need to retract BPC data to ECC." - details????

If you want to perform rounding in write back badi only for some selected part of data you can use custom logic badi instead of write back - it will be called in the specific DM package script and will round some scope for example. Write back is useful for permanent rounding based on some account property.

The code *REC( EXPRESSION=Math.round(... will work only if you disable ABAP calculation engine in BPC 10 and it will affect the performance!

Vadim

former_member182305
Active Participant
0 Kudos

Hello Vadim,

We need to retract the Accounts balance in USD so the user be able to see Real vs Plan in report S_ALR_87013611 in ECC.

We have implemented the BADI PostPrimary wich is working fine, the issue is when doing currency conversion X currency to USD it has more than 2 decimals.

I was considering the next options:

1. Write Back BADI.  - (was already deployed, but we had issues with other DM, since we run a DM for currency conversion. )

2. Round BADI, ( Did not work for BPC 10)

3. The last I have been trying is INLINE ROUNDING. - With your comment I wonder does the performance is affected really bad with this option?

4. I think I will try also as you suggested the Custom Logic, as soon as I get a ABAP Resource to help me with the code :S.

Which option do you think will be the better 3 or 4??

Thanks again,

You have helped me a lot.

Regards.

Former Member
0 Kudos

Hi Sebastian,

Use retract BADI to send data to ECC, why would you use write back BADI for rounding?

You also mentioned deactivate BADI to test other DM, there are so many BADIs in BPC , you need to be clear what you mean.

You can handle the rounding in the retract BADI, any ABAPer can do that.

Custom logic won't help you to resolve your issue.

Andy

former_member186338
Active Contributor
0 Kudos

2. Round BADI, ( Did not work for BPC 10) - incorrect, custom logic rounding badi works fine with 10. Just write it properly.

3. Test yourself - all scripts will be affected.

5. "You can handle the rounding in the retract BADI" by Andy!

Vadim

former_member182305
Active Participant
0 Kudos

Thank you for the suggestion it is a great idea. Unfortunately I don't have any ABAP resource assigned yet.

Meanwhile i was trying to perform INLINE rounding and it seems it is working I just need to make a little ajustment.

The code is as next:

*RUN_PROGRAM CURR_CONVERSION

CATEGORY=%CATEGORIA_SET%

CURRENCY=%MONEDA_SET%

TID_RA=%PERIODO_SET%

RATEENTITY=Global

ENTITY=%CECOS_SET%

*ENDRUN_PROGRAM

*WHEN MONEDA

*IS USD

*REC(EXPRESSION=(1*(%VALUE%).toFixed(2)))

*ENDWHEN

The only problem I have with this code is that it seems that i runs 3 time for some reason. And the Value I get is 3 times the value should be storing.

former_member186338
Active Contributor
0 Kudos

"The only problem I have with this code is that it seems that i runs 3 time for some reason. And the Value I get is 3 times the value should be storing." - impossible!

The issue with the code is that it's not scoped before *WHEN (*ENDRUN_PROGRAM - resets any scope)! First of all test the rounding code without CURR_CONVERSION in UJKT on a small number of records!

Vadim

P.S. By the way

ENTITY=%CECOS_SET% - incorrect, have to be OTHER = [CECOS=%CECOS_SET%]

Please read help Currency Conversion as Script Logic - SAP Business Planning and Consolidation, version for SAP NetWe...

former_member182305
Active Participant
0 Kudos

Thank you very much Vadim for the Answer,

I don't have a way to mark it as correct, this discussion i don't know why doesn't have the option. but the mistake was the

ENTITY=%CECOS_SET%


The correct statement was.


[CECOS=%CECOS_SET%]


That fixed the script logic.


Regards.