cancel
Showing results for 
Search instead for 
Did you mean: 

CT_DATA is not splited with runlogic_ph BADI

former_member597393
Participant
0 Kudos

Dears,

we want to run BADI calculation in parallel  , in order that each record of CT_DATA  ( when calling the badi ) will run in separate DIA process.

to do so we used RUNLOGIC_PH badi .

in SM50  there is well 4 process running as defined .

but when debugging the BADI  we that all scope of the QUERY  from script logic is passed to CT_DATA.

this is my calling script  from DATA manager:

*XDIM_MEMBERSET ACCOUNT = PROCESS

*XDIM_MEMBERSET SCENARIOS = $SUBID$ // parameter passed from data manager

*XDIM_MEMBERSET P_ACT AS %SH% = BAS(P_ACT_ALL)

*SELECT(%S%,"[ID]",P_ACT,"[ID]=%SH% AND [ID]<>'PACT001'")

*XDIM_MEMBERSET P_ACT = %S%

*START_BAdI RUNLOGIC_PH

QUERY = ON

WRITE = ON

LOGIC = PROCESS_SCHEDULER.LGF

APPSET = APS

APP = PLANNING

VALIDATION=OFF

DIMENSION CATEGORY = BUDGET

CHANGED = ENTITY

DEBUG = OFF

*END_BAdI

**************

This is my called script , that call the badi

*START_BADI PROCESS_SCHEDULER

QUERY = ON

WRITE = ON

*END_BADI

********************

This is my CT_DATA  when I debug

I want that each process run for each member of ENTITY , means that CT_DATA get only one record and run the badi. , not all the scope.

Thanks

Mohamed

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member200327
Active Contributor
0 Kudos

Hi Mohamed,

I wonder how did you debug parallel processes? it's not so easy.

Also, QUERY = ON is wrong in START_BADI RUNLOGIC_PH. I'm afraid that that you looked at CT_DATA that this query brings. This will have all the data defined in the scope, but none of that data is used. That's why you have to put QUERY =OFF there.

Regards,

Gersh

former_member597393
Participant
0 Kudos

Hi Vadim, Gresh,

for debugging ,as I am running DM , I was able to set breakpoint in the beginning of the BADI PROCESS_SCHEDULER and see the content of CT_DATA

I tested with :

QUERY  = OFF // in the calling script

DIMENSION ENTITY = ENT001,ENT002,ENT003

CHANGED = ENTITY

2- in the called script I put

XDIM_MEMBERSET ENTITY =%ENTITY_SET%

I see that only one line is passed to the CT_DATA in my BADI process_scheduler. which is good.

I have now two issues :

1- I still have issue because I want to split on all ENTITY that I have in the scope of the calling script.

because for each scenario that the user run there is different ENTITY Members.

do I have to use ?

CHANGED = ENTITY ( ALL_ENT)

is in this case will pass to the called script only members in the scope of the called script and under the node (ALL_ENT).

2- I need to run all the scenarios with CATEGORY =BUDGET  , before I run with

CATEGORY = ( ALL_CATG)

do you I have to call the RUNLOGIC_PH second time with DIMENSION CATEGORY = ALL_CATG

BUDGET is not inside the node ALL_CATG

NOTE : I need this because I am calculating uplift inside badi ,

Thanks

Mohamed

former_member186338
Active Contributor
0 Kudos

First:

DIMENSION ENTITY = <ALL> //or BAS(ALL_ENT)

CHANGED = ENTITY

Second:

"I need to run all the scenarios with CATEGORY =BUDGET  , before I run with

CATEGORY = ( ALL_CATG)" - not clear...

But you may execute badi RUNLOGIC twice:

First with:

DIMENSION CATEGORY=BUDGET

Second with:

DIMENSION CATEGORY=BAS(ALL_CATG)

But the business logic is not clear

Vadim

former_member597393
Participant
0 Kudos

Hi Vadim,

Thanks for your help

I have two issues :

  1. when I use DIMENSION ENTITY = BAS(ALL_ENT) is taking more time than if hard code the entity members like DIMENSION ENTITY = ENT001,ENT002....
  2. when I run the RUNLOGIC twice with DIMENSION CATEGORY=BAS(ALL_CATEG) , is not taking the same scope as defined in the beginning of the first RUNLOGIC , is taking all scenarios with all category  , is like there is no query, in the second calling script I put

