on 10-04-2017 8:22 PM
Hello Friends,
Env 10.1
We have a requirement to call a badi from script logic, but depending on the parameters we pass to the DM package the Time memberset get updated.
%TIME_PERIOD_ACTUAL% and %TIME_PERIOD_PLAN% get updated from the flags in the time dimension. Script calls a select statement to populate these variables.
This is one part of the script, we have multiple categories and with additional conditions
eg,
*when category
*is actual
*XDIM_MEMBERSET TIME = %TIME_PERIOD_ACTUAL%
*START_BADI XXXX
QUERY = ON
WRITE = ON
DESTINATION = %RPTCURRENCY_SET%
*END_BADI
*IS PLAN
*XDIM_MEMBERSET TIME = %TIME_PERIOD_PLAN%
*START_BADI XXXX
QUERY = ON
WRITE = ON
DESTINATION = %RPTCURRENCY_SET%
*END_BADI
*ENDWHEN
Question - This script does not validate, I am not sure if we can call a Badi from a *when *endwhen. The name of the badi is same for both the conditions, but I don't want to write outside of *endwhen, as the scoping of time dimension would go off.
If there is any other conditional operator which I can use, that would be great. I dont need any *rec statements in my current script
Thanks for your time
Ed.
A property to be created in CATEGORY dimension: IDPROP and filled with the member ID. Then:
*SELECT(%PL%,[ID],CATEGORY,ID=%CATEGORY_SET% AND IDPROP=PLAN)
Same for actual with variable %AC%:
*SELECT(%AC%,[ID],CATEGORY,ID=%CATEGORY_SET% AND IDPROP=ACTUAL)
Then you will scope:
*FOR %A%=%AC% // if actual was selected by user
*XDIM_MEMBERSET TIME = %TIME_PERIOD_ACTUAL%
*START_BADI...
*NEXT
*FOR %P%=%PL% // if plan was selected by user
*XDIM_MEMBERSET TIME = %TIME_PERIOD_PLAN%
*START_BADI...
*NEXT
P.S. Code corrected, property creation is required!
Full script:
*SELECT(%TIME_PERIOD_ACTUAL%,"[ID]",TIME,"ACTUAL_PERIOD = 'Y'")
*SELECT(%TIME_PERIOD_PLAN%,"[ID]",TIME,"PLAN_PERIOD = 'Y'")
*SELECT(%PL%,[ID],CATEGORY,ID=%CATEGORY_SET% AND IDPROP=PLAN)
*SELECT(%AC%,[ID],CATEGORY,ID=%CATEGORY_SET% AND IDPROP=ACTUAL)
*FOR %A%=%AC% // if actual was selected by user
*XDIM_MEMBERSET CATEGORY = ACTUAL
*XDIM_MEMBERSET TIME = %TIME_PERIOD_ACTUAL%
*START_BADI XXXXXXXX
QUERY = ON
WRITE = ON
DESTINATION = %RPTCURRENCY_SET%
*END_BADI
*NEXT
*FOR %P%=%PL% // if plan was selected by user
*XDIM_MEMBERSET CATEGORY = PLAN
*XDIM_MEMBERSET TIME = %TIME_PERIOD_PLAN%
*START_BADI XXXXXXXX
QUERY = ON
WRITE = ON
DESTINATION = %RPTCURRENCY_SET%
*END_BADI
*NEXT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
3 | |
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.