on 11-16-2015 2:21 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
Hi Vadim,
Thanks for your help
I have two issues :
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
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
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
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
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
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
Hi Gresh,
Iwill Test and come back to you
Hi Vadim,
Just one more info , I am running in the same APPLICATION
*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
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
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
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)
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
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.
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
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
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
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
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
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.
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
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
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
14 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.