QUERY = OFF  and WRITE = ON

I put the scope again before the second calling scrip but is not working too

Please advise me .

Thanks

Mohamed

former_member186338
Active Contributor
0 Kudos

1. Not sure... have to be the same!

2. *END_BAdI - reset the scope!

And it's better to define scope of the called script with:

DIMENSION P_ACCOUNT= %S%

//same for other dimensions!

Vadim

P.S. Please provide the full script!!!!

former_member200327
Active Contributor
0 Kudos

Hi Mohamed,

1. BAS(...) does exactly what you do when you list Entities in that statement - RUNLOGIC_PH creates a list of entities. So, it can be only slower by the time it expands that list.

My understanding is that you can have a case when user selected not ALL_ENT but some other node. RUNLOGIC_PH can't have CHANGED on Dimension that is not scoped in the script and if user selected ALL in DM Package. If this is your case I'd suggest using

*XDIM_FILTER ... = (CALC=N) for such Dimension.

Regards,

Gersh

former_member597393
Participant
0 Kudos

Hi,

We have only one node that contain all the entities .

but the query ( scope ) in the beginning of the called script retrieve exactly the ENTITIE  used in all scenarios , because we set ACCOUNT = PROCESS  .

I need to use only those ENTITIES that I have in my scope

debugging the RUNLOGIC_PH , line 518 , checking the table that is filling IT_CV parameter ,I see there is no issue with ENTITIE  if use BAS(ALL_ENT)  , but I see that P_ACT  is using all base members and its should only one value, the one I selected in the scope of the query.

I need to use only  the P_ACT member  that is  stored  with ACCOUNT = PROCESS

for each entity member I can have one P_ACT , please the table below.

debugging CT_DATA  in my BADI , I see is coming with zero for the entities that are not in the scope

is my select query for P_ACT  is wrong ?

There is huge difference in performance it about 50% , if I had code ENTITIES 1 MIN  but if  I use BAS(ALL_ENT) is about 2 min

This is my scope

this what is passing to IT_CV in RUNLOGIC BADI

This is what I need to pass

Thanks

Mohamed

former_member186338
Active Contributor
0 Kudos

Have you read my message - how to define scope of the called script:

*START_BAdI RUNLOGIC_PH

...

DIMENSION P_ACCOUNT= %S%

...

*END_BAdI

As a RUNLOGIC badi parameter?

Vadim

former_member597393
Participant
0 Kudos

Hi Vadim,

for Account I have only one value PROCESS  , indicating that this scenario need to be processed.

for P_ACT  I already use it .

I am running only one called script with CATEGORY = BUDGET

I am checking now the difference on performance between the case I use BAS(ALL_ENT)  and when I hard code the entities.

don't understand what is %S%

Regards

Mohamed

former_member186338
Active Contributor
0 Kudos

Sorry, but %S% is your own code:

*SELECT(%S%,"[ID]",P_ACT,"[ID]=%SH% AND [ID]<>'PACT001'")

...

former_member186338
Active Contributor
0 Kudos

Show FULL script! Please!!!

former_member200327
Active Contributor
0 Kudos

Hi Mohamed,

In your scoping I don't see how do you derive P_ACT based on ACCOUNT = PROCESS. If you still have scoping like

*XDIM_MEMBERSET P_ACT AS %SH% = BAS(P_ACT_ALL)

*SELECT(%S%,"[ID]",P_ACT,"[ID]=%SH% AND [ID]<>'PACT001'")

*XDIM_MEMBERSET P_ACT = %S%

this will bring all P_ACT under P_ACT_ALL except PACT001. That's why I'm surprised to see PACT001 in your scope. Can you please show what log shows for for scoping of P_ACT?

Now regarding BAS(ALL_ENT) performance. Each of the processes shows start and end time. Do you see where the process slows down: some processes take longer or first process starts later or in some other place?

Thank you,

Gersh

former_member597393
Participant
0 Kudos

Hi Vadim,

