Debugging script logic

Hi.
Can we step by step debug execution of BPC script logic  watching action of each script command?

Hi,
To access the ABAP code from UJKT:
u2022     Enter the script logic in the lower left.
u2022     Validate.
u2022     Enter in dimension member restrictions.
u2022     Enter '/H' into the command field and press enter on your key board.
Hope this helps.

Similar Messages

  • How to debug script logic in NW?

    Hello,
    does anybody know how we can debug script logic in BPC NW? I wasn't able to find anything in the documentation. Without debuger or log the script logic is quite useless.
    Thanks for any advice
    Jan

    Hi Jan,
    I am not sure if there is some information on this in SDN but there are RKT materials (which are available in Service market place) detailing this.
    But in general, you need to setup a debug user and map it to bpc user using BPC server manager tool and then have a stop point in your ABAP program by logging into the NW system using debug user and run your logic using mapped BPC user.
    regards,
    Sreedhar

  • How to copy applications using script logic with conditions

    Hi,
    I have two copy data between application A to application B, but only i want to copy the March's Data of Application A. Dimensions are the same in both applications
    I'm going to use this script logic, ¿this script will work?
    *WHEN TIME
    *IS "2009.MAR"
    *DESTINATION_APP=B
    Thanks in advance
    Regards,
    Juan

    Hi all,
    Finally I solved the issue, the problem was that i haven't add this line in the script logic:
    TASK(Execute formulas,USER,%USER%)
    But now i need to pass in the script logic as an input: entity and time. Below is the code I prepare, it has no error but it doesn't work. ¿any idea?
    Thanks in advance
    Regards,
    Juan
    *SSIS PACKAGE *
    'DEBUG(ON)
    PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when running logic.",1,{"Yes, check for work status settings before running logic","No, do not check work status settings"},{"1","0"})
    PROMPT(SELECTINPUT,,,"Please select entity and time to copy data from LegalAppNceu to LegalApp",%ENTITY_DIM%%TIME_DIM%)
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,%APP%)
    TASK(Execute formulas,LOGICFILE,%APPPATH%..AdminApp%APP%CopyApplication.lgx)TASKTASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    TASK(Execute formulas,CHECKLCK,%CHEKCLCK%)
    SCRIPTLOGIC
    *DESTINATION_APP=LEGALAPP
    *SKIP_DIM= COSTCENTER
    *WHEN ENTITY
    *IS "%ENTITY_DIM%"
    *WHEN TIME_DIM
    *IS "%TIME_DIM%"
    *REC(FACTOR=1)
    *ENDWHEN
    *ENDWHEN
    *COMMIT

  • Problems when using RUNLOGIC Keyword in Script Logic

    Hello experts,
    I have a problem using RUNLOGIC keyword within Script logic. Both scripts are mentioned below.
    Following scenario:
    - combination of DESTINATION_APP and LOOKUP to multiply values from two source applications in order to to write results in target application
    - data volume in source application VALCHAIN are approx 187.000 records; source app SALES = 500 records
    - created data records in target application QUANTITIES are approx 204.000 records
    Running LOGIC01_QUANTITIES.LGF without "RUNLOGIC" keyword:
    - time to execute logic and write records: 10-12 minutes
    - created records 204.000
    Running LOGIC01_QUANTITIES.LGF via CALL_RUNLOGIC.LGF
    - script does not finish; system produces dumps
    - Tcode ST22 shows error messages called "TSV_TNEW_PAGE_ALLOC_FAILED" as well as "SYSTEM_NO_ROLL" as well as "CALL_FUNCTION_SEND_ERROR"
    Does anybody have a guess for that? Any answer appreciated.
    Thanks a lot!
    ==================================================
    CALL_RUNLOGIC.LGF
    *START_BADI RUNLOGIC
    QUERY=OFF
    WRITE=ON
    LOGIC=LOGIC01_QUANTITIES.LGF
    APPSET=FINPLAN_PERFORM
    APP=VALCHAIN
    CHANGED=PRODUCT
    DEBUG=OFF
    *END_BADI
    ===========================================
    LOGIC01_QUANTITIES.LGF
    *XDIM_MEMBERSET DATASRC=ITEMIZED
    *XDIM_MEMBERSET VERSION=%VERSION_SET%
    *XDIM_MEMBERSET TIME=%TIME_SET%
    *LOOKUP SALES
    *DIM DATASRC="OUTPUT"
    *DIM ITEM="IM_M02"
    *DIM QUANTU="QU_TO"
    *DIM MEASURES="PERIODIC"
    *FOR %LOOP_CENTER%=PC_1000,PC_2000,PC_3000,PC_4000,PC_5000,PC_6000
    *DIM C_%LOOP_CENTER%:PCENTER=%LOOP_CENTER%
    *NEXT
    *ENDLOOKUP
    *DESTINATION_APP=QUANTITIES
    *ADD_DIM COSELE=CE_NONE
    *WHEN PRODUCT.LG
    *IS "1"
      *WHEN MATERIAL
      *IS "MA_NONE"
        *FOR %LOOP_CENTER%=PC_1000,PC_2000,PC_3000,PC_4000,PC_5000,PC_6000
        REC(EXPRESSION=%VALUE%LOOKUP(C_%LOOP_CENTER%), PCENTER=%LOOP_CENTER%, ITEM="IM_M08", DATASRC="CALCULATED")
        *NEXT
      *ELSE
        *FOR %LOOP_CENTER%=PC_1000,PC_2000,PC_3000,PC_4000,PC_5000,PC_6000
        REC(EXPRESSION=%VALUE%LOOKUP(C_%LOOP_CENTER%), PCENTER=%LOOP_CENTER%, ITEM="IM_M05", DATASRC="CALCULATED")
        *NEXT
      *ENDWHEN
    *IS "1000"
      *WHEN MATERIAL
      *IS "MA_NONE"
        *FOR %LOOP_CENTER%=PC_1000,PC_2000,PC_3000,PC_4000,PC_5000,PC_6000
        REC(EXPRESSION=%VALUE%LOOKUP(C_%LOOP_CENTER%)/1000, PCENTER=%LOOP_CENTER%, ITEM="IM_M08", DATASRC="CALCULATED")
        *NEXT
      *ELSE
        *FOR %LOOP_CENTER%=PC_1000,PC_2000,PC_3000,PC_4000,PC_5000,PC_6000
        REC(EXPRESSION=%VALUE%LOOKUP(C_%LOOP_CENTER%)/1000, PCENTER=%LOOP_CENTER%, ITEM="IM_M05", DATASRC="CALCULATED")
        *NEXT
      *ENDWHEN
    *ENDWHEN
    *COMMIT

    Hello,
    This error comes up when there is no enough memory.
    How many members do you have in PRODUCT and how many parallel processes did you set up in PARALLELSCRIPT?
    Also, I'd suggest to put *XDIM_MEMBERSET PRODUCT = %PRODUCT_SET% in your LOGIC01_QUANTITIES.LGF script.
    Did you get anything in RUNLOGIC log? In UJFS you can find logs for every parallel process ran, name if it is just it's time stamp.
    Can you see from those what scripts ran and with what parameters?
    This should simplify resolution of your issue.
    Regards,
    Gersh

  • Complex Script logic

    Hello
    I have a comple script logic and I know there are some errors with it. How can I step through line by line / debug that logic to make sure / fix that issues ?
    Similarly how do I  step through line by line / debug logic in Script / Stroed Procedures / Transformation files / conversion Files etc..
    Thanks for your help
    BI

    Hi BI,
    hmm i guess there is no tools to debug line by line is SAP BPC.. guys is there any third party software that can do this??
    Thanks, hope helps

  • Incorrect value with Script Logic

    Hello,
    From initial value called 2008.ORC we want to calculate for each month the percentage , from child DIASMES.
    Now, with the script logic ( I´ll put down later) we have an incorrect value in the column 2008.TOTAL.
    In other words, I´m sure I´m wrong with "WHAT" or "WHERE sentence or maybe the operation "FACTOR=USING/TOTAL" fails because the crossing between dimensions it´s incorrect.
    *RUNALLOCATION
    *FACTOR = USING/TOTAL
    *DIM FABRICA_MAQ WHAT=BAS(FABRICAFF); WHERE=BAS(FABRICAFF); USING=BAS(FABRICAFF);
    *DIM PRODUTOS WHAT=BAS(TOTALPROD); WHERE=BAS(TOTALPROD); USING=SP;
    *DIM TIME WHAT=2008.ORC;WHERE=BAS(2008.TOTAL); USING=BAS(2008.TOTAL);
    *DIM TIPO WHAT=BAS(TOT); WHERE=BAS(TOT); USING=ST;
    *DIM VARIAVEIS WHAT=MIXACABADA; WHERE=MIXACABADA; USING=DIASMES;
    *DIM DATASRC WHAT=INPUT; WHERE=INPUT; USING=INPUT;
    *DIM VERSAO WHAT=BUDGET; WHERE=BUDGET; USING=BUDGET;
    *ENDALLOCATION
    *COMMIT
    The Key is to see in the column 2008.TOTAL ( when we selected  "BAS") the value of parent divided into "DIASMES" !
    Thanks !! 

    Your factor statment references a TOTAL, but you don't reference the total in your DIM statements. If you look at the debug log carefully, you should notice that there's no calculation of a TOTAL value.
    Try something like this. The only reason I move some dimensions from the *RUNALLOCATION up to the *XDIM's is for legibility, since the allocation makes no shifts to these dimensions. The logic should produce the same results, either way.
    // These dimensions have no shift of data.
    *XDIM_MEMBER VERSAO=BUDGET
    *XDIM_MEMBER DATASRC=INPUT
    // I'm assuming here that FACRICAFF is the top member of this dimension.
    *XDIM_MEMBERSET FABRICA_MAQ = <ALL>
    *RUNALLOCATION
    *FACTOR = USING/TOTAL
    *DIM PRODUTOS WHAT=BAS(TOTALPROD); WHERE=BAS(TOTALPROD); USING=SP; TOTAL=<<<
    *DIM TIME WHAT=2008.ORC;WHERE=BAS(2008.TOTAL); USING=BAS(2008.TOTAL); TOTAL=<<<
    *DIM TIPO WHAT=BAS(TOT); WHERE=BAS(TOT); USING=ST; TOTAL=<<<
    *DIM VARIAVEIS WHAT=MIXACABADA; WHERE=MIXACABADA; USING=DIASMES;  TOTAL=<<<
    *ENDALLOCATION
    *COMMIT

  • How can we debugging scripts and smartforms

    hi
    experts can u help me for this

    Hi,
    There are 2 separate kinds of debugging available when you try to debug scripts.
    1. Debugging the print program : This is the normal debugging we do for our report programs.
    2. Debugging the script itself : You Can debug a SAP Script by activating debugger in two ways:
    a .In SE71->Menu->Utilities->Activate Debugger, then debugger will be get activated and when your print program is executing Script Debugger will be in active and you can proceed with your debugging.
    b. Goto se38-> RSTXDBUG ->Execute this same as going thru in se71-> Menu, now debugger will be activated.
    refer to the link below
    http://www.howforge.com/how-to-debugging-sapscript-form
    Look at the BLOG here, it is well explained
    /people/sudheer.junnuthula2/blog/2007/01/09/script-debugging
    <b>DEBUG A SMARTFORM</b>
    In the Smartform, within the Code Node you can hardcode a normal abap Break Point ..
    Please set a break point in side the smartform:
    BREAK <USERNAME>.
    Then at the time of print/ preview the program stops there.
    Example : If you set the break point in initializationas
    BREAK <USERNAME>.
    Program stops at break point. After that use Serach and set more break points.
    >Search the program logic/Textelement/Address via search and set the break point at that code.
    Other way to debug smartform is to debug the Function Module of that smartforms. If you want to debug particular smartform node that the solution would be, insert a "Program Line" just above the node you want to debug and this program line write a normal abap breakpoint. So whenever you call the smartforms, it will stop at this breakpoint and you can debug onwards.
    or
    SFTRACE can be used for debugging SMARTFORMS.
    Read More here.
    http://help.sap.com/saphelp_erp2004/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    See the Below thread for how to debug the Smartforms
    How to Debug Smartform?
    Re: debug of smartfrom
    Smart forms
    Regards,
    Priyanka.

  • Probable Script Logic error

    Hi,
    I am trying to create a simple demo with the following business process:
    sales unit * sales price = total sales
    salesunit + inventory unit = produced unit
    produced unit * labor per unit = total hours
    for "sales unit x sales price = total sales", i have created a script logic called "sales.lgf" as follow:
    *xdim_memberset account = salesunit,salesprice
    *when account
    *is salesunit
      rec(account="totalsales",factor=-1(get(account="salesprice")))
    *endwhen
    *commit
    for "salesunit + inventory unit = produced unit", i am using dimension logic of salesunit + inventory unit in the formula column of produced unit
    for "produced unit x labor per unit = total hours", i have created another script logic called "production.lgf" as follow:
    *xdim_memberset account = producedunit,laborperunit
    *when account
    *is producedunit
      *rec(account="totalhrs",factor=(get(account="laborperunit")))
    *endwhen
    *commit
    in my default.lgf, i have *include sales and *include production
    The results are satisfactory for all of "totalsales" and "producedunit".
    But for "totalhrs", it appears as if some results are correct for some but wrong for the others.
    any idea on this?
    cheers

    Dimension formulas are evaluated in the cube, when you query that particular member on which you placed the formula. Aggregated members (parents) are pretty much the same story. (MSAS does some caching & pre-aggregation of things but don't get hung up on this; it's DB technical stuff.) The key point is, the result of a member formula isn't stored in the fact tables.
    The big performance gains come from minimizing the number of unnecessary commits -- not so much by minimizing the # of members in your xdim_memberset.
    In your first example, this still can be written in one commit. Think of the algebra in the second commit, and break down the components until you get to the source data that you have available before you start the calc.
    *xdim_memberset account = salesunit,salesprice,inventoryunit, laborperunit,laborcostperhour
    *when account
    *is salesprice
    *rec(account="totalsales",factor=-1*(get(account="salesunit")))
    *is salesunit, inventoryunit
    *rec(account="totalhrs",factor=-1*(get(account="laborperunit")))
    // not exactly intuitive, but it should work
    *rec(account="totallaborcost",factor=-1*(get(account="laborperunit")) * (get(account="laborcostperhr"))
    *endwhen
    *commit
    I wouldn't go through the effort of doing this when you first start writing SQL logic, because it makes it very hard to follow, and debug. If the logic takes 15 seconds to run with 2 commits, and it is legible, that's fine. Only if you find your logic takes 5 minutes or 30 minutes to run, then it's worth getting into this kind of optimization.
    It's also key to consider everything that you want to calculate in one batch, from start to finish. Sometimes by organizing things in certain orders, you can minimize the total number of commits, by expanding the source data region to include an extra 5% or 10 or 50% of records, beyond what you need in your calcs -- but this may be acceptable. The only real way to know is to test a few different approaches (on a reasonable set of production data, not dummy data in dev) and see which works better.

  • 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,
    Nick

    Hi Nick,
    Use property in LOOKUP - will dramatically speed up the calculation without FOR/NEXT.
    Vadim

  • How to auto-update of script logics after adding new dimension members?

    Hi Experts,
    Just wanna ask if BPC has a functionality that would automatically update/validate and save my script logic whenever I add new dimension members. I've added new PL accounts but they are not automatically added to my calculated BS Net Income. I had to re-validate and save my logic for it to be included in my logic and for the amounts to be computed correctly.
    Thanks,
    Marvin

    Hi Marvin,
    There is no functionality as such. we need to configure the script as and when we make any changes in the dimension members.
    Regards
    Raman

  • Use of LEFT in Script Logic

    I am having one doubt reagrding usage of excel function like LEFT, MID, RIGHT in script logic of SELECT Statement.
    Let me know with example if its possible.
    I tried the below statement:
    *SELECT(%EQACC%,"ID","ACCOUNT","LEFT(ID,6)='BE9001' AND CALC='N' AND ID<>'BE9001010'")
    But it throw the error as "invalid select statement"
    Anurodh

    Anurodh,
    what you are trying to do is not supported. As a workaround you can try to create a new property in the dimension (for example IDSHORT), putting in this filed just the first 6 characters of the ID and you can filter on it like in the following example:
    *SELECT(%EQACC%,"ID","P_ACCT","IDSHORT='CE0004' AND CALC='N'")
    Regards,
    Simmaco

  • Greater Than Function in Script Logic File

    BPC Experts,
    I've got a pretty simple script logic file to calculate salary amounts, overtime, etc.  The purpose of this logic is for forecasting.  I have two referenced dimensions, TIME and SCENARIO, where TIME.MONTHNUM is equal to its relative month number (eg: Jan monthnum = 1), and SCENARIO.CURRMONTH is equal to the relative amount of actual months data, (eg Jan currmonth = 0, Feb = 1) because if you are completing a February forecast, you have one month of actual.
    The ACTUAL scenario is never touched, but after a month closes, we copy the ACTUAL data to, for example, FEB_FCST.  So, after January closes, its actuals are copied to the FEB_FCST scenario so we can complete an actual/forecast (one month actual, 11 months forecast).
    Currently, the default logic skips anything in the ACTUAL scenario, by stating "*WHEN SCENARIO, *IS <> "ACTUAL" yada yada yada.
    However, when the default logic runs on the forecast scenarios, it takes the same inputs from the months that are copied over from the ACTUAL scenario and adds to the original amount, essentially doubling the value--ultimately causing an incorrect actuals number in the forecast scenario.
    My script right now looks like this:
    *XDIM_MEMBERSET DATASRC=INPUT
    *XDIM_MEMBERSET PRODUCT=NO_PRODUCT
    *XDIM_MEMBERSET SHIFT=NO_SHIFTS
    *XDIM_MEMBERSET MEASURES=PERIODIC
    *WHEN SCENARIO
    *IS <> "ACTUAL"
         *WHEN TIME.MONTHNUM
         *IS > SCENARIO.CURRENTMNTH
              *WHEN ACCOUNT
              *IS "SALARIED_MANPOWER"
                   *REC(EXPRESSION=((([ACCOUNT].[SALARIED_AVG_WAGE] * (1 + [ACCOUNT].[SALARY_TIMEAHALF]))* [ACCOUNT].[SALARIED_MANPOWER])),ACCOUNT="01100")
              *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    When it hits line 9 (*IS > SCENARIO.CURRENTMNTH) during validation, it errors.  How can I use a "greater than" function to dictate whether or not a given scenario should run default logic on a specific month?
    If not, is there a different/better way to do it?
    Thank you!
    ABF

    Hi Alex
    Take this sample logic, check the properties in your Time dimension to trouble shoot your issue.
    *SELECT(%CAT_VAR%, "ID", CATEGORY, ID= PLAN_APRIL)
    *XDIM_MEMBERSET CATEGORY = ACTUAL, PLAN, %CAT_VAR%
    *SELECT(%CATMTH%, "STARTMTH", CATEGORY, ID= %CAT_VAR%)
    *SELECT(%ACT_PERIOD%, "ID", TIME, MONTHNUM < %CATMTH% AND  LEVEL = MONTH AND YEAR = 2010)
    *SELECT(%PLAN_PERIOD%, "ID", TIME, MONTHNUM >= %CATMTH% AND LEVEL = MONTH AND YEAR = 2010)
    *XDIM_MEMBERSET TIME= %ACT_PERIOD%
    *XDIM_MEMBERSET CATEGORY=ACTUAL
    *WHEN CATEGORY
    *IS ACTUAL
    *REC(EXPRESSION=%VALUE%, CATEGORY = %CAT_VAR%)
    *ENDWHEN
    *XDIM_MEMBERSET TIME= %PLAN_PERIOD%
    *XDIM_MEMBERSET CATEGORY=PLAN
    *WHEN CATEGORY
    *IS PLAN
    *REC(EXPRESSION=%VALUE%, CATEGORY = %CAT_VAR%)
    *ENDWHEN
    Thanks

  • SQL functions in Script Logic

    I want to build a script logic but the dimensions that I am testing do not have the fields I want in the format I want. In my case I would like to test the "Start" property in the Employee dimension. The property represents the employee start date but is a var char in the format dd.mm.yyyy rather thna a date field. I want to test whether it is five years prior to the date being processed.
    My time dimension has a year property and a monthnum property. Each of these are varchar. I can write SQL that would convert these to a date and compare them with the start property on the employee dimension.
    Can I  do iinsert SQL functions in the When statement. An example would be
    *When convert(datetime, substring(employee.start,4,2) + '/' + substring(employee.start,1,2) + '/' + substring(employee.start,7,4))
    Can I use  SQL functions in the Is statement? An example would be
    *Is <DateAdd(YY,-5 , convert(datetime, Time.Monthnum + '/01/'' + time.year)
    Finally when I use such techniques and look at the log by using "show log" in the logic debugger I see no reference to the SQL I used. It is as if the generated SQL has not made use of my functions. Instead all I seee are the extract statements from the three fact tables. Is this normal? Is there a way to see what SQL is really being generated and run?
    At the moment it seems my only option is to make changes, try running it and hope I get an output. If no records are written I can't be sure whether it is because embedding SQL function is not supported or because I have made some other error.

    No, the "BPC SQL" script logic doesn't allow for this extensive use of real SQL within the scripting syntax. As a concept, it's best to think of "BPC SQL" script logic as, "this unique BPC logic syntax will generate real SQL code when it's executed."
    There's very little real SQL that you can use within the syntax itself, and definitely not within the WHEN or IF statements.  Nothing like cast, convert, substring, etc. (Except you CAN use these, a little bit, in a *SELECT statement. But I don't see how that will solve your current problem.)
    Plus, when you consider how the logic engine processes a set of data, it's helpful to think of it in terms of selects & reading through a recordset. So in that regard, a SQL background can be helpful, in understanding the concepts. (Sort of helpful, except when it confuses you, or frustrates you since you don't have all the power you want.)
    Anyway, to solve your problem, you might be able to restate the problem, and then use something like this code, which is valid syntax:
    *WHEN TIME.TIMEID
    *IS >= VERSION.FirstPlanMonthTimeID
    In this case, FirstPlanMonthTimeID is set up in the version dimension as, for example, 20090400 (representing 2009.APR). This timeID is set by BPC automatically when processing the time dimension, and I need to ensure that my Version property value is set to match it.
    A key point is that in BPC fact tables, the time dimension is stored as TIMEID (not ID, unlike all the other dimensions), and can be used for comparative evaluation in script logic WHEN/IF. The comparison property needs to be stored as an 8-digit integer value. If your time dimension has days in it (along with months), check the TIMEID after processing, and you should see the pattern for assigning values to TIMEID for days and months, etc.
    Normally, TIMEID is assigned pretty sensible and stable values. If it doesn't meet your logic requirements, you can create another property (be careful of USERTIMEID, since that has a specific purpose in the system which I've never fully understood) and assign that whatever (integer) values make sense.

  • BPC 7.5 MS SP5 wrong numbers multiplying GET (A)*GET(B) in script logic

    Hi experts,
    We are migrating from BPC 5.1 MS to 7.5 MS SP5 and there have some scripts that are using GET function that retrieve wrong numbers. Particularly, it does not record the decimals figures.
    Example1 (multiply): when A=2,3 and B=4,4, then AB=10,12. But doing this in script logic GET(A)GET(B)=10. It does not write the decimal figures.
    Example2 (addition): when A=2,3 and B=4,4, then AB=6,7. But doing this in script logic GET(A)GET(B)=6. It does not write the decimal figures.
    Particularly, the script we are executing is the following. This script worked ok at 5.1 but not at 7.5:
    *XDIM_MEMBERSET ACCOUNTL= INFLA_AUX,INFLA_ACUM
    *XDIM_NOSCAN ACCOUNTL = INFLA_ACUM
    *XDIM_MEMBERSET CATEGORY=%CATEGORY_SET%
    *XDIM_MEMBERSET CURRENCY=LC
    *XDIM_MEMBERSET TECHNOLOGY = %TECHNOLOGY_SET%
    *XDIM_MEMBERSET PEM=DESCENDANTS([PEM].[PEMTOT],999,LEAVES)
    *XDIM_MEMBERSET TIME=DESCENDANTS([TIME].[XXXX.TOT],999,LEAVES)
    *CALC_EACH_PERIOD    
    *WHEN ACCOUNTL
    *IS INFLA_AUX
         *WHEN TIME.YEAR
         *IS = PEM.YEAR
    *REC(EXPRESSION=1,NOADD,ACCOUNTL=INFLA_ACUM)
                *IS < PEM.YEAR
    *REC(EXPRESSION=0,NOADD,ACCOUNTL=INFLA_ACUM)         
                *IS > PEM.YEAR
    *REC(ACCOUNTL=INFLA_ACUM,NOADD,EXPRESSION=GET(ACCOUNTL="INFLA_ACUM",TIME=PRIOR) * GET(ACCOUNTL="INFLA_AUX",TIME=PRIOR))     //in this sentence!!!!!!
              *ENDWHEN
    *ENDWHEN
    *COMMIT
    We have SIGNED_DATA_FORMAT (25,10) in the application parameters.
    Many thanks for your attention.
    Best regards,
    Arkaitz
    Edited by: arkaitz_orozko81 on Apr 28, 2011 4:31 PM
    Edited by: arkaitz_orozko81 on Apr 28, 2011 4:33 PM

    Hello,
    We have solved this issue.
    First, we have change the script:
    *SELECT(%PEM_APLICA%,[ID],PEM,"APLICA='Y'")
    *XDIM_MEMBERSET ACCOUNTL=PROD_AUX,DISP_INP,HORA_AUX,CAPAC_AUX
    *XDIM_NOSCAN ACCOUNTL= PROD_AUX
    *XDIM_MEMBERSET CATEGORY=%CATEGORY_SET%
    *XDIM_MEMBERSET CURRENCY=LC
    *XDIM_MEMBERSET TECHNOLOGY=DESCENDANTS([TECHNOLOGY].[RENOVABLES],999,LEAVES)
    *XDIM_MEMBERSET PEM=%PEM_APLICA%
    *XDIM_MEMBERSET TIME=<ALL>
    *WHEN ACCOUNTL
    *IS CAPAC_AUX
    //*IS *
         *WHEN SIGNEDDATA
         *IS <> 0
    REC(ACCOUNTL="PROD_AUX",NOADD,EXPRESSION=GET(ACCOUNTL="CAPAC_AUX")* GET(ACCOUNTL="DISP_INP")* GET(ACCOUNTL="HORA_AUX"))
         *ELSE
    *REC(ACCOUNTL="PROD_AUX",NOADD,EXPRESSION=0)
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    And we have change the regional settings to "English (United States)".
    Many thanks for your answer.

  • Use of comments in script logic / BADI

    Hi,
    Does anyone knows whether one can read the comments entered in an input schedule in a script logic or BADI? Depending on the text entered in a comment, a certain planfunction has to be executed during save ...
    the user should be able to easily change a dimension value in an input schedule:
    Product    Product group    Key figure 1     Key figure 2
    A             A1                     10                       30
    -> the user easily needs to change the product group from A1 into B1 . When doing so the values of key figure 1 and 2 need to be copied to the new product group and the original values on A1 have to be removed. we cannot set up the product group as a propoerty since one should be able to compare multiple versions with different assignments ... So we were thinking to add an additional comment column in which the new value can be assigned to. When save, it should read the comment and perform the planfunction ... Would this be possible?
    D

    HI D-
    Possible, but you would probably need to create a Badi to accomplish all the logic...
    For a start, you would need to be able to find the comments...the naming convention for the dynamic comment table is:
    /1CPMB/application_set_prefixapplication_prefixCMT
    The two character application_set_prefix can be identified from the table UJA_APPSET_INFO, and the two character application_prefix can be identified from the UJA_APPL table.   
    Once the comment table is identified you could create a custom Badi to look up comment information to direct processing of specific records.   
    Regards,
    Sheldon Edelstein

Maybe you are looking for