cancel
Showing results for 
Search instead for 
Did you mean: 

Parallelization for Script/Custom Logic

Former Member
0 Kudos

Hi experts,

We have accessed "How to Enable Parallelization for Data Manager Packages and Consolidations" document but there is no indication of Paralleization for Default Formulas package.

Do we have any method to split custom logic into paralel processes?


Thanks in advance,

Ergin Ozturk

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

Hi Ergin,

What do you exactly mean by "Paralleization for Default Formulas package"? Default.lgf?


Vadim

Former Member
0 Kudos

Hi Vadim,

You may also think default.lgf but my question was for the package below..

If you have the how to document related part tells that:

Data Manager Packages

Before you start customizing all of the process chains, you need to know which process chains can take advantage parallelization. The process chains that can take advantage of parallelization are:

  Data Loading

o  /CPMB/LOAD_INFOPROV_UI

o  /CPMB/LOAD_INFOPROVIDER

  Additional Process Chains

o  /CPMB/IMPORT_A_SEND_EMAIL

o  /CPMB/COPY

o  /CPMB/IMPORT_USING_FTP

o  /CPMB/IMPORT_APPEND

o  /CPMB/APPEND

o  /CPMB/IMPORT

o  /CPMB/MOVE will partially benefit from parallelization

former_member186338
Active Contributor
0 Kudos

Hi Ergin,

Ok, I understand that you are talking about script logic scripts execution. To my mind the script execution will not have any benefit from parallelization settings. The traditional approach to have parallelization for script execution is to use RUNLOGIC_PH (look in How-To).


B.R. Vadim

Former Member
0 Kudos

Hi Vadim,

We have problems here.. We tried to implement a solution for a BADI getting parameters. I have investigated RUNLOGIC_PH solution but I guess it is not possible to pass parameters for STARTPERIOD,ENDPERIOD (which are inside *START_BADI/*END_BADI block).

I also investigated *XDIM_PACKAGEBY statement, but oss note below indicates that *START_BADI is not supported. So WHY can not we use parallelization for custom logics?

1586088 - Plan & Consol 10.0 for NetWeaver Documentation Addendum

Script Logic Keyword: *XDIM_PACKAGEBY

           *XDIM_PACKAGEBY defines the dimension for which to partition packages during script logic execution. Packages start in parallel mode for better performance.

           You can specify the server group using a parameter in IMG. Run transaction SPRO -> Business Planning and Consolidation -> Global setting -> 'PARALLEL_SERVER_GROUP'.

The following keywords do not support PACKAGEBY: *RUN_PROGRAM, *RUNALLOCATION, *CALL_CUSTOM_LOGIC, and *START_BADI

Thanks in advance,

Ergin Ozturk

former_member186338
Active Contributor
0 Kudos

Hi Ergin,

Wrong: "I guess it is not possible to pass parameters for STARTPERIOD,ENDPERIOD". The $$ variables will be automatically passed to the calling script using RUNLOGIC_PH.

Try to run your script using RUNLOGIC_PH like:

*START_BADI RUNLOGIC_PH

QUERY = OFF

WRITE = ON

LOGIC = ZBPB_ACUALREVENUE.LGF

DIMENSION VERSION=ACTUAL

DIMENSION ACC_REVENUE=PASS...

DIMENSION DATASOURCE=DIRECT, PRORATED

DIMENSION ENTITY=...

DIMENSION TIME=%TIME_SET% //Time scope defined by used

CHANGED=TIME //Launch separate script for each month

DEBUG = OFF

*END_BADI

ZBPB_ACUALREVENUE.LGF:

//The scope will be defined by RUNLOGIC_PH parameters

*START_BADI ZEN_FBFB_FLIGHTSCHEDULE

FLAG=ZREAD_ACTUAL_DATA

STARTPERIOD=$STARTPERIOD$

ENDPERIOD=$ENDPERIOD$

QUERY = ON

WRITE = ON

*END_BADI

B.R. Vadim

former_member186338
Active Contributor
0 Kudos

Ups, it looks like you want to call badi number of times for all months between $STARTPERIOD$ and $ENDPERIOD$?

If it's correct, then it's not possible to achieve the way I propose in my prev. post. You have to rewrite BADI to work with the current TIME scope, then provide the RUNLOGIC the set of months and then use CHANGED parameter.

Vadim

Former Member
0 Kudos

Dear Vadim,

Thanks for your effort but there has to be a shortcut this means I will write so many new script logics and change all data manager pacakages as you can guess..

Does anyone know any better idea or miracle parameter ?

Thanks in advance,

Ergin

former_member186338
Active Contributor
0 Kudos

Hi Ergin,

No magic, your badi simply doesn't support parallelization! The badi code I assume first will calculate periods members between STARTPERIOD and ENDPERIOD and then will do calculations for the mentioned periods. In theory you can try to run this badi with the same month for STARTPERIOD and ENDPERIOD:

ZBPB_ACUALREVENUE.LGF:

//The scope will be defined by RUNLOGIC_PH parameters

*START_BADI ZEN_FBFB_FLIGHTSCHEDULE

FLAG=ZREAD_ACTUAL_DATA

STARTPERIOD=%TIME_SET% //single month

ENDPERIOD=%TIME_SET% //single month

QUERY = ON

WRITE = ON

*END_BADI

B.R. Vadim

Former Member
0 Kudos

Hi Ergin,

There is no way to let *START_BADI run in parallelize mode.

The reason is the script logic is an explain-execution language not a compile-execution language. In another word, we execute the K2 script line by line. Once we reach *END_BADI line, K2 will start to execute the BADI. The parallelization framework implemented in K2 is very simple and for very limited statements, e.g. *WHEN-ENDWHEN, *REC. There is no implementation for *START_BADI.

Another reason is that the BADI is out of our control, so does to *RUN_PROGRAM, *RUN_CUSTOM_LOGIC. It is the customer’s responsibility to make the process parallelized inside the BADI scope. K2 is responsible for the data correctness, accuracy and consistence. If we delegate the parallelization process to be customizable, we cannot guarantee the data correctness, accuracy and consistence.


So I am afraid you have to find a way to implement the parallelization by your own.


Best Regards,

Yanlin

former_member186338
Active Contributor
0 Kudos

Hi Yanlin,


For sure it's not possible to automatically enable parallel processing for some badi. But if the badi is working on some scope then it's possible using RUNLOGIC_PH badi to split the scope by some dimension members and launch number of scripts in parallel having calculation badi in each script.


B.R. Vadim