Dynamic tuple expression in *REC statement

Hi there,
I think I know the answer to this already, but here goes...
I need to use a tuple expression in a *REC statement (in place of the old-fashioned GET) but I want it to be dynamic, so at least one of the tuple members changes at runtime.
To use the basic example from SAP Help, but amended slightly, let's say this is the standard expression:
*XDIM_MEMBERSET P_ACCT = CE0004010,CE0652000
*WHEN P_ACCT
*IS "CE0004010"
*REC(EXPRESSION=%VALUE%/([P_ACCT].[CE0652000],[P_ACTIVITY].[LABPRD],[P_ENTITY].[E123]), P_ACCT="CE0661000")
*ENDWHENBut what if the P_ENTITY member should be dynamic, depending on the ENTITY member the user selects in the DM package? What I WANT to do is something like this:
*XDIM_MEMBERSET P_ACCT = CE0004010,CE0652000
*WHEN P_ACCT
*IS "CE0004010"
*REC(EXPRESSION=%VALUE%/([P_ACCT].[CE0652000],[P_ACTIVITY].[LABPRD],[P_ENTITY].[%ENTITY_SET%]), P_ACCT="CE0661000")
*ENDWHEN
...but it doesn't work. Is this even possible? And if so, what am I doing wrong?
Thanks very much,
Jason
PS. I'm already using a lookup to pull out a tax% in the same script, so I can't use it for this as well...

Some theory:
You have some scope at the script start (defined by user selection in DM prompt)
For each dimension you have variable %SOMEDIM_SET% containing initial script scope. If you change scope of some dimension using *XDIM_MEMBERSET SOMEDIM=MEM1,... you can always later restore original scope with *XDIM_MEMBERSET SOMEDIM=%SOMEDIM_SET%
WHEN/ENDWHEN will loop records with base members of the scope before WHEN. %VALUE% is a current record value.
You can use tuple references to other members in EXPRESSION=... Dimensions not defined in tuple will have the same base member as current record. In tuple you can also use parent members.
You can use LOOKUP as a replacement of FLD to get member from the property of the member in current record. LOOKUP can get data from current model or other model.
Vadim

