Using a characteristic value from an infoCube as a variable in a query

Hi gurus!
I have a query based on an infoCube where I make a restricted key figure. I restrict the key figure by selecting a specific month using 0calmonth.
I need to create a variable that represents a specific month which will change every year. I have this month value stored in another infoCube. In this infoCube I have 0employee and for each employee the characteristic 0calmonth represents the month I need to use in my other query.
So my question is: how can I retrieve the the value from 0calmonth (fx. 012009) from one infoCube and use it as an input in my other query for restricting the key figure using 0calmonth?
Thank you!
Best regards,
Morten

Hi guys,
Thanks for your help so far. I would like to use the replacement path using another query. It seems more simple since I don't need to do any ABAP programming.
However, it doesn't work for me. I made a pre-query on the infoCube, which contains the month I need for my other query. This pre-query uses a variable which restricts the data output to only data for current year up to current month. So if my input is 072009, then I will receive data for 012009-072009. My query result will then show me the month I need, since there will only be data for one specific month. So for 2009, the month that contains any data will be 052009. I need this month(052009) in my other query.
So, in my original query I made a new variable for 0calmonth and I chose replacement path and the pre-query. I made a restricted key figure where I use the replacement path query. However, I am gettings errors, when I check the report and no data is available when I execute the query. The error says:
Variable "prequery_variable" cannot be used in selection "key figure 1"; remove
How you seen this error before?
Thank you!