I have issue with copy past in this forum.

this is my called script

former_member186338
Active Contributor
0 Kudos

I also have an issue to retype your code

P.S. And this is the calling, not called script...

former_member597393
Participant
0 Kudos

Hi Gresh,

for each ENTITY member I will have one P_ACT ,  my key is ACCOUNT = PROCESS  as I defined in the table above .

but I see in line 518 , IT_CV  is passing also the ENTITY members that are not defined in the scope , which lead to CT_DATA  to be passed to my BADI  with 0 record.

and because I have one 100 entities , if my query in the scope return 6 ENTITY  for example , the rest is executed also , but it calling my badi with CT_DATA = 0.

what I need to pass is one line :

This is what see right now .

Thanks

Mohamed

former_member597393
Participant
0 Kudos

Hi Vadim,

This is the called

former_member200327
Active Contributor
0 Kudos

Hi Mohamed,

If P_ACT depends on what ENTITY is being processed then you have to put

*XDIM_MEMBERSET P_ACT = ...

inside PROCESS_SCHEDULER.LGF.

Please let me know if this is not clear.

Regards,

Gersh

former_member186338
Active Contributor
0 Kudos

Hi Mohamed,

Looks like we are wasting time!

Please forget for a second about CT_DATA etc...

1. Show text of your main script with RUNLOGIC_PH.

2. Explain, what scope you need for each parallel process for all dimensions you have in the model.

Vadim

former_member200327
Active Contributor
0 Kudos

Also, please remove VALIDATION= OFF and change DEBUG to ON while solution is not finalized. After you'll get desired result then you can change them back.

-Gersh

former_member597393
Participant
0 Kudos

Hi Gresh,

Iwill Test and come back to you

Hi Vadim,

Just one more info , I am running in the same APPLICATION

  1. This is my RUNLOGIC  script :

*XDIM_MEMBERSET ACCOUNT = PROCESS

*XDIM_MEMBERSET SCENARIOS = $SUBID$ // parameter passed from data manager

*XDIM_MEMBERSET P_ACT AS %SH% = BAS(P_ACT_ALL)

*SELECT(%S%,"[ID]",P_ACT,"[ID]=%SH% AND [ID]<>'PACT001'")

*XDIM_MEMBERSET P_ACT = %S%

*START_BAdI RUNLOGIC_PH

QUERY = ON

WRITE = ON

LOGIC = PROCESS_SCHEDULER.LGF

APPSET = APS

APP = PLANNING

VALIDATION=OFF

DIMENSION ENTITY = BAS( ALL_ENT)

DIMENSION CATEGORY = BUDGET

CHANGED = ENTITY

DEBUG = OFF

*END_BAdI

   2.This the scope that I want to retieve before RUNLOGIC , in green the dimensions that they have the same values.

ENTITY members are unique per line , we cannot find for example ENT001 in other lines except the first line.

3. This is the scope that I want to pass to my calling script in order to execute each line ( each ENTITY) in one parallel process.

Thanks

Mohamed

former_member186338
Active Contributor
0 Kudos

Final:

1. Create in the ENTITY dimension property ACCT and fill it:

ID            Property - ACCT

ENT001   PACT001

ENT002   PACT002