Similar Messages

  • Set dynamic member to dimension in *REC statement

    BPC Experts,
    Please refer to the below script logic . In this i wanted to pass the dynamic value to the BPC dimension. For the INPUT auditidm , i want to update different AUDITID value based on the dynamic selection in BPC . But the below script logic is throwing warning message and the dynamic value to the auditid is not considered, instead it uses the variable name itself while generating the records. I m using BPC 10 version SP Level 12.
    *XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%
    *XDIM_MEMBERSET TIME = %TIME_SET%
    *XDIM_MEMBERSET ACCOUNT = %ACCOUNT_SET%
    *XDIM_MEMBERSET AUDITIDM= INPUT
    *WHEN AUDITIDM
    *IS *
    *REC(EXPRESSION = %VALUE% * ($PER_INPUT$/100), AUDITIDM = $HLA_INPUT$ )
    *ENDWHEN
    *COMMIT
    PROMPT(SELECT,,,,"CATEGORY,ACCOUNT,TIME,")
    PROMPT(TEXT, %PER_INPUT%, "Input Percentage",,)
    PROMPT(COMBOBOX, %HLA_INPUT%, "Select HLA AudiitID from the list",0,"HLA_01",{"HLA_02","HLA_03","HLA_04"},)
    INFO(%EQU%,=)
    INFO(%TAB%,;)
    TASK(/CPMB/FX_RESTATMENT_LOGIC,SUSER,%USER%)
    TASK(/CPMB/FX_RESTATMENT_LOGIC,SAPPSET,%APPSET%)
    TASK(/CPMB/FX_RESTATMENT_LOGIC,SAPP,%APP%)
    TASK(/CPMB/FX_RESTATMENT_LOGIC,SELECTION,%SELECTION%)
    TASK(/CPMB/FX_RESTATMENT_LOGIC,REPLACEPARAM,PER_INPUT%EQU%%PER_INPUT%%TAB%,AUDITIDM%EQU%%HLA_INPUT%)
    TASK(/CPMB/FX_RESTATMENT_LOGIC,LOGICFILENAME,HLA.LGF)
    After the run package, warning messages shows
    ENDWHEN ACCUMULATION: 1  RECORDS ARE GENERATED.
    Invalid Members [AUDITIDM]=%HLA_INPUT%
    How to pass dynamic value to the REC statement ? Please provide your inputs

    TASK(/CPMB/FX_RESTATMENT_LOGIC,REPLACEPARAM,PER_INPUT%EQU%%PER_INPUT%
    %TAB%,AUDITIDM%EQU%%HLA_INPUT%) -> you have given comma after %TAB% remove that and use HLA_INPUT not AUDITIDM
    Correct:
    TASK(/CPMB/FX_RESTATMENT_LOGIC,REPLACEPARAM,PER_INPUT%EQU%%PER_INPUT%
    %TAB%HLA_INPUT%EQU%%HLA_INPUT%)
    Also remove inverted comma in combo box.
    Correct:
    PROMPT(COMBOBOX, %HLA_INPUT%, "Select HLA AudiitID from the list",0,HLA_01,{HLA_01,HLA_02,HLA_03,HLA_04},)
    Hope this helps..

  • BPC Script Logic Multi-dimension REC Statement

    Hi All BPC Experts,
    The way that our data in the dimensions is setup, members in one dimension have properties that "point" to members in other dimensions.
    In this case when I write the REC statement, whilst I'm just doing arithmetic on P_ACCT, when I write the final value, I also need to specifiy the members for the dimensions CUSTOMER, ENTITY, MINE, DESTINATION.
    In the example below I hve hardcoded the CONTRACT and TIME dimension members, but going forward, this logic will be appllied to a number of CONTRACTS and TIMES so the members of the other dimensions need to be retrieved dynamically.
    *XDIM_MEMBERSET P_ACCT = CAPACITY_REV,CAPACITY_RATE,FINAL_VOLUME
    *XDIM_MEMBERSET CATEGORY=FORECAST
    *XDIM_MEMBERSET P_DATASRC=Input
    *XDIM_MEMBERSET CONTRACT=0005000001_10
    *XDIM_MEMBERSET TIME=2009.JUL
    *WHEN P_ACCT
          *IS CAPACITY_RATE
             *BEGIN
                REC(EXPRESSION=(%VALUE%[P_ACCT].[FINAL_VOLUME]),
                         CUSTOMER = CONTRACT.CUSTOMER,
                         DESTINATION = CONTRACT.DESTINATION_ID,
                         ENTITY = CONTRACT.HAUL_PC,
                         MINE = CONTRACT.MINE_ID,
                         P_ACCT = "CAPACITY_REV")
             *END
    *ENDWHEN
    *COMMIT
    My Question is twofold:
    - Can anyone see any problems with the above code, ie is this a valid way of writing the REC statement?
    - Can anyone suggest another way of writing this code?
    Best regards
    Mark Rodrigues

    Just repostoing the logic as "Code"
    *XDIM_MEMBERSET P_ACCT = CAPACITY_REV,CAPACITY_RATE,FINAL_VOLUME
    *XDIM_MEMBERSET CATEGORY=FORECAST
    *XDIM_MEMBERSET P_DATASRC=Input
    *XDIM_MEMBERSET CONTRACT=0005000001_10
    *XDIM_MEMBERSET TIME=2009.JUL
    *WHEN P_ACCT
      *IS CAPACITY_RATE
        *BEGIN
            REC(EXPRESSION=(%VALUE%P_ACCT.FINAL_VOLUME),
                                            CUSTOMER = CONTRACT.CUSTOMER,
                                            DESTINATION = CONTRACT.DESTINATION_ID,
                                            ENTITY = CONTRACT.HAUL_PC,
                                            MINE = CONTRACT.MINE_ID,
                                            P_ACCT = "CAPACITY_REV")
        *END
      *ENDWHEN
    *COMMIT

  • REC Statement with IIF

    Hi experts,
    We are using SAP BPC 7.5 SP08. I have written a script logic wherein, i am dynamically populating the opening balance(CPLCLPTCOO) to the next month
    *FOR %TIM_MEM%="2011.AUG","2011.SEP","2011.OCT","2011.NOV","2011.DEC","2012.JAN","2012.FEB","2012.MAR","2012.APR","2012.MAY","2012.JUN","2012.JUL"
    *XDIM_MEMBERSET TIME =%TIM_MEM%
    *WHEN P_ACCT2
    *IS CPLCLPTCOSA
    *REC(EXPRESSION=[P_ACCT2].[CPLCLPTCOO]+[P_ACCT2].[CPLCLPTCOTOTP]-[P_ACCT2].[CPLCLPTCOTOTOF],P_ACCT2="CPLCLPTCOO",TIME=TIME.NEXT)
    *ENDWHEN
    *COMMIT
    *NEXT
    This code is working fine. However the problem comes when the user does not give any value in the input schedule for the member  CPLCLPTCOSA in one month but gives it for subsequent months. For this i tried modifying the scipt logic as
    *FOR %TIM_MEM%="2011.AUG","2011.SEP","2011.OCT","2011.NOV","2011.DEC","2012.JAN","2012.FEB","2012.MAR","2012.APR","2012.MAY","2012.JUN","2012.JUL"
    *XDIM_MEMBERSET TIME =%TIM_MEM%
    *REC(EXPRESSION=IIF([P_ACCT2].[CPLCLPTCOSA]=0,[P_ACCT2].[CPLCLPTCOO][P_ACCT2].[CPLCLPTCOTOTP]-[P_ACCT2].[CPLCLPTCOTOTOF],[P_ACCT2].[CPLCLPTCOO][P_ACCT2].[CPLCLPTCOTOTP]-[P_ACCT2].[CPLCLPTCOTOTOF]),P_ACCT2="CPLCLPTCOO",TIME=TIME.NEXT)
    *COMMIT
    *NEXT
    However, this code doesnot work as it is giving a validation error "Invalid dimemnsion name "[P_ACCT2].[CPLCLPTCOSA" in application PLANNING"
    Can you please help me out on how i can include an IIF statement in a REC statement.
    Thanks in advance
    Edited by: Appu Del on Dec 30, 2011 4:36 PM

    place *WHEN_REF_DATA = MASTER_DATA at the beginning .Try this statement with 1 st code . Do not  try with  2 ed code . it has lot of syntax errors.
    *WHEN_REF_DATA = MASTER_DATA
    *FOR %TIM_MEM%="2011.AUG","2011.SEP","2011.OCT","2011.NOV","2011.DEC","2012.JAN","2012.FEB","2012.MAR","2012.APR","2012.MAY","2012.JUN","2012.JUL"
    *XDIM_MEMBERSET TIME =%TIM_MEM%
    *WHEN P_ACCT2
    *IS CPLCLPTCOSA
    *REC(EXPRESSION= ([P_ACCT2].[CPLCLPTCOSA]>0 )*([P_ACCT2].[CPLCLPTCOO]+[P_ACCT2].[CPLCLPTCOTOTP]-[P_ACCT2].[CPLCLPTCOTOTOF]) +  ([P_ACCT2].[CPLCLPTCOSA]<0 )* (calculation if there is no value in CPLCLPTCOSA)  ,P_ACCT2="CPLCLPTCOO",TIME=TIME.NEXT)
    *ENDWHEN
    *COMMIT
    *NEXT
    Hope this helps.

  • How to Dynamically construct the conditional IF statement in java

    Is there a way to dynamically construct a conditional IF statement in java?
    For example:
    Suppose i have a 2D array like:
    Array[the actual values to search for][the column number in the table to perform the search on].
    e.g.
    Array {
                 {"x"} , {1},  
                 {"y"} , {2},  
                 {"z"} , {3},  
    }How can i construct the if statement like:
    Looping over table rows (tableRow) {
        Looping over array {
            IF ( {"x"}. equals( tableModel.getValueAt( tableRow, {1})   &&
                   {"y"}. equals( tableModel.getValueAt( tableRow, {2})   &&
                   {"z"}. equals( tableModel.getValueAt( tableRow, {3})  )              
            return true;
    }The array can grow or shrink based on the values in it so therefore IF statement will grow or shrink. How can i achieve it?
    If not then how can i achieve this?

    My understanding (feeble at best) is that a sieries of && elements will be evaluated in order until the first false value is encountered. So, in an "if a && b && c" statement where b is false c will never be evaluated and the conditional executable will not run. Is that what you mean?
    Yes, logical expressions will not evaluate unnecessary operands. So you can safely write the following, for instance, without getting an error,
    if ((anArray != null) && (anArray.length > 0)) { ... }because the second operand of the '&&' will never be evaluated if 'anArray' is null.
    Also, is there a difference between & and &&?
    & is a bitwise operator, && is a boolean operator.

  • 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

  • Execute the expression in select statement

    CREATE TABLE TEST1
      OFFICE_PRODUCTS     NUMBER,
      OFFICE_ELECTRONICS  NUMBER
    Insert into TEST1 (OFFICE_PRODUCTS, OFFICE_ELECTRONICS) Values(1, 0);
    COMMIT;
    CREATE TABLE TEST2
      EXPORT_FIELD_NAME         VARCHAR2(100 BYTE),
      EXPORT_COLUMN_EXPRESSION  VARCHAR2(100 BYTE)
    Insert into TEST2
       (EXPORT_FIELD_NAME, EXPORT_COLUMN_EXPRESSION)
    Values ('A1', 'least(OFFICE_PRODUCTS, OFFICE_ELECTRONICS)');
    COMMIT; I want to be execute the expression should run in select statement how to do?
    and tried as like below,it's not working.
    select (select EXPORT_COLUMN_EXPRESSION from test2 where EXPORT_FIELD_NAME='A1') FROM TEST1;

    968892 wrote:
    CREATE TABLE TEST1
    OFFICE_PRODUCTS     NUMBER,
    OFFICE_ELECTRONICS  NUMBER
    Insert into TEST1 (OFFICE_PRODUCTS, OFFICE_ELECTRONICS) Values(1, 0);
    COMMIT;
    CREATE TABLE TEST2
    EXPORT_FIELD_NAME         VARCHAR2(100 BYTE),
    EXPORT_COLUMN_EXPRESSION  VARCHAR2(100 BYTE)
    Insert into TEST2
    (EXPORT_FIELD_NAME, EXPORT_COLUMN_EXPRESSION)
    Values ('A1', 'least(OFFICE_PRODUCTS, OFFICE_ELECTRONICS)');
    COMMIT; I want to be execute the expression should run in select statement how to do?
    and tried as like below,it's not working.
    select (select EXPORT_COLUMN_EXPRESSION from test2 where EXPORT_FIELD_NAME='A1') FROM TEST1;
    Your problems are many...
    a) it's very poor design to be storing expressions or sql statements or any 'executable' style code as data in the database.
    b) what you're storing is a string of characters. Oracle isn't going to miraculously know that that is some expression that has to be evaluated, so why should it decide to treat it as such?
    c) this poor design can lead to security issues especially around SQL injection.
    d) to actually perform what you want would require you to build a dynamic SQL statement and then execute that using EXECUTE IMMEDIATE or DBMS_SQL (or for a 3rd party client, a Ref Cursor), but then there are numerous issues around doing dynamic SQL, aside from SQL injection, in that you are producing code that is not validated at compile time and can thus lead to bugs showing only at run-time and sometime only under certain conditions; the code is harder to maintain; the code can potentially be avoiding the use of bind variables, impacting on resources and performance on the database; the final query can be difficult to know just from reading the code, making further development or debugging a pain in the posterior. Essentially, dynamic SQL is considered very poor design and is 99.9% of the time used for the wrong reasons.
    So, why are you trying to do this? What is the business requirement you are trying to solve?

  • Reg: Script Logic - REC Statement Variable usage

    hi friends
    Pl find enclosed the following code:
    *WHEN TIME               
    *IS TMVL(-1,2011.04)               
    *WHEN ACCOUNT               
    *IS "EXP01"               
    *REC(EXPRESSION = [TIME].[2011.04]-%VALUE%,TIME = 2011.04,ACCOUNT = EXP01A)               
    *ENDWHEN               
    *ENDWHEN               
    The above code is working fine and result is extracted but i have hardcoded , ACCOUNT=EXP01A;
    My Query is follows:
    I have used
    *WHEN ACCOUNT               
    *IS "EXP01"
    In REC i want to use concatenation of "A" To account like EXP01&"A"
    i know accunt & i want to concatenate "A" and use in REC statement like assign to variable
    var1="EXP01" & "A" and use var1 in REC
    *REC(EXPRESSION = [TIME].[2011.04]-%VALUE%,TIME = 2011.04,ACCOUNT = var1)
    i am not sure the syntax (Whether we need to put in strings)
    Also if EXP02 then var1="EXP02"&"A" and so on
    In fact i want to make this for all members in Account Dimenstion as generalised.
    Pl. verify and suggest best possibility
    Thanx & Rgds
    Srinath

    Hi Krishna
    *XDIM_MEMBERSET ACCOUNT AS %ACC% = EXP01
    *WHEN ACCOUNT
    *IS %ACC%
    REC(EXPRESSION = %VALUE%2,TIME = 2011.04,ACCOUNT = %ACC%A)
    *ENDWHEN
    Is it required to add EXP01A as below?
    XDIM_MEMBERSET ACCOUNT AS %ACC% = EXP01, EXP01A
    Also In Generalized code you have mentioned:
    Instead of Hard Coding EXP01, EXP02 can i have hierarchy of all EXP , so that if any new account added in dimension, there will be no change in script logic. Pl. can you share how to use the same.
    If above code needs to be generalised, *FOR *NEXT can be used .
    *XDIM_MEMBERSET ACCOUNT AS %ACC_LIST% = EXP01,EXP02,EXP03,EXP04
    *FOR %ACC_MBR% = %ACC_LIST%
    *WHEN ACCOUNT
    *IS %ACC_MBR%
    REC(EXPRESSION = %VALUE%2,TIME = 2011.04,ACCOUNT = %ACC_MBR%A)
    *ENDWHEN
    *NEXT
    Rgds
    Srinath

  • Script Logic - REC Statement

    Hi,
    Can we use dimension property value in REC statement?
    *REC(EXPRESSION = %value%/[TIME].CURRENTMEMBER.PROPERTIES("ACCTHRS"),ACCT_PROJECT="FTE_DIRECT_BASE")
    WHEN I PROCESS THE SCRIPT LOGIC I AM GETTING AN ERROR "INVALID LINE IN LOGIC SECTION: *REC........"
    THANKS

    Hi,
    In this case, you can use LOOKUP. For instance,
    *LOOKUP XXX
    *DIM AAA:TIME=TIME.ACCTHRS
    *ENDLOOKUP
    *REC(EXPRESSION = %value%/LOOKUP(AAA),ACCT_PROJECT="FTE_DIRECT_BASE")
    Hope this helps.
    Regards,
    YH Seo
    ====================================================================================================
    Hi,
    Can we use dimension property value in REC statement?
    *REC(EXPRESSION = %value%/TIME.CURRENTMEMBER.PROPERTIES("ACCTHRS"),ACCT_PROJECT="FTE_DIRECT_BASE")
    WHEN I PROCESS THE SCRIPT LOGIC I AM GETTING AN ERROR "INVALID LINE IN LOGIC SECTION: *REC........"
    THANKS

  • Concatenating a property in a REC statement

    In a *REC statement I need to append a property value to a string to define the Account and have tried several iterations around the following without success:
    *REC(EXPRESSION=%VALUE%,ACCOUNT=1210_ENTITY.ACCTSUFFIX)
    Where the Entity.AcctSuffix property may contain ABC, so the result I would expect would be 1210_ABC
    I thought I had seen a similar thread in the past but cannot locate it, so my apologies if I'm duplicating a previous discussion
    Any suggestions/guidance would be appreciated.

    I have exactly the same situation working for me  where I need to map data from a monthly to a weekly application, where I say:
    *REC(TIMEDIM=TIMEDIM.YEAR.WMYTARGETWEEK
    In this case MYTARGETWEEK is generated by a *SELECT used in a *FOR statement resulting in a weeknumber. and the ".W" are putted correctly in between.
    so the result is a timemember like 2008.W52. But in this case the property is also the first part of the membername. So trying to relabel the account and testing the logic the other way around like Alwin suggests might be worth trying.
    -Joost

  • REC statement question

    Hello,
    I have written this rec statement
    *WHEN
    REC(EXPRESSION=%VALUE%LOOKUP)
    *ENDWHEN
    the only thing is I need to multiply it by -1. How do I add the reverse sign of this result to the REC statement. or how do i add that in the statement?
    Thanks.

    Hi,
    You can do this in a number of ways, the way i would do it is as follows:
    REC(FACTOR=-1LOOKUP)
    Tom

  • Dynamic parameter with an IMPORT statement

    Hello experts. I hope you can help me with this issue:
    I have a report performing an EXPORT statement into a Buffer:
      EXPORT I_USER    FROM P_USER
                    I_NAME    FROM P_NAME
                    I_SURNAME FROM P_SURNAM
               TO DATA BUFFER V_XPARVALUES.
    Then it calls the first FM where a type I program is created by using INSERT REPORT... This dynamic-generate INCLUDE has the explicits declaration for variables: I_USER, I_NAME, I_SURNAME.
    Afeter the dynamic Include generation, it calls a second FM, wich has the reference to the dynamic Include created before with the data declaration. The only thing remain is to IMPORT all the data from the buffer V_XPARVALUES:
    The following code lines are within a LOOP. wa_param-paramname has the name of the variable (I_USER, I_NAME I_SURNAME).
        ASSIGN (wa_param-paramname) TO
          FROM DATA BUFFER v_xparvalues.
    but what I need to achieve is dynamic parameters in the IMPORT statement.
    Had anybody came across this problem?
    I hope I have been clear with the explanation.
    Regards,
    Andrés Sarcevic.

    IMPORT/EXPORT scope didn't work out. Instead, I used CALL TRANSFORMATION and XML approach, besides some ABAP creativity.

  • Dynamic logic expression

    Hi Experts, 
    Iu2019m trying to build a routine with dynamic logical expressions but it's now working...
    Basically Iu2019m building a string with the expression, a and after the string it's completed Iu2019m calling a macro that consist in a if.
    if expression eq true
    return true value
    but the value returned by the macro it's always false, even when the logical expression it's true...
    i already tried the logical function BOOLC but apparently my version, ECC 6, doesnu2019t recognize it....
    Below goes the code, if anyone could help me Iu2019ll be appreciated.
    "Macro definition
    DEFINE check_condition.
    IF &1 EQ ABAP_TRUE.
        move 'X' to &2.
      endif.
    END-OF-DEFINITION.
    LOOP AT tab_regras."Rules
        CLEAR: str_cond, lv_result.
        LOOP AT dfies_tab WHERE fieldname CS 'ARGUMENTO'.
          CLEAR: lw_string, str_1, str_2, str_3.
          ASSIGN COMPONENT dfies_tab-fieldname OF STRUCTURE tab_regras TO <fs_field>.
          CHECK <fs_field> IS NOT INITIAL.
          SPLIT <fs_field> AT '/' INTO  str_1 str_2 str_3.
          ASSIGN (str_1) TO <fs_value1>.
    "     ASSIGN (str_2) TO <fs_value2>.
    "      ASSIGN (str_3) TO <fs_value3>.
          IF str_cond IS INITIAL..
            CONCATENATE <fs_value1> str_2 str_3 INTO str_cond SEPARATED BY space.
            CONTINUE.
          ENDIF.
          CONCATENATE str_cond 'and' <fs_value1> str_2 str_3 INTO str_cond SEPARATED BY space."string condition
        ENDLOOP.
        check_condition str_cond lv_result.
        CHECK lv_result EQ 'X'.
    Thanks in advance,
    Best Regards
    João Martins

    It would be helpful if you show us what is the example content of str_cond .
    Anyhow your check looks like you want to compare some condition with value X which abap_true denotes i.e.
    if field_1 = 10 and field_2 = 20 EQ 'X'. 
    endif.
    This doesn't make sense for me or maybe I am missing something which is hidden behid this str_cond . Your left hand side expression value must however be equal to right hand side value. So the conditon will only be true if
    if 'X' = 'X'.
    endif.
    Regards
    Marcin
    PS: please note that in ABAP there is no real boolean value, so you can't have condition like in JAVA or C
    if (true_condition)
    //do something
    you always have to compare two values (here abap_true which is X if fact).
    Edited by: Marcin Pciak on May 24, 2011 3:59 PM

  • How to evaluate dynamic XPath expression in BPEL?

    I have an xml file where I keep many settings for my BPEL process. At runtime, I read the file and I want to select values from it based on values in the process payload.
    For example, imagine that the process payload is an order:
    <order>
    <header>
    <id/>
    <customer_id/>
    <team_id/>
    </header>
    <items>
    <item>
    <id/>
    <sku/>
    <price/>
    <quantity/>
    </item>
    </items>
    </order>
    Now, in my xml settings file, I have a section where I keep a mapping of "team_id" and "assignment_group", so that for each team id, I can select the appropriate group to whom a task should be assigned. The relevant section of the settings file will look something like this:
    <assignment_groups>
    <group team_id='0923230'>invoice_approvers</group>
    <group team_id='3094303'>order_approvers</group>
    <group team_id='3434355'>shipping_approvers</group>
    </assignment_groups>
    So, imagine I get an order input to my process where the team_id is '3094303'. Now I have to lookup the correct assignment group in my settings file.
    So, I construct the dynamic XPath expression
    /settings/assignment_groups/group[@team_id=3094303]
    I know that this would evaluate to "order_approvers". However, even though I have the XPath expression in a BPEL variable, and I have my settings file as a BPEL variable also, I don't know how to execute the XPath expression against the settings BPEL variable to retrieve the correct value.
    Any ideas appreciated.
    Thanks,
    Jack

    James:
    Thank you for the response. Incidentally, this is the very same document and section that I have been looking at for guidance. Specifically, the section titled "Dynamically indexing by Constructing an XPath at Run Time" on page 12-13.
    I tried to do something similar to the example at the top of page 13:
    <variable name="iterator" type="xsd:integer"/>
    <assign>
    <copy>
    <from expression="concat('/invoice/line-item[',bpws:getVariableData('iterator'), ']/line-total')"/>
    <to variable="xpath"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('input', 'payload',bpws:getVariableData('xpath')) + ..."/>
    </copy>
    </assign>
    I am able to achieve the first copy operation to get my dynamic XPath into a BPEL variable and that's fairly straightforward. But I am unable to get the second copy to work. Specifically, I am not sure what to put in the second argument of the bpws:getVariableData function. I have tried many different combinations, but when I try to compile my program, I get the following compilation error:
    Error:
    [Error ORABPEL-10902]: compilation failed
    [Description]: in "C:\code\TrainingWS\SampleGetSettings\bpel\SampleGetSettings.bpel", XML parsing failed because "org.collaxa.thirdparty.jaxen.expr.DefaultFunctionCallExpr".
    [Potential fix]: n/a.
    Thanks,
    Jack

  • Using properties in a *REC statement

    Hi
    I want to copy the result of a cost center allocation from the source cost center profit center to the destination cost center profit center.  We use a property on the cost center dimension to define the profit center of the cost center.
    I first use *RUN ALLOCATION to generate the cost center allocation results but I then need to copy the results to the right profit center.  I have written the following code to do this which validates successfully:
    *WHEN ACCOUNT
    *IS A10000
      *REC(PROFITCENTER=COSTCENTER.PROFITCENTER)
    *ENDWHEN
    However when I run it I receive the following error message:
    'RUN_LOGIC Property value not found'
    Does anybody know whether it is possible to use properties in *REC statements and if so how I should write the logic?
    Kind Regards
    Wayne

    Hi,
    Try following code. However you should be sure that all the profitcenter property members of costcenter exist in profitcenter dimension members. For example if you have a member of costcenter like na_cc and if property profitcenter of this member is blank, this code doesnt work. So you have to add a XDIM_MEMBERSET.
    XDIM_MEMBERSET COSTCENTER <,> NA_CC or
    XDIM_MEMBERSET COSTCENTER = BAS(CC)
    *WHEN ACCOUNT
    *IS A10000
    *REC(FACTOR=1, PROFITCENTER=COSTCENTER.PROFITCENTER)
    *ENDWHEN
    Hope this helps.

Maybe you are looking for

  • Dynamic File and Directory Name without Mapping

    Hello Experts, We have following requirement: 1) Files will be picked from R/3 AL11 directory and would be placed in corresponding folder in target system. 2) On source side ,there would be only one folder for all types of files(around 20),but on tar

  • Memory Problem.. iTunes doesnt open

    I happen to have a problem with opening iTunes. When i open it, an window pops up stating that i do not have enough memory to run it. I find this confusing, since iTunes 7 only requires 256 mb ram, and i have that much ram myself, iTunes should work.

  • Wss3 -- get XML "gibberish" when trying to add new user to site

    Site Actions > Site Settings > People and groups > New Select "book" icon  under Users\Groups, add domain user (works fine). This is displayed in the "Users\Groups" box in Add Users. The text displayed in  "Users/Groups"  looks like this: <span tabin

  • Install 10G 10.1.0.2 same home as 10.1.0.3 on AIX

    I have several version of Oracle 10G Database running across several systems. The version currently running is 10.1.0.3.0 on IBM AIX version 5.3 64 bit for AIX 5L Systems. When I try to download the same version I see only version 10.1.0.2 and 10.2.0

  • How to add WebDynpro (for Java) to iView in CE 7.1

    Hi experts, Currently trying CE 7.1 SP3. I have created the Web Dynpro project and wanted to add it in iView and subsequently to the Page. However, there isn't a Web Dynpro for Java  iView template selection. How do i add the web dynpro for Java to i