Similar Messages

  • Script fails when passing values from pl/sql to unix variable

    Script fails when passing values from pl/sql to unix variable
    Dear All,
    I am Automating STATSPACK reporting by modifying the sprepins.sql script.
    Using DBMS_JOB I take the snap of the database and at the end of the day the cron job creates the statspack report and emails it to me.
    I am storing the snapshot ids in the database and when running the report picking up the recent ids(begin snap and end snap).
    From the sprepins.sql script
    variable bid number;
    variable eid number;
    begin
    select begin_snap into :bid from db_snap;
    select end_snap into :eid from db_snap;
    end;
    This fails with the following error:
    DB Name DB Id Instance Inst Num Release Cluster Host
    RDMDEVL 3576140228 RDMDEVL 1 9.2.0.4.0 NO ibm-rdm
    :ela := ;
    ERROR at line 4:
    ORA-06550: line 4, column 17:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ( - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    The symbol "null" was substituted for ";" to continue.
    ORA-06550: line 6, column 16:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ( - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev su
    But when I change the select statements below the report runs successfully.
    variable bid number;
    variable eid number;
    begin
    select '46' into :bid from db_snap;
    select '47' into :eid from db_snap;
    end;
    Even changing the select statements to:
    select TO_CHAR(begin_snap) into :bid from db_snap;
    select TO_CHAR(end_snap) into :eid from db_snap;
    Does not help.
    Please Help.
    TIA,
    Nischal

    Hi,
    could it be the begin_ and end_ Colums of your query?
    Seems SQL*PLUS hs parsing problems?
    try to fetch another column from that table
    and see if the error raises again.
    Karl

  • Values from another infocube

    hi all,
    I have to build a report on infoprovider A (infocube A). this report has a column, where data have to be calculated with information from another infoprovider (Infocube B).
    The information needed from B is just one value depending on parameter year.
    I didnt find  a way to put this value as variable
    in the query.
    Is there a way to get the information from Infocube B in the query?
    thanks for any help !

    If the info you need is always the same (unique) for the entire query you can use a formula variable and fill it thanks to an exit in which you can read the value from the infoprovider (look at previous posts in order to see how)...otherwise (if the value from the infoprovider can change for every row of your query) you have to do the same, but inside a virtual KF...
    Hope it helps!
    Bye,
    Roberto
    Message was edited by: Roberto Negro

  • How to copy characteristic values from Purchase Order to MIGO Goods Receipt

    Dear all,
    I have a configurable material X,
    then i create a purchase order for that material and then i input characteristic value in the Purchase Order transaction and save it
    However when i do the Goods Receipt transaction via MIGO and using the Purchase Order number that i have created, after i entry the batch number and want to check the classification, the characteristic value are blank, so it is not copied from the Purchase Order
    I've tried guide from
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/92/9b4a23a46411d6b28300508b5d5c51/content.htm
    but i do not find the configuration for copying rule
    Is there any one who can resolve this problem??
    Regards,
    Marufat

    Hi,
    You define the copying rules for a movement type in Customizing for Batch Management under Batch Valuation ,  Valuation for Goods Movement in Inventory Management , Activate Batch Classification for Goods Movements in IM. Please refer below link. Thanking you.
    http://help.sap.com/saphelp_me52/helpdata/EN/47/39867251500aa7e10000000a114a6b/content.htm

  • How can I use the output value from SIMPLE PID to write something to the serial port?

    I am working on my Senior Design Project that requires the use of incoming compressed air, propotional valves, continuous servo motors, and a serial servo motor microcontroller.  I have figured out how to send byte sequences to the microcontroller through LabVIEW using the VISA serial write function.  The motors are attached to the valves to control the flow rate.  I have created my own simple feedback system using a bunch of case structures but I realized that I am basically trying to recreate the wheel (I basically was writing my own PID VI).   I have an older version of LabVIEW (7.0 Express) and theres no way to upgrade or buy the PID toolkit, so I am stuck using the Simple PID VI.  Also, the only way the motor works is sending an array of bytes to tell it to turn on/off, direction, and speed.  Is there any way I can use the Simple PID VI in conjunction with the VISA SERIAL write function, or is there any other way I can communicate with the serial port using this pid vi?  Any information would be appreciated.

    Hi gpatel,
    you know how to communicate to serial port, but you don't know how to send a value from SimplePID to serial port???
    You know how to communicate, but then you don't know how to communicate???
    You should explain this in more detail...
    Edit:
    From you first post you know what values your motor driver is expecting. You know which values the PID.vi is providing. Now all you need is a formula to reshape the values from PID to the motor. It's up to you to make such a formula. Unless you provide any details we cannot give more precise answers...
    Message Edited by GerdW on 02-28-2010 08:35 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can I use an iteration value from a "while" (or "for") loop as part of a filename?

    I am using the "Write To Measurement File" function  inside a while structure and would like to incorporate the iterative value from the while-loop as part of the file name. I'm not sure how to do it. Any suggestions?

    Like this:
    Edit: Oops. Sorry for the double answer.
    Message Edited by smercurio_fc on 05-22-2007 04:25 PM
    Attachments:
    Example_BD.png ‏3 KB

  • How to use a characteristic value variable in a formula?

    Hi all,
    I have created a characteristic value variable (manual input) for 0CALDAY in a query to get the Start & End date. There is requirement in the report to display a KF showing the duration between Start & End Date.
    I have tried to create a Formula Variable with Replacement Path, Ref Char 0CALDAY. In the Replacement Rule, there is an option to Replace Variable With variable. However, I wasn't able to locate the variable I have created for user input.
    Any idea how to achieve this?
    Many thanks,
    Yoong-En

    hi,
    if you have the start and end dates as user entry then follow this
    1) create a formula variable with reference char as start date of the type customer exit
    2) create another formula with end date as reference char of type customer exit
    3) in the cmod write the code your logic should be in such a way the the value at the user entry should be passed on to this formula variable the same for end date code
    4) create a formula with ( start date formula variable - end date formula variable)
    you can use this code
    WHEN 'ZV_YRFKDAT'.(formula  variable name)
        IF I_STEP = 2. "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
          WHERE VNAM = 'ZV_KEYDAT1'.(user entry variable name)
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW = LOC_VAR_RANGE-LOW. "low value, e.g.YYYY (2006) part of key date (20060625)
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT = 'EQ'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
    repeat teh same for end date
    hope this helps
    Thanks
    krishna.y
        ENDIF.

  • Get distinct values from a coma seperated string variable

    Hi ,
    I am getting an comma seperated string as in parameter, now i want to get the distinct values from that string and will use those values to pass it to a query.
    any help

    try this:
    sorry about the messiness - it's just quickly copied from some badly formatted code....
    TYPE T_FieldArray IS TABLE OF varchar2(255) INDEX BY BINARY_INTEGER;
    function SPLIT_CSV_FIELDS (
    p_Input_Str in varchar2,
    p_Delimiter in varchar2,
    p_Quote_Char in varchar2)
    return t_fieldarray is
    v_FieldArray T_FieldArray;
    v_input_str varchar2(4000);
    v_field_str varchar2(255);
    v_pos number;
    e number := 0;
    v_delim_str varchar2(3);
    cur_pos number;
    begin
    loop
    -- find each delimiter char in string
    v_pos := INSTR(v_input_str, p_Delimiter);
    -- each time delimiter char is found
    if v_pos > 0 then
    -- current field value is current string to position prior to delimiter char
    v_field_str := UPPER(SUBSTR(v_input_str, 1, v_pos - 1));
    -- remove quote char from end of field (if any)
    v_field_str := TRIM(TRANSLATE(v_field_str, NVL(p_Quote_Char, p_Delimiter), ' '));
    -- increment element number
    e := e + 1;
    -- get remainder of input string to check
    v_input_str := SUBSTR(v_input_str, v_pos + 1, LENGTH(v_input_str) - v_pos);
    v_FieldArray(e) := v_field_str;
    else
    -- increment element number
    e := e + 1;
    -- last field value is what's left of input string less quote char (if any)
    v_field_str := TRIM(TRANSLATE(UPPER(v_input_str), NVL(p_Quote_Char, p_Delimiter), ' '));
    v_FieldArray(e) := v_field_str;
    exit;
    end if;
    end loop;
    return v_FieldArray;
    end;

  • Passing value from MD form to bind variable in report

    I have an MD form, after I insert I want to redirect to a form and pass a value out of the detail section to the form to use as the value of it's bind variable. This works well on normal forms, but I cant seem to get it to work on the MD form. Below is an easy example and this doesnt work for me.
    MD form master dept/detail emp, code under the save button:
    doSave;
    declare
    l_empno integer;
    l_url varchar2(2000);
    begin
    l_empno := p_session.get_value_as_NUMBER(
    p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_EMPNO',
    p_index => 1);
    l_url := 'SCOTT.EMP_RPT.show?'| |
    'p_arg_names=empno&p_arg_values='
    | |l_empno;
    portal30.wwa_app_module.set_target(l_url,'CALL');
    end;
    The form displays the empolyee information based on the value of empno from the MD form. The url looks like this http://hostname/pls/portal30/scott.emp_rpt.show?l_arg_names=empno&l_arg_values=
    so no rows get returned because there is no value, if i fill it in with a empno it works, so i know the report works, it just isnt the get_value isnt grabbing the empno from the MD form.
    null

    I figured it out, the save button on a MD form, the doSave; clears out the form fields so do a get_value_as will not work b/c there is nothing there, you need to get the value before the doSave; the below code will work.
    declare
    l_empno number;
    l_url varchar(2000);
    begin
    l_empno := p_session.get_value_as_NUMBER(
    p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_EMPNO',
    p_index => 1);
    doSave;
    l_url := 'scott.EMP_RPT.show?'| |
    'p_arg_names=empno&p_arg_values='
    | | l_empno;
    portal30.wwa_app_module.set_target(l_url, 'CALL');
    end;

  • Putting attribute value from java level into sessionScope variable?

    Hallo,
    is it possible to put an attribute value from java level into a sessionScope variable?
    For example when i'am in prepareSession is it possible to fill a sessionScope variable which i can use in a jspx-Site? And when how i must do it?
    Any help is appreciated.

    At the java level i make this
    private void setUserIdIntoUserDataHashtable() {
    Integer userid = getUserIdForLoggedInUser();
    Integer groupid = getGroupIdForLoggedInUser();
    Hashtable userdata = getDBTransaction().getSession().getUserData();
    if (userdata == null){
    userdata = new Hashtable();
    userdata.put(PBConstants.CURRENT_USER_ID, userid);
    userdata.put(PBConstants.CURRENT_GROUP_ID, groupid);
    And when i at the java level i can use the constants. But i don't have an interaction at this point. Thats why i don't now how to bring the values to a sessionScope variable i need later in a / some sites?

  • Showing all Characteristic values from Master Data in WebI report

    I want to show master data when there is no data in Cube, I have created constant variable with 1 value in Bex and I am using that in the crystal report but it's still not showing master data. Can anybody help me on this.
    Thanks,
    Ravi

    Hi Ingo,
    Thanks for your quick reply, I have created formula with constant value 1. Do I need to put that formula in rows or columns or as Free Char?
    Thanks,
    Ravi

  • All values from associative array into one variable

    Hello! Please:
    I have, for example:
    DECLARE
      TYPE tb1 IS TABLE OF INTEGER INDEX BY PLS_INTEGER;
      v4 tb1;
      variable1 myType; --varray of integers
    BEGIN
      v4(1)   := 34;
      v4(2)   := 46456;
      v4(100) := 54217:
      ...  --shortly -lot of values
    END;
    /How can I get all v4(x) values into variable1?
    something like:
    FOR i IN 1..v4.COUNT
    variable1 :=...don't know
    --to have this in the variable1: variable1:= myType(34, 46456, ..., 54217, ...);
    END LOOP;Thank You for answer!

    Is this you are looking for?
    create or replace type myType is varray(500) of number;
    DECLARE
    TYPE tb1 IS TABLE OF INTEGER INDEX BY PLS_INTEGER;
    v4 tb1;
    variable1 myType:=myType(); --varray of integers
    BEGIN
    v4(1) := 34;
    v4(2) := 46456;
    v4(3) := 54217;
    FOR i IN 1..v4.COUNT loop
    variable1.extend();
    variable1(i) := v4(i);
    END LOOP;
    FOR i IN 1..variable1.COUNT loop
    dbms_output.put_line(variable1(i));
    end loop;
    END;
    /

  • From which table I can get Vendor characteristic values ?

    Hi Everybody,
    From Which table I can get <b>Vendor Characteristic values from Vendor classification ?</b>
    Thanks & Regards,
    Nagaraju Maddi

    Hi
    Check the Tables
    CABN and AUSP
    or use the following
    Use the following BAPI's:
    BAPI_OBJCL_GETDETAIL
    or use the fun module:
    CLAF_CLASSIFICATION_OF_OBJECTS.
    Reward points for useful Answers
    Regards
    Anji

  • Concatenate characters to characteristic value enetered

    Hi,
    We need to concatenate some characters with the Cost Center data entered by users and populate the resultant data in another characteristic, for the same transaction record - this needs to be done before data is written to the cube.
    Some topics in the forum suggested using exit functions for similar problems. But how do we pass cost center (or for that matter any characteristic value)from the buffer to the function and pass the concatenated (or massaged) data back to the same record in the buffer.
    If not exit, what are the other options?
    Looking forward to advice and suggestions.
    Thanks in advance
    Krishna
    <b>RESOLVED</b>
    Message was edited by: krishna

    Hi Srini,
    Thanks for the quick response.
    The concatenation I mentioned is required in BPS while writing data into transactional infocube. The user would be entering the cost center data along with other planning information. We need to pick up the costcenter entered by the user and derive another characteristic.
    Since I cant have update rules, I'm left with the option of writing some exists.
    The new data will be in a Z info object - not linked to Cost Center in any way.
    Thanks again
    Krishna

  • Material Variant of a Config Material to take Charac. Values from Sales Ord

    Hello Guys,
    Is there any way to have a Material Variant for a Configurable Material to take the Characteristic values from a Sales Order instead of Material Master ?
    I understand by default Material Variant has fixed characteristic values and is taken from material master......
    however here is the situation am in.......
    I have a completely MTO scenario where we will making the product from scratch only after we know the characteristic values.......however our Costing Guys want to do standard cost estimate for the Configurable Material somehow......they were able to do Cost Rollup by making the Configurable Material itself as the Material variant of itself (assigning the same Configurable Material # in MRP3 view)............however this broke my design of taking characteristics from the Sales Order...because the Configurable Material is now behaving as Material Variant and taking the default characteristic values from the Material Master....
    Note: Our Costing guys donot want to cost settlement at Sales Order level.
    Regards,
    BRN.

    I had exactly the same problem. (configuration "blocked" in SO because the use of material variants for PC purposes...)
    SAP help says : To allow you to change the configuration of material variants in the sales order, the Configuration allowed or required indicator must be set in Customizing for Sales and Distribution. The requirements class is determined using the strategy group and requirements type defined in the material master.
    The req. class parameter, mentioned not very clearly by the SAP help, that allows changing the characteristic values of a material variant during the SO configuration is V_T459K-KONFI and value must be either * or +
    Hint: A quick check can be done In the SO entry: go to the procurement tab and replace your requirement type by KEL, you'll see that configuration is "open" 
    Hope this helps
    Iñaki
    Edited by: InakiGonzalez on May 11, 2009 8:08 PM
    Edited by: InakiGonzalez on May 11, 2009 8:15 PM

Maybe you are looking for

  • How to make a jar file downloadable with IE

    hello, I just bought a website: http://www.frozenfountain.net/ and I put a jar file on it called Logo.jar Using Mozilla, the jar file downloads as expected, but with Internet Explorer, it tries to download it as .zip file. How do I get it to download

  • FM to get the previous fiscal month

    Hi All, is ther any function module to calculate the previous fiscal month from the sy-datum. Tnhanks in Advanc Moderator message: date calculation questions = FAQ, please search before posting. locked by: Thomas Zloch on Sep 29, 2010 2:28 PM

  • Quicktime in Yosemite not showing chapter marks?

    Hi, If I open my video (made in Final Cut Pro X), I don't see chapter marks in Yosemite using Quicktime. If I open the same file in Quicktime on my Pc, chapter marks are showing perfectly. If I open then video in VLC, chapter marks are shown perfectl

  • Cost profile/function in SNP PPM

    Dear colleague,          i have created a cost function for a material with values 0-10 -- variable cost as 10 10-100 -- variable cost as 9. and i have attached this cost function to the PPM under cost profile but while running the SNP optimizer the

  • Cluster requirements

    I just need the minimal and cheapest configuration to learn Veritas Volume Manager and Sun Cluster features.I readed in Sun Cluster Admin Guide min. requirements are two nodes with 2 cpus each one and dont know if I can set up Clusters with two ultra