2. Main script will be (without *XDIM_MEMBERSET's!):

*START_BAdI RUNLOGIC_PH

QUERY = OFF //!!!!

WRITE = ON

LOGIC = PROCESS_SCHEDULER.LGF

APPSET = APS

APP = PLANNING

VALIDATION=ON //!!!!

DIMENSION ENTITY = BAS(ALL_ENT)

DIMENSION CATEGORY = BUDGET

DIMENSION SCENARIOS = $SUBID$

DIMENSION P_ACT = <ALL>

DIMENSION ACCOUNT=PROCESS

CHANGED = ENTITY

DEBUG = ON //!!!

*END_BAdI

3. PROCESS_SCHEDULER.LGF will be:

*SELECT(%PA%,[ACCT],ENTITY,[ID]=%ENTITY_SET%)

*XDIM_MEMBERSET ENTITY=%ENTITY_SET%

*XDIM_MEMBERSET P_ACT=%PA%

*START_BADI PROCESS_SCHEDULER

QUERY = ON

WRITE = ON

*END_BADI

If you want to exclude ENT001 - then use some SELECT in the main script

Vadim

former_member597393
Participant
0 Kudos

Hi Vadim,

I cannot put the property on ENTITY , because for each scenario the user create ( Master data on request SN001 SN002...SN00X) , so the ENTITIES are dynamic with PACT dimension

for example in SN001 , I have this combination ,

SN001 ENT001 P_ACT3

and in scenario 2 , that an other user create :

SN002 ENT001 P_ACT4

The members in the SCENARIO dimension are created on demande , we used DM  to create this members from the EPM-Addin

when the user want to start a scenario , he create a new members , and there is list of asumption saved the write back badi.

before the final process , we get the data in our cube are stored as below with ACCOUT = PROCESS in order to identify the ENTITIES that need to be processed for the new scenario,

the we execute the DM  to run  the scenario for all ENTITIES.

Regards

Mohamed

former_member186338
Active Contributor
0 Kudos

Sorry, but how system will know what combination of ENTITY and P_ACT to use???

Absolutely unclear!

former_member597393
Participant
0 Kudos


if I do the query with ACCOUNT = PROCESS this is fix and SCENARIO as input from DM which is unique for each scenario , I am getting the table above , I need only to loop over the table ( over all ENTITIES  in other word ) then I will find the combination between ENTITY and P_ACT for each line.

This why I want to put ENTITY in CHANGED DIMENSION in order to loop over the table and pass only one line .

The calculation is working now is fast if I hard code ( just for testing, but in real case they are dynamic) the entities members in the CHANGED DIMENSION and normal if I use BAS(ALL_ENT)

former_member200327
Active Contributor
0 Kudos

Hi Mohamed,

How did you do it without RUNLOGIC? I don't think BPC script supports this kind of data processing.

-Gersh

former_member200327
Active Contributor
0 Kudos

Since relationship between ENTITY and P_ACT is artificially stored in Transaction data I'd suggest you find out which P_ACT you need in your BADI, call it with QUERY = OFF and read the cube inside your BADI.

-Gersh

former_member186338
Active Contributor
0 Kudos

I am lost

former_member597393
Participant
0 Kudos

Hi Gresh,

I run the DM , that call BADI with script , in the BADI I am getting my CT_DATA filled like the above table , then l loop over. inside the loop for each line I call FM to calc the logic.

*XDIM_MEMBERSET ACCOUNT = PROCESS

*XDIM_MEMBERSET SCENARIOS = $SUBID$ // parameter passed from data manager

*XDIM_MEMBERSET P_ACT AS %SH% = BAS(P_ACT_ALL)

*SELECT(%S%,"[ID]",P_ACT,"[ID]=%SH% AND [ID]<>'PACT001'")

*XDIM_MEMBERSET P_ACT = %S%

*START_BAdI PROCESS_SCHEDULER

QUERY = ON

WRITE = ON

*END_BAdI

Thanks

Mohamed

former_member200327
Active Contributor
0 Kudos

Are you saying that you call that script logic from a FM and pass $...$ and %...% as parameters?

Or I misunderstood something in your description?

-Gersh

former_member597393
Participant
0 Kudos

I am saying in normal case ( without RUNLOGIC ) that I run DATA MANAGER that call this script which in turn call the BADI PROCESS_SCHEDULER.

so the CT_DATA inside the badi is getting filled with the correct scope as define the beginning of the script , as example the table above.

next step I loop over CT_DATA in the BADI and for each line of table CT_DATA I call FM  .

I want to RUNLOGIC  to split each line and send it to my BADI.

former_member200327
Active Contributor
0 Kudos

Unfortunately you have too many tables above, so I'd assume you are referring to the one you've posted at 8:38 PM today.

If that is true, then you have all combinations of ENTITY and P_ACT in your BADI and establish that relationship between them inside the BADI. In that case the only option I can see is to call RUNLOGIC as a method from your BADI.

-Gersh

former_member597393
Participant
0 Kudos

Hi Gresh,

I have all the combination between dimension in the CT_DATA in my BADI.

in normal case ( without parallel ) I loop over CT_DATA and for each record I do the calculation fine.

could you clarify how I call RUNLOGIC as method inside the loop of CT_DATA execute each record in separate process.

I am not using the script  RUNLOGIC , I am calling my badi with script PROCESS_SCHEDULER

former_member200327
Active Contributor
0 Kudos

Hi Mohamed,

Just to clarify - I used RUNLOGIC as a nick name for RUNLOGIC_PH.

You can call RUNLOGIC_PH from your BADI by calling Method  IF_UJ_CUSTOM_LOGIC~EXECUTE of Class ZCL_BPC_RUNLOGIC_PH and passing all parameters of RUNLOGIC_PH in table IT_PARAM. But now I think this will be a more complex solution.

A better one would be to adjust you BADI PROCESS_SCHEDULER to process parameters from table IT_CV where you can find Scenario and Entity. Then BADI should get P_ACT and based on all this data retrieve data from the Model.

This way it will process one combination of Entity, Scenario and P_ACT in each parallel process.

Regards,

Gersh

former_member597393
Participant
0 Kudos

Hi,

I did some test and found that the runlogic is running for all ENTITIES in the IT_CV , so I want to pass only the ENTITIES that I an using to RUNLOGIC, for the rest of the entities that are not needed it does'nt do the calculation , but time wasted for the calls.

I have the ENTITIES  in the report displayed , so I want to pass those ENTITIES as parameters to the data manger that call runlogic, so I can limit my scope to only those I need.

I know also the start ENTITIES and the end and they are in  order always for any scenario.

so two options , either I pass only the required list ENTITIES  from the report to DM  , then to RUNLOGIC .

or when I reach the last ENTITIE for example ENT010 , I want to stop the execution from the script logic.

so I can add this to runlogic : *XDIM_MEMBERSET ENTITY = %ENTITY_SET%

but how I can pass the list from report to DM  as param then to the script. ?

Thanks

Mohamed

former_member186338
Active Contributor
0 Kudos

Please read:

former_member597393
Participant
0 Kudos

Hi Vadim,

I am using this concept in our solution , but I forgot it , thanks to rember me , I think this is what I need .

lets me test and come back to you.

Thanks

Mohamed

former_member597393
Participant
0 Kudos

Hi,

is working now , but we getting abap program error in st22 , cx_ujo_write_back , it because of concurrent write back to database , we are using hana 97

any advise.

Thanks

Mohamed

former_member186338
Active Contributor
0 Kudos

If you are writing simultaneously to the same intersections in parallel using your badi - no questions!

former_member597393
Participant
0 Kudos

could you please clarify more.

former_member186338
Active Contributor
0 Kudos

Sorry, without analysis of your badi code it's not possible to suggest...

former_member200327
Active Contributor
0 Kudos

Hi Mohamed,

Can you please post a screen shot of the Locking Conflict in RSPLSE?

Regards,

Gersh

former_member597393
Participant
0 Kudos

Hi Gresh,

I tried but unfortunately cannot send the conflict because it showing the data model.

Here is where I am getting this exception during the write back , some thing to do with queue of the server.

former_member200327
Active Contributor
0 Kudos

I'm not sure I understood why you can't send that screen shot. First thing I want to see there is if shows 2 user ID's on the top of the screen or just one?

If it shows only 1 ID then please apply recommendations explained at the end of OSS Note 928044.

If ti shows 2 IDs then I'd need to see members you are trying to lock.

Regards,

Gersh

former_member597393
Participant
0 Kudos

Hi Gresh,

There is only one user ID , I am checking the note .

if we change the table lock from local server  to SHARED OBJECT MEMORY OF SERVER  and we set the parameters for the wait time and others  , is there any impact on other environments ?

I also find document about parallel processing for DM , do I have to set the lock as outlined in this document.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0255ebe-8a1b-3110-de89-dd2b81b9c...

former_member200327
Active Contributor
0 Kudos

Hi Mohmaed,

You don't have to change the  server type - just wait time and number of attempts.

Yes, this will affect all environments in that box, but if they don't use parallel processing they are not going to feel it.

From that document you referred you have to use only RSPLSE setting. Document is mostly for BPC parallel framework, but you aren't using it. So, no need for other settings.

Regards,

Gersh

former_member597393
Participant
0 Kudos

Hi Gresh,

Changing the wait time to 3 second and the attemps to 9 , my lock issue is solved.

I am running now 25 scenarios in 88s means 3.52s per scenario.

I am using 9 parallel processes.

I am getting in the package :

TOTAL BADI EXECUTION : 33ms

TOTAL SCRIPT EXECUTION : 88s

what if an other user is running others scenarios at same time , is this increase the execution time ?

I need to get  1.5s per scenario , could you please help me if there is any parameters that we need to change in the server , because we have many axis , RSDRI queries and write back in side the badi.

Any best practice to push the code down to hana.

I am refering to this blog

Thanks

Mohamed

former_member200327
Active Contributor
0 Kudos

Hi Mohamed,

Since you counting seconds I'd suggest changing wait time to 1 sec.

Also, how many parallel processes do you run and how many Entities do you process?

Regards,

Gersh

former_member597393
Participant
0 Kudos

Hi Gresh,

I am calling the badi twice in the same RUNLOGIC_PH one with

DIMENSION CATEGORY = BUDGET

CHANGED = ENTITY  //25 entities

et the other with

DIMENSION CATEGORY = Actual

CHANGED = ENTITY //25 entities

Budget sould be finished before Actual to calculate the uplift.

so in one scenario I have 2 Category with 25 entities , in total I am doing 50 execution of the BADI.

I am using 9 Parallel process .

This is just sample test but the users can run 700 entities in one scenario , I can have many users running at same time.

for one case : 1 Entity +  CATEGORY (BUDGET ) = 3.52 / 2 = 1.76 second

for one case : 1 Entity +  CATEGORY (ACTUAL ) = 3.52 / 2 = 1.76 second

my target is to get : 1 Entity +  CATEGORY (ACTUAL or BUDGET) = 0.88 second

Regards

Mohamed

former_member200327
Active Contributor
0 Kudos

Hi Mohamed,

Can you try increasing number of parallel processes from 9 to 20 for example and see if it reduces the total time?

Also, now when your process is working you can set DEBUG =  OFF - this will save you around 1 sec per process.

When increasing number of parallel processes doesn't improve performance then you need to look for other ways to speed it up.

Regards,

Gersh

former_member597393
Participant
0 Kudos

Hi Gresh,

I Changed to 20 parallel process , but in DM , I see is using only 9

when I changed wait time to 1 second I see there is improvement in performance. Can I put it less than 1 second.

Thanks

Mohamed

former_member200327
Active Contributor
0 Kudos

Hi Mohamed,

Wait time can be a while number only.

Where did you change number of parallel processes? Try changing it at the Model level.

-Gersh

former_member186338
Active Contributor
0 Kudos

It's incorrect to talk here about CT_DATA, but ENTITY has to be split due to the line:

CHANGED = ENTITY

First- strange line in your code:

...

*XDIM_MEMBERSET P_ACT = %S%

*START_BAdI

QUERY = ON

...

May be *START_BAdI RUNLOGIC_PH?

And in your called script add the line in the beginning:

*XDIM_MEMBERSET=%ENTITY_SET%

Vadim

former_member597393
Participant
0 Kudos

Hi Vadim,

*START_BADI ,its copy past issue , I correct it in the main message .

so means that when the ENTITY  is spited , each line will be send as scope to the called script ,and the called script will send this line to the BADI.

or the calling script will send all the members of ENTITY  even the one that not in the query scope of RUNLOGIC_PH.

could you please clarify ?

Thanks

Mohamed

former_member186338
Active Contributor
0 Kudos

Have you tested:

"And in your called script add the line in the beginning:

*XDIM_MEMBERSET=%ENTITY_SET%"?

former_member186338
Active Contributor
0 Kudos

And add something like:

DIMENSION ENTITY = ENT001,ENT002,ENT003,ENT004

CHANGED = ENTITY

To the calling script

P.S. Please read about

DIMENSION dim_name = <ALL>

On page 10 of RUNLOGIC_PH How-To...