[ASK] Error in Script Logic Using WHEN
Hello guys.
Script logic :
*XDIM_MEMBERSET CATEGORY = %CGY_PLAN%, %CGY_FORECAST%
*XDIM_MEMBERSET ACCOUNT = <ALL>
*XDIM_MEMBERSET ENTITY = <ALL>
*XDIM_MEMBERSET TIME = %YEAR_TTL%
*XDIM_MEMBERSET VEHICLE = <ALL>
*XDIM_MEMBERSET BUDGET_ACT = <ALL>
*WHEN CATEGORY
*IS %CGY_PLAN% // Error
*WHEN TIME
*IS %YEAR_TTL%
*REC(CATEGORY = %CGY_FORECAST%, TIME = %YEAR_TTL%)
*ENDWHEN
*ENDWHEN
*COMMIT
When i validate, it is error for statement : *IS %CGY_PLAN%.
But if that statement i change into : *IS %YEAR_TTL%; it isn't error.
Why is this happen ? How to correct it ?
Thank you.
Hi,
You have 3 variables in your script - CGY_PLAN, CGY_FORECAST, and YEAR_TTL.
Are you passing the values to these variables through DM package?
Similar Messages
-
Script Logic using when Condition
Hi,
Im working on BPC 7.5 SP04 MS and I cant figure out how to make this logic work:
1. Cuenta members (account) with the ivaacred property, are multiplied by a certain value and stored in the account 13010A
*WHEN TIEMPO
*IS 2009.Jan, etc etc.....
*WHEN CUENTA.IVAACRED
*IS "Y"
*REC(EXPRESSION=%VALUE% * GET(METRICAS="IND.IVA"),CUENTA="13010A")
2. When the data values for the cuenta 13010A are <= 0, then multiply them by zero and post them in the same account, else leave them the same way.
*WHEN CUENTA
*IS 13010A
IS <= 0
*REC (EXPRESSION = %VALUE% * 0, CUENTA="13010A")
*ENDWHEN
Thanx in advance
VelázquezHi Karthik,
The hierarchy you understood is correct
OUTSOURCING (Parent)
s_outsourcing (Son)
O_Gastos (Son)
This is an example of our report, what we look for in our script...
We want the calc to be applied to the parent values, instead of doing the roll up.
Area= s_outsourcing
Income = 100,000
Costs = 0
EBITDA = 100,000
ISR (30%) = 30,000
Area= O_Gastos
Income = 0
Costs = -50,000
EBITDA = -50,000
ISR = 0
Outsourcing
Income = 100,000
Costs = -50,000
EBITDA = 50,000
ISR = 30,000 --> WRONG!!!
Correct answer = EBITDA * 30% = 15,000 -
Hello Experts,
Please provide your guidance for the following scenario.
I need to calculate the 'Accumulated Depreciation' for every month, based on the amounts in the 'AccumDep' and the 'Depreciation' accounts.
In other words, the value of the Accumulated Depreciation for the month of Feb should be equal to (Accumulated Depreciation in Jan + Depreciation in Jan), and so on.
To accomplish this, I have written the following script logic.
*WHEN ACCOUNT
*IS AccumDep, Depreciation
*FOR %MON% = 2009.FEB,2009.MAR,2009.APR
*REC(FACTOR=1, ACCOUNT=AccumDep, TIME=%MON%)
*NEXT
*ENDWHEN
*COMMIT
The above logic was validated without any 'syntax' errors. However, I do not see the desired results, as the Accumulated Depreciation is not getting updated every month. The amount from FEB appears for MAR & APR also.
Therefore, could you please review the above script and let me know if there are any 'logical' errors?
All your guidance is greatly appreciated. Thanks...Hi,
You are not getting the desired result because you are trying to aggregate the depreciation and the accumulated depreciation of the same month and post the result again in the same month. Lets say the code is working for 2009.MAR. You are trying to add the depreciation and accumulated depreciation of 2009.MAR. However, you still dont have the acc depreciation of 2009.MAR. You basically need to take the acc depreciation of the previous month.
You can try something like:
*WHEN ACCOUNT
*IS Depreciation
*FOR %MON% = 2009.FEB,2009.MAR,2009.APR
*REC(EXPRESSION = %VALUE% + ([ACCOUNT].[AccumDep],[TIME].Previous), ACCOUNT=AccumDep)
*NEXT
*ENDWHEN
*COMMIT
You can have a property called Previous to store the previous month of each period in the time dimension.
Hope you got the idea. -
Execute script logic using data manager
Hi all,
Could anyone explain me how to run a script logic using the data manager?
The only way I get it working is adding the script logic into the defaul.lgl file and running the default formulas package via data manager.
How can I run an specific script logic without using the default.lgf file?
Thanks and regards,
AnaHI Ana,
You will have to create a SSIS package that will run the logic for you. A good example of this is the ICELIM package that comes standard with AppShell. The easiest is way for me is to copy the package and renaming it to what you want to call it in the following folder: C:\BPC\Data\Webfolders\<AppSet>\<Application>\DataManager\PackageFiles\System Files
You will then have to organize the package list and add the package and modify the advanced properties of the package and point it to the correct logic file. I always use the lgf file rather than the lgx file, but it is up to you.
Lemme know if you need more info.
Regards,
Andries -
Hi Experts,
I have a problem with one of the FXTranslation logicu2019s in one of my report can u please help me on that.
The logic works fine for 2 reports out of 3, for the 3rd report I donu2019t know why itu2019s not doing the translation to USD. As far as the design of the report goes the 2 reports for which translation works fine comprises of 2 logics one for percentage allocation and other for translation from LC to USD, whereas the 3rd report needs only translation but doesnu2019t need the allocation logic to be run.
The conversion for the 3rd report happens if I comment out the allocation logic. Both these logics are mapped to Default.LGF file. I am unable to figure out what could be the error.
Below is the Script Logic for Aloocation and Translation:
//Budget Allocation
*SELECT(%CURR%,"[ID]","RPTCURRENCY","[CURRENCY_TYPE]='L' OR [CURRENCY_TYPE]='R'")
*XDIM_MEMBERSET RPTCURRENCY=%CURR%
*RUNALLOCATION
*FACTOR=USING/1
*DIM ACCOUNTB WHAT=[IS_ALLOC]='Y'; WHERE=<<<; USING=ALLOCPER
*DIM PRODUCTM WHAT=NOPRODUCT; WHERE<>NOPRODUCT; USING=<<<
*ENDALLOCATION
*COMMIT
// Currency Translation
*SELECT(%REPORTING_CURRENCIES%, "[ID]", "RPTCURRENCY", "[REPORTING] = 'Y'")
*SELECT(%FX_RATES%, "[ID]", "RATE", "[GROUP] = 'FX RATE'")
// Load the rates from the RATE cube
*LOOKUP RATE
*DIM CATEGORY="BUDGET"
*DIM RATEENTITY="GLOBAL"
*DIM RATE=ACCOUNTB.RATETYPE
*DIM SOURCECURR:INPUTCURRENCY=LEGALENTITY.CURRENCY
*FOR %CURR%=%REPORTING_CURRENCIES%
*DIM %CURR%:INPUTCURRENCY="%CURR%"
*NEXT
*ENDLOOKUP
// define the translation rule
*WHEN ACCOUNTB.RATETYPE
*IS "NOTRANS"
// skip
*IS %FX_RATES%
// translate
*FOR %CURR%=%REPORTING_CURRENCIES%
*REC(FACTOR=LOOKUP(%CURR%)/LOOKUP(SOURCECURR),RPTCURRENCY="%CURR%")
*NEXT
*IS "COPYLC"
// take as is
*FOR %CURR%=%REPORTING_CURRENCIES%
*REC(RPTCURRENCY="%CURR%")
*NEXT
*ENDWHEN
*COMMIT
// Default
// FX Translation
*include FXTranslation.lgf
// Budget Allocation
*include BudgetAllocation.lgfHi Naresh,
One thing that helped me solve the problem was I needed to use different set of Dimension members/property in the Logic i.e What, Where and Using to trigger off the Curency Translation.
But please make sure that you use try to understand a unique dimension (member/property) used and use that to trigger off the translation or anything for that matter. My other two translations were working fine as the parameters i used were unique for them whereas the remaining one needed alteration in the logic only in the parameters used in What, Where and Using, so had to add one more set of Translation Logic for this exclusively.
Another point you need to check in your Rate Application is whether you have your Reporting Currency as value 1, say for eg USD is your reporting currency then the value in Rate Application for USD must be 1, if u by mistake cleared of this value when using the Clear Data Manager Package so the multiplication with 0 results in no conversion.
These were the two points that helped me solve my issue. I hope it helps.
Rgds,
Rizwan
Edited by: Rizwan Mustaffa on Jul 13, 2009 12:09 PM -
Error during script logic processing from UJKT tcode
Hi,
When I try to execute the script logic through UJKT tcode, it gives me the following exception:
UJK_EXECUTION_EXCEPTION:Runtime error Duplicate recordMember (D_AUTO_UAE) of dimension (DIVISION) is not a valid member.
Following is the script logic:
*RUN_PROGRAM VALIDATION
CATEGORY = %CATEGORY_SET%
GROUP= %GROUPS_SET%
TID_RA = %TIME_SET%
*ENDRUN_PROGRAM
BAdi used is BADI_UJ_CUSTOM_LOGIC
Also the error log displays entire set of data records, instead I will like to see only the status of whether it went successful or not.
Where can I check this setting?
Please help.
Thanks and Regards,
PankajHi Pankaj,
I would request you to re-process the DIVISION deimension (preferrably all the dimensions). Then re-process and optimize the application. See, if you are getting any errors or not.
Hope this helps. -
Script Logic: Using a property in MDX *REC statement (BPC NW)
Hi,
Is it possible to use a Property in an MDX statement without using *LOOKUP() function? I have script successfully working but it takes 15 minutes to execute and would like to speed it up.
I understand that [DIMENSION].[MEMBER].Property is not valid syntax, and do not believe NW has any other functions to resolve the issue, except *LOOKUP which takes a long time.
Specific Example is below:
I have a piece of script that successfully splits JV Expense by customers. A Profit Share planning driver determines the percentage that each customer is entitled to. Typically this will be 100%, but could be 50% between two customers.
The PROFIT SHARE planning drivers records, and PARTNER_INCOME transactional records are below:
ACCOUNT
ENTITY
PARTNER
SIGNED DATA
PROFIT_SHARE
UK_001
PARTNER_A
0.5
PROFIT_SHARE
UK_001
PARTNER_B
0.5
PROFIT_SHARE
UK_002_PLANNING_DRIVERS
PARTNER_B
1.00
PARTNER_INCOME
UK_001
NO_PARTNER
$5,000
PARTNER_INCOME
UK_002
NO_PARTNER
$5,000
UK_001 has two partners that are each entitled to 50% of the $5,000 NET PROFIT.
For UK_002, one one single Partner is entitled to 100% of the $5,000 NET PROFIT.
Using script logic, you can scope the Profit Share account (PROFIT_SHARE) - , and use a *REC statement to multiply this by the driver. It would look like:
*XDIM_MEMBERSET ACCOUNT = PROFIT_SHARE
*WHEN ACCOUNT
IS *
*REC (EXPRESSION = %VALUE% * ([ACCOUNT].[PROFIT_SHARE],[PARTNER].[NO_PARTNER]), ACCOUNT = PARTNER_PROFIT_SHARE)
*ENDWHEN
This wouldn't be a problem if the Planning Driver is always stored on the same Entity that the Income is stored on, but for UK_002, the planning driver is stored on another Entity - which is stored in a the PLAN_DRIVER_REF property of the entity. It should use UK_002_PLAN_DRIVERS
ID (Entity)
PLAN_DRIVER_REF
UK_001
UK_002
UK_002_PLAN_DRIVERS
UK_002_PLANNING_DRIVERS
In this scenario, we need to switch out the Entity used in the MDX, however I do not believe you can use a property in MDX - can anyone confirm?
I have currently implemented the *LOOKUP functionality to loop through, changing each *LOOKUP partner for each loop.
Lookup:
*LOOKUP PLANNING_JV_US
*FOR %LOOP_ASLS% = %ASL_LOOKUP_LOOP_VARIABLE%
*DIM LOOK_%LOOP_PARTNERS%:ACCOUNT = "PROFIT_SHARE"
*DIM LOOK_%LOOP_PARTNERS%:PARTNER= %LOOP_PARTNERS%
*NEXT
*DIM ENTITY = ENTITY.PLAN_DRIVER_REF // Use PLAN_DRIVER_REF Property of Entity
*ENDLOOKUP
Scope and *REC:
*XDIM_MEMBERSET ACCOUNT = PROFIT_SHARE
*WHEN ACCOUNT
IS *
*FOR %LOOP_PARTNERS% = %PARTNER_LOOKUP_LOOP_VARIABLE% // 1000 Partners
*REC(EXPRESSION = %VALUE% * LOOKUP(LOOK_%LOOP_PARTNERS%), PARTNER= %LOOP_PARTNERS%, ACCOUNT = TCOJVSHAR_CALC, AUDIT_ID = PP_EXPENSE_BY_PARTNER)
*NEXT
*ENDWHEN
The problem with the above, is that because the Lookup is being generated for every single Partner, there are significant numbers of loops.
Does anyone know of another way this can be implemented in Script Logic? Otherwise we'll need to explore BAdI route.
Thanks,
NickHi Nick,
Use property in LOOKUP - will dramatically speed up the calculation without FOR/NEXT.
Vadim -
Hello friends,
I am getting an error with running currency conversion in an app, the error says Invalid dimension "C_Category". Here is the script logic, I dont see C_Category anywhere. For the record, the name of dimension is category.
*RUN_PROGRAM CURR_CONVERSION
CATEGORY = %C_CATEGORY_SET%
GROUP = %GROUPS_SET%
TID_RA = %TIME_SET%
RATEENTITY = GLOBAL
OTHER = [ENTITY=%ENTITY_SET%]//For More than one other scope parameters: OTHER = [ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]
*ENDRUN_PROGRAMHello,
Variable %C_CATEGORY_SET% means set of members selected for Dimension C_CATEGORY. So, if you want to use CATEGORY instead replace it with %CATEGORY_SET%, but if are running Consolidations I think you need C_CATEGORY Dimension.
Regards,
Gersh -
Hi
Pl. verify following code: I did not get any error but the result is not derived ,
*WHEN ACCOUNT
*IS "BS115"
*WHEN CATEGORY
*IS "Actual"
*WHEN TIME
*IS "2011.04"
*REC(FACTOR = 1, ACCOUNT = "BS114",CATEGORY = "Actual",TIME = "2011.05")
*ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT
I want to copy from BS115 april to BS114 MAY ACTUAL
pl. verify any mistake in the above code
rgds
srinathHi
My issue is resolved.
Actuall the problem is once saved data is not displaying (after running default script logic)
But some time times result is displaying immd. after save without refresh.
I refreshed & i got my result.
Thanks
Srinath -
How to create a script logic using two applications and some conditions?
Hi All,
I am using BPC 7.0 MS
I have two applications, one called RATE (Dimensions: Category, InputCurrency, Rate, RateEntity, Time) and one called GYP (Dimensions: Category, Entity, PL, Producto, RptCurrency, Time. In the GYP application for Revenues. I have the followings products:
Product code
1-808-912-433
3-208-345-542
11-869-789-946
13-456-786-890
I need to calculate a discount using the first digits to identify the product: 1, 3, 11 and 13, based on some percentages that are in the RATE application.
I have an element in the RATE application for each one of them.
DPC1
DPC3
DPC11
DPC13
What I am trying to do in the script logic is:
*XDIM_MEMBERSET PL=Revenues
*XDIM_MEMBERSET PRODUCTO=<ALL>
*XDIM_MEMBERSET ENTITY=<ALL>
*XDIM_MEMBERSET CATEGORY=Budget
*LOOKUP RATE
*DIM D1:RATE ="DPC1"
*DIM D11:RATE ="DPC11"
*DIM D3:RATE ="DPC3"
*DIM D13:RATE ="DPC13"
*DIM RATEENTITY="Global"
*DIM INPUTCURRENCY="VEB"
*ENDLOOKUP
*WHEN PL
*IS Revenues
*REC(FACTOR=LOOKUP(D1), PL=Discount)
*ENDWHEN
*COMMIT
In the WHEN area, i would like to create some condition to identify the product and assign the correct percentage to it but i don't know how to do it?
Do you have any suggestions?
Also, because i need to key the values in the RATE application for the discounts, the logic should be run from this application?
Using RUNLOGIC like this:
*RUNLOGIC
*APP GYP
*LOGIC Discounts
*ENDRUNLOGIC
Best regards,
LuisanaHi Nilanjan,
Thanks for your prompt reply.
The special characters ("-") cannot be used. The product codes use the special character ("_").
I understand what you said about the property for the dimension Product but not for the dimension Rate. I have the lookup that has the four elements (DPC1, DPC11, DPC3, DPC13). It is not supposed to get the data from those elements directly when using the lookup?
The script logic is still not working. I created the dimension property in the product dimension and the new script logic is as follows:
*XDIM_MEMBERSET PL=Revenues
*XDIM_MEMBERSET PRODUCT=<ALL>
*XDIM_MEMBERSET ENTITY=<ALL>
*XDIM_MEMBERSET CATEGORY=Budget
*LOOKUP RATE
*DIM D1:RATE ="DPC1"
*DIM D11:RATE ="DPC11"
*DIM D3:RATE ="DPC3"
*DIM D13:RATE ="DPC13"
*DIM RATEENTITY="Global"
*DIM INPUTCURRENCY="VEB"
*ENDLOOKUP
*WHEN PRODUCT.TYPE
*IS 1
*REC(FACTOR=LOOKUP(D1), PL=Discount)
*IS 11
*REC(FACTOR=LOOKUP(D11), PL=Discount)
*IS 3
*REC(FACTOR=LOOKUP(D3), PL=Discount)
*IS 13
*REC(FACTOR=LOOKUP(D13), PL=Discount)
*ENDWHEN
*COMMIT
Could you let me know what i am doing wrong?
The calculation i would like to get is: Discount = Revenues(GYP) X DPCx(RATE)
Also, when I sent the data from the rate application I get the message "ExecuteBaseLogic::invalid application:*APP GYP". I am using a RUNLOGIC in the application RATE with the following code:
*RUNLOGIC
*APP GYP
*LOGIC Decto_en_vtas_pilot
*ENDRUNLOGIC
Kind Regards,
Luisana -
Script logic using Dimension.Property
Hello, Gurus!
I have next problem with script logic:
Dimension Company
Company1
Company2...
Dimension Document
Document1
Document2...
Dimension Document has property PCompany, where there is Company ID.
I need to summation all data for Company=Company2 (for example).
How can I choose records from Dimension Document for PCompany=Company2 with BPC script logic?
Thanks!
Regards,
Svetlana.Hello Gersh!
Thank you very much. It's worked.
I should clarify the question
I have several company which I choose with property of Company (for example, INTERCOMP=Y)
So, I have :
*SELECT(%COMPANY%,ID,COMPANY,INTERCOMP=Y)
*WHEN Document.PCompany
*IS %COMPANY%
*ENDWHEN
This construction doesn't work.
Regards,
Svetlana. -
Hello,
I'm new to BPC, and so i'm having some problems in debugging this error.
When i do validation script of this code
*WHEN AMOUNTTYPE
*IS "1"
*REC (EXPRESSION= (%VALUE%)+200)
*ENDWHEN
*COMMIT
"i get the follow message Invalid End/endWhen"
I don't know what i'm doing wrong. Someone can help me.
Regards,
Gomes*WHEN ACCT_C.ID-- Dimention name is missing if you don't have xdim in the top.
*IS "1"
*REC(EXPRESSION= (%VALUE%)+200) -- Take out space after REC -- This will take out your when and end error. But new error will be shown because there is no dimention at the type.
*ENDWHEN
*COMMIT -
Hi All,
For the below code i am getting error.
any alternate way to resolve this issue.
*WHEN P_ACCT
*IS "EXTSALES", "ICSALES"
*REC(FACTOR=1.5,P_ACCT="UPSIDEFACTOR")
*ENDWHEN
*COMMIT
Error
LINE:3 multi-member specified for dimension "3" *IS
How to resolve this issue.
Regards,
Phanikumar.Phanikumar, what you are trying to do does not make sense.
The following will work ok because you are multiplying EXTSALES by 1.5 and storing this in UPSIDEFACTOR.
*WHEN P_ACCT
*IS "EXTSALES"
*REC(FACTOR=1.5,P_ACCT="UPSIDEFACTOR")
*ENDWHEN
*COMMIT
In your example, BPC does not know whether to multiply EXTSALES or ICSALES or the sum of both of these.
I hope this helps.
Sean -
Use BADI or LGF script logic? Which is good in performance
Hello,
I have a situation wherein a choice is to be made among the "BADI" or "script logic" having DESTINATION_APP which is along with WHEN clause.
Below is the code in which WHEN clause is used:
Code Starts****
XDIM_MEMBERSET CATEGORY=FC_CUR
*DESTINATION_APP=GROSSMARGIN
*SKIP_DIM =WEEK
*ADD_DIM PLAN_PARTNER = PP_NA, RPTCURRENCY = LC
*WHEN CATEGORY
*IS "FC_CUR"
*REC(EXPRESSION=%VALUE%)
*ENDWHEN
*****Code Ends****
The business requirement could be changing as we are at initial stage, wherein i may have to incorporate some data mapping logic which can also be handled through scripts instead of using BADI.
The major concern is if BADI would be most prefferable over script logic having WHEN clause to acheive the optimal performance considering large no. of records that needs to be written to the target APPLICATION
from the source application?
OR
The script with WHEN statement is fine if the data mapping is pretty simple and would not have much impact on performance compared to using of BADI even if the records to be moved is huge.If data mapping is simple you can opt for script logic . If requirement is complex then you can go for BADI . You can check this [How-to|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70187b3e-d5ce-2d10-d780-bb8b1a5b0bdc?QuickLink=index&overridelayout=true] 6 th page on performance considerations of BADI .
A well designed BADI implementation is faster than script logic -
Script logic folder empty!
Hello every body,
After installing Patch1 of BPC MS 7.5 SP04 I had a problem with script logic folder when expanding the Legal application in the Admin console. The folder is empty, no Logic found, even the Default.LGF!!!
When I try to create a new one through the "Create New Logic" link in the Action Pane, I get this error displayed:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\BPC\Data\Webfolders\<AppSet>\AdminApp\Legal(my application)'
When I tried to access this path I didn't find it, I found: 'C:\PC_MS\Data\Webfolders\<AppSet>\AdminApp\Legal' instead.
PS:I performed an update for the client with an Admin Account, after installing the patch.
Any help?
Thank you in advance.Hello,
Thank you nilanjan for your reply
We have resolved the issue.
The problem was that on the BPC server on OS level the folder E:\BPC was not shared and we have added the everyone group to have access to the folder and now all the users that are using the BPC client can see the content of the Script logic in BPC Admin.
The File Share Server was pointing to E:\BPC\Data but the folder BPC was not shared and we have added the group: Domain Users to access the network path. Now we can see all the files in the appset Production \ Application \Legal\ Script Logic . We can create a new Script logic with success.
Thank you.
Maybe you are looking for
-
Excise Invoice postings in J1IIN for Cess as Paper Cess
Dear All, Considering the aforsaid issue on priority. Issue is regarding the Export Sales Process. Pricing Procedure is not the same as normal exports. Here, in exports there is a component / duty which is termed as PAPER CESS (condition type JECP).
-
My 845PE Max2 MB gives me 3 IEEE 1394 connections on the board. I am using two of the three available connections for the S-Bracket on the rear (J1394_1 & J1394_2 and they operate OK) and trying to get J1394_3 connected to the front panel. I have an
-
How do I get back my lost contacts in E51
It was the first time I tried out connecting my Nokia E51 to the PC.I was loading the CD and without reading much started downloading the new firmware. There was a warning about contents being lost some how i was so excited had started saying ok to t
-
Just wondering if anyone is aware of any examples that demonstrate how to use the WWV_CRYPT package? I'm interested in insert, update and select statements. Alternatively, can anyone point me in the direction of other suitable encryption methods that
-
So I'm playing with stitching to allow images wider than my widest lens would take and to capture greater resolution for larger prints. I'm playing with stitchings for 8-20 images. I've been using File>Automate>Photomerge... I've played with the v