Skip to Content
0

Run multiple logics simultaneously

Apr 18, 2017 at 12:08 PM

49

avatar image
Former Member

Hi all,

I want to run 3 different script logics in parallel. Then if they are succeeded I want to run 1 more script logic. Like a BW process chain. Actually I created a BW process chain calling those logics but although the steps are arranged to run in parallel , they are waiting for each other to be completed.see the picture please .

ZBPC_LOGIC1 is not running unless ZBPC_LOGIC2 is completed.Although they are arrenged as parallel steps.

Is there a parameter to allow them to run at the same time. Actually I searched for runlogic_ph keyword but as far as I see it is running the same logic for different scopes at the same time.But my requierement is to run different logics at the same time.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Vadim Kalinin Apr 18, 2017 at 02:07 PM
0

Proposal:

1. Implement RUNLOGIC_PH badi

2. In dimension SOURCE_CUBE create some property like PROPID

3. For ID=SALES_REV_COST set PROPID=SALES_REV_COST; ID=OPEX set PROPID=OPEX

4. Run Initial script with RUNLOGIC_BH badi with:

...
DIMENSION SOURCE_CUBE=SALES_REV_COST,OPEX
CHANGED SOURCE_CUBE
...

5. In the calling script use something like:

*SELECT(%ACTIVE_VERSION%,"[ID]",VERSION,"[ACTIVE_BUDGET]='A'")
*SELECT(%SALES%,ID,SOURCE_CUBE,ID=%SOURCE_CUBE_SET% and PROPID=SALES_REV_COST)
*SELECT(%OPEX%,ID,SOURCE_CUBE,ID=%SOURCE_CUBE_SET% and PROPID=OPEX)

*FOR %S%=%SALES% //if member is SALES_REV_COST
*XDIM_MEMBERSET LEDGER = STATUTORY,DUMMY_LEDGER
*XDIM_MEMBERSET VERSION=%ACTIVE_VERSION%
*XDIM_MEMBERSET SOURCE_CUBE = SALES_REV_COST
*START_BADI ZTELECOM_FIN_TABLE_04
READ=ON
WRITE=ON
*END_BADI
*NEXT


*FOR %O%=%OPEX% //if member is OPEX
*XDIM_MEMBERSET LEDGER = STATUTORY,DUMMY_LEDGER
*XDIM_MEMBERSET VERSION=%ACTIVE_VERSION%
*XDIM_MEMBERSET SOURCE_CUBE = OPEX
*START_BADI ZTELECOM_FIN_TABLE_02
READ=ON
WRITE=ON
*END_BADI
*NEXT

Will run in parallel!

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Explanation

RUNLOGIC_PH will run 2 copies of the same script in parallel.

First copy will get %SOURCE_CUBE_SET%=SALES_REV_COST and the first FOR/NEXT loop will be executed once. The second FOR/NEXT loop will be empty due to %OPEX%=empty

Second copy will get %SOURCE_CUBE_SET%=OPEX and the second FOR/NEXT loop will be executed once. The first FOR/NEXT loop will be empty due to %SALES%=empty

In the main script after RUNLOGIC_PH call you can execute code of the third script and it will run after parallel execution finished.

1
Former Member

Seems like a very good idea.I will let you know after it works.Thank you

0

It has to work! Why not???

First test some simple script without badi to ensure that all required settings for parallel run are configured properly!

0
Vadim Kalinin Apr 18, 2017 at 12:24 PM
0

"run different logics at the same time" - are you sure that the scopes of different logics do not overlap each other?

Can you show the scripts?

P.S Also the chain looks strange...

Show 7 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Vadim,

The scope and the target of the logics are totally different.They are calling different badi's with different data target and scope.The chain is yes very strange.It is actually a global chain calling two different local chains at the same time.And those local chains calls different script logics which are calling abap badis.Actually I know that those layers were not necessary, I was just trying.

