cancel
Showing results for 
Search instead for 
Did you mean: 

Can we write 1 BADI to run all script logic, or need 1 badi for each script calculation

Former Member
0 Kudos

Below is the sample script file. I need to develop new BADI for this.

1. Can we write everything in1 BADI or need 2 BADIs for clearing records and CALC_ACCOUNT. 

2. How to pass CALC = CONSOL_PL in BADI parameters while using RUN_LOGIC_PH?

//Clear YTD data in Finance

*XDIM_MEMBERSET CATEGORY=FORECAST

*XDIM_ADDMEMBERSET CATEGORY=%CATEGORY_SET%

*XDIM_MEMBERSET TIME=%PYCYMTH%,%PYFUMTH%

*XDIM_MEMBERSET ACCOUNT=%TPLACNTLST%,%TBSACNTLST%,29100300

*XDIM_MEMBERSET FLOW=F999

*XDIM_MEMBERSET RPTCURRENCY=LC

*XDIM_MEMBERSET DATASRC=CONSOL_MOVE

*XDIM_MEMBERSET ANALYTIC=EXISTING

*WHEN FLOW

*IS F999

     *REC(EXPRESSION=0)

*ENDWHEN

*COMMIT

//Convert PL Periodic to YTD

*RUN_PROGRAM CALC_ACCOUNT

CATEGORY = FORECAST

CURRENCY = LC

TID_RA = %PYCYMTH%

CALC=CONSOL_PL

OTHER = [ENTITY=%ENTITY_SET%]

// or OTHER=[ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]

*ENDRUN_PROGRAM

*COMMIT

*RUN_PROGRAM CALC_ACCOUNT

CATEGORY = %CATEGORY_SET%

CURRENCY = LC

TID_RA = %PYFUMTH%

CALC=CONSOL_PL

OTHER = [ENTITY=%ENTITY_SET%]

// or OTHER=[ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]

*ENDRUN_PROGRAM

*COMMIT

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member200327
Active Contributor
0 Kudos

You mentioned RUN_LOGIC_PH  in your posting. Do you wan to convert your script logic into a BADI (requires ABAP knowledge) or you want to use BADI RUNLOGIC_PH to speed your script up by parallel execution (doesn't require any ABAP)?

Former Member
0 Kudos

I need to convert script logic into a BADI. I have experience in ABAP but new to BPC. Not sure after converting in BADI, it will improve the performance?

It will be good if you provide any sample code / logic for 1 or 2 steps.

former_member186338
Active Contributor
0 Kudos

If you have experience in ABAP then search for custom logic badi samples... You will find a lot.

And in 99,9% of cases you will have a significant performance improvement.

Vadim

Former Member
0 Kudos

Thanks for your quick reply.

I will try and update the results.

Thanks

Partha

Former Member
0 Kudos

Hi Vadim,

Sorry to disturb you again.

Is it possible to convert the below logic in BADI. or is there any way to improve the performance for below logic.

//Convert PL Periodic to YTD

*RUN_PROGRAM CALC_ACCOUNT

CATEGORY = FORECAST

CURRENCY = LC

TID_RA = %PYCYMTH%

CALC=CONSOL_PL

OTHER = [ENTITY=%ENTITY_SET%]

// or OTHER=[ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]

*ENDRUN_PROGRAM

*COMMIT

*RUN_PROGRAM CALC_ACCOUNT

CATEGORY = %CATEGORY_SET%

CURRENCY = LC

TID_RA = %PYFUMTH%

CALC=CONSOL_PL

OTHER = [ENTITY=%ENTITY_SET%]

// or OTHER=[ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]

*ENDRUN_PROGRAM

*COMMIT

//Create Forecast YTD movements

*RUN_PROGRAM CALC_ACCOUNT

CATEGORY =FORECAST

CURRENCY = LC

TID_RA = %PYCYMTH%

CALC=CONSOL_BS

OTHER = [ENTITY=%ENTITY_SET%;COSTCENTER=CC_NONE;P_PROFITCENTER=P_PC_NONE]

// or OTHER=[ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]

*ENDRUN_PROGRAM

*COMMIT

Thanks

Parrthaa

former_member186338
Active Contributor
0 Kudos

Hi Parrthaa,

You have to read BPC help documents or spend some efforts on BPC training...

You have to understand what "*RUN_PROGRAM CALC_ACCOUNT" is doing!

Vadim

former_member223749
Active Participant
0 Kudos

Hi,

You can write everything in1 BADI no need for 2 BADIs for clearing records and CALC_ACCOUNT. 

ABAPer with BADI knowledge will help you to write BADI.

Hope this will help you.

Regards,

Devi

Former Member
0 Kudos

Hi Parthasarathy,

It is possible to combine multiple script logics into one BADI.

You can clear first then do the calculation in the BADI.

You will get HUGE performance improvements by converting script logics into BADIs.

Andy

former_member186338
Active Contributor
0 Kudos

Hi,

Can you forget about badi's for a second and simply explain what you want to achieve in terms of business logic!

Vadim

Former Member
0 Kudos

Hi Vadim,

Thanks for your quick response. We are using 24 steps in Script logic. It is taking lot of time. SAP suggested to use BADI to replace script logic.

My question is how to convert all script logic into one/multiple BADIs. How it will improve the performance. Attach Script Logic for your reference.

Thanks & Regards

Partha

former_member186338
Active Contributor
0 Kudos

Hi Partha,

There is no automatic script logic to badi conversion. You have to start with business logic! Then you have to write appropriate ABAP code... (by experienced ABAP developer).

Vadim

P.S. Not sure that you can't improve performance of your script code. But you have to play with it yourself.