The method is not important ,maybe you can suggest something totally different, my requierement is "how do I run 2 script logics at the same time" satisfying the fact that their scopes are different and appended data targets are not intersecting(otherwise I might get concurrency lock error )

0

Please show scripts calling badi's with scopes clearly mentioned... I have some idea

0
Former Member

Hi Vadim,

I am sending the logic below.But I actually want to divide this logic into 2 different logic and run FIN_TABLE_04 and FIN_TABLE_02 in parallel with those scopes.Note that fin_table_04 appends records with source_cube = SALES_REV_COST and fin_Table_02 appends records with source_cube OPEX.So there is no chance for concurrency error and both the scopes and data targets are not intersecting thanks to dimension "source_cube".

*SELECT(%ACTIVE_VERSION%,"[ID]",VERSION,"[ACTIVE_BUDGET]='A'")

*XDIM_MEMBERSET LEDGER = STATUTORY,DUMMY_LEDGER
*XDIM_MEMBERSET VERSION=%ACTIVE_VERSION%

*XDIM_MEMBERSET SOURCE_CUBE = SALES_REV_COST
*CALL_CUSTOM_LOGIC ZTELECOM_FIN_TABLE_04 // Sales Rev COST

*XDIM_MEMBERSET LEDGER = STATUTORY,DUMMY_LEDGER
*XDIM_MEMBERSET VERSION=%ACTIVE_VERSION%

*XDIM_MEMBERSET SOURCE_CUBE = OPEX
*CALL_CUSTOM_LOGIC ZTELECOM_FIN_TABLE_02 //OPEX

0

Sorry, but what do you mean by this line:

*CALL_CUSTOM_LOGIC ZTELECOM_FIN_TABLE_04 // Sales Rev COST???

0
Former Member
Vadim Kalinin

Hi Vadim,

It is an abap badi with filter name "ZTELECOM_FIN_TABLE_04" with some complex calculations. I am calling this badi and then

after it is finished, another badi (ZTELECOM_FIN_TABLE_02 ) is run .

However, actually I don't want to run them in sequence, I want to run them at the same time with a single button in the input form.

0

*CALL_CUSTOM_LOGIC - is it a function name??

Can you show your real badi launch code? Functions make code unreadable!

0

And the difference in scope is the member of dimension SOURCE_CUBE:

SALES_REV_COST

or

OPEX

0
avatar image
Former Member Apr 18, 2017 at 01:45 PM
0

Hi Vadim,

The code in the badis are too long and complex if you want to analyze the code, I can send.Actually it is the very natural way of calling an abap badi in a script logic.which is the equivalent of start badi-end badi syntax. I am writing with that syntax below.

For your second comment,yes you are right. badi 1 and badi 2 which are desired to be run in parallel are differentiated with the dimension source cube.badi 1 is reading the members SALES_REV_COST and badi 2 reads the members OPEX.So scopes are not intersecting.So the data appended are...

*SELECT(%ACTIVE_VERSION%,"[ID]",VERSION,"[ACTIVE_BUDGET]='A'")

// Badi 1 starts :>>>>>>

*XDIM_MEMBERSET LEDGER = STATUTORY,DUMMY_LEDGER
*XDIM_MEMBERSET VERSION=%ACTIVE_VERSION%

*XDIM_MEMBERSET SOURCE_CUBE = SALES_REV_COST

*START_BADI ZTELECOM_FIN_TABLE_04

READ=ON

WRITE=ON

*END_BADI

// Badi 1 ends<<<<<<<<<<

//Badi 2 starts>>>>>>>>>

*XDIM_MEMBERSET LEDGER = STATUTORY,DUMMY_LEDGER
*XDIM_MEMBERSET VERSION=%ACTIVE_VERSION%

*XDIM_MEMBERSET SOURCE_CUBE = OPEX
*START_BADI ZTELECOM_FIN_TABLE_02 //OPEX

READ=ON

WRITE=ON

*END_BADI

//Badi 2 ends<<<<<<<

Share
10 |10000 characters needed characters left characters exceeded