Using a variable inside another variable

I'm trying to use one two variable in a package with one variable feeding its value to another variable as follows:
Variable 1 = Count
Variable 2 = File_Name
Variable 1 counts up from 1;I would like to use this value as an input to Variable 2 as follows:
SELECT LOAD_FILENAME FROM DIMSTATS_FILENAME WHERE (SELECT ROW_NUMBER() OVER (Order by FILE_ID) AS RN FROM DIMSTATS_FILENAME) = #DIMSTATS_TEST.count.
How ever I am getting the following Error :
+ODI-1228: Task File_Name (Variable) fails on the target  connection DDBSTAGE.
Caused By: java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver][SQLServer]The multi-part identifier "#DIMSTATS_TEST.count" could not be bound.+
I have also noticed that the value of Variable 1 is not being passed to the Select statement above through SQLServer Profiler. If I hard-code the value of #DIMSTATS_TEST.count (Variable1) the query is successful.
How can I get the value of Variable 1 to be passed to Variable 2?
Could someone please help
Thanks

You did not mentioned how you are using those variable .
You need to have these variable inside a package .
It will be like
Variable 1 (Refresh) -------OK-------->Variable 2(Refresh) ------------OK-----> Some other operation .
Thanks,
Sutirtha

Similar Messages

  • Replacement Path Variable with Another Variable

    Hi,
    I am currently trying to create a report that would need me to have the same values for different characteristics (e.g. clearing date, posting date, net due date). I have seen that there is a way in the replacement path variable that would replace its value with another variable that is ready for input. I also looked into SAP help but I can't seem to figure out on how to do it specifically. Does anyone know a step-by-step process on how to do this? How does this work?
    Thank you in advance!

    take an e.g.
    u have characteristic say ch1
    u want to restrict it with replacement path variable
    first of all create a variable var1
    click what it is based upon for e.g. 0calday, 0material etc.
    make it user entry variable
    select single or multiple entry
    make it mandatory
    save it and hit okey
    click on ch1
    right click and say restrict
    in new window create a new variable
    give its name and technical name
    processing path is replacement path
    go to next tab of replacement path
    select several ooptions
    replace variable with another variable
    select a variable called var1
    change the offset length and offset start with different parameters.
    hit okey
    this way u have restricted ch1 with replacement path variable var1
    now when u run report u have to enter value of var1
    which will then further feeded to ch1
    this way u can create replacement path variables at lots of instances and then u can always feed the value from var1 at different time
    make sure as this ur requirement is date
    try to use 0calday as reference infoobject all the times....

  • Variable calling another Variable. NW2004s

    Can anyone tell me If this has changed in NW 2004s?  
    Back in May 2001 SAP issued a an ASAP "How to Paper"   on How to Derive a Variable Value from another Variable?   Is this still a valid document? This was valid for BW Releases 2.0B, and 2.1C If so, to what extent?
    Right now I have Functional Area we are using in SEM for Plan data. We are doing an a compare  Plan to actual data,  that uses BW Functional Area for Actuals.  When we enter the FA in the SEM template, we want it to call and populate the BW FA behind the scenes then execute the report.
    Also, have any of the Function Modules or User Exits for this changed?  Particularly RRS_VAR_VALUES_EXIT_AFTER
    Thanx and all help appreciated.
    -JM

    Andreas,
    Thank You.   BTW, I am an SAP Alum worked in NSQ 10 years and for Labs for 3 Mos.
    How's that for a small world.,,
    Best
    JM, or  I080860

  • Put variable into another variable

    Hi All~
    I am writing the following script:
    Add-Type -Path 'C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Smo.dll'
    get-content 'C:\SLDATA\Serverlist.txt'  | foreach-object {
    #write-output `n
    ###write "Server Name: $_"
    $SrvConn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
    $SrvConn.ServerInstance=$_
    #Use Integrated Authentication
    $SrvConn.LoginSecure = $true
    $SrvConn.ConnectTimeout = 1
    $srv = new-object Microsoft.SqlServer.Management.SMO.Server($SrvConn)
    $dbs += $srv.Databases
    $dbs | select name,onwer,size | Sort-object size
    clear-variable -Name dbs
    Then the output will be :
    Name               Owner              size
    master             sa                     1024
    master             sa                     2048
    tempdb             sa                    5000
    tempdb            sa                     6000
    if I want to add a output column of the server name like the following
    Servername     Name        Owner     Size
    Server1            master       sa           1024
    Server2            master        sa         2048
    Server1             master       sa         5000
    Server2            master        sa           6000
    how to re-write the script

    Try this:
    Add-Type -Path 'C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Smo.dll'
    $Servers = get-content 'C:\SLDATA\Serverlist.txt'
    foreach ($server in $servers) {
    #write-output `n
    ###write "Server Name: $_"
    $SrvConn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
    $SrvConn.ServerInstance=$_
    #Use Integrated Authentication
    $SrvConn.LoginSecure = $true
    $SrvConn.ConnectTimeout = 1
    $srv = (new-object Microsoft.SqlServer.Management.SMO.Server($SrvConn)).Databases
    $srv | Add-Member -type NoteProperty "Servername" $server
    $dbs += $srv
    $dbs | select servername,name,owner,size | Sort-object size
    clear-variable -Name dbs
    Assigning the get-content to a variable allows you to use the foreach ($server in $servers) so the server name is available at the end of the pipeline.  
    Assigning the .databases element to $srv instead of the whole object allows you to add the server property.
    Hope this helps!  I don't have a SQL instance to test...

  • Customer Exit - Reference value of variable in another variable

    Hi
    I am writing a query in BI7, i have a user entry variable V1 and a customer exit variable V2, both are on the version characteristic.
    I need to write some code that will do the following:
    If V1= 'WIP'
    V2 = 0
    ELSE
    V2 = V1
    End
    Any help would be appreciated.
    Thanks

    Hi Niel
    Thanks for the code, id already read the document but had had trouble trying to get it to work with my requirements, unfortunatley the code you gave me did not seem to be restricting the data, i made a few changes and set both the variables to ready for input and made the V1 variable (ZCUBVR03) default to 'WIP', i changed the code to step=1 and it works, when the variable screen pops up if WIP is default
    ZCUBVR03 = WIP
    ZCCFTEVR01 = 0
    or if default is 1
    ZCUBVR03 = 1
    ZCCFTEVR01 = 1
    This should happen after the variable screen when the user has entered ZCUBVR03, why is the code (below) not working when set to step 2?
    Any help would be appreciated
    Thanks
    WHEN 'ZCCFTEVR01'.
          IF I_STEP = '1'. "after the popup
              LOOP AT i_t_var_range INTO loc_var_range
              WHERE vnam = 'ZCUBVR03'.
                CLEAR l_s_range.
                IF loc_var_range-low = 'WIP'.
                  l_txtsh = '000'.
                ELSE.
                  l_txtsh = loc_var_range-low.
                ENDIF.
                  l_s_range-low = l_txtsh.
                  l_s_range-high = ''.
                  l_s_range-sign = 'I'.
                  l_s_range-opt = 'EQ'.
                  APPEND l_s_range TO e_t_range.
                EXIT.
              ENDLOOP.
              ENDIF.

  • Equating a passed variable to another variable??

    I have a simple 3 part setup as follows...
    1 JSP, 1 Java Class, 1 Interface for the class
    I want the JSP file to pass a variable to the java class which contains the name of a variable in the interface. (e.g. a String called "name", the variable name in the interface contains "Bob Smith") How do I get java to equate what is in the passed variable ("name") to what is contained in the name variable of the interface("Bob Smith"). Hopefully I explained this with enough detail to understand, but if I didnt, let me know.
    -Adam Wachtel

    Nevermind, I'm going to switch the flow of data so I dont have to do that.

  • How can i use one dtd inside another dtd

    Hello friends,
    I have read some where that one DTD can be imported into another DTD but idont remember how to do it.
    My question is suppose we have a DTD say xyz.dtd and i am writing a new DTD say abc.dtd, and lets assume that in abc.dtd i have to declare some of the elements of xyz.dtd, so iwant to import xyz.dtd into abc.dtd.
    Can anybody please give me a solution for this.
    Thank you,
    sridhar.

    something similar to this.
    // This is abc.dtd
    <!ELEMENT MESSAGE_NODE (MSGHEADER, MESSAGEBODY)>
    // Include the DTD for the Message Header
    <!ENTITY % MSGHEADER SYSTEM "xyz.dtd">
    %MSGHEADER;

  • How to reference a variable through another variable?

    say I have 2 Flex label components. one with the id = "flexComponent1" and the other "flexComponent2"
    how would i (using actionscript) refer to one or the other without strong typing it?
    something like this:
    var test:String = "flexComponent1";
    test.text = "hello";
    And I want the actual label of flexComponent1 to change to "hello"

    Maybe this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="init();">
      <mx:Script>
        <![CDATA[
          private function init():void{
            var test:* = flexComponent1;
            test.text = "hello";       
        ]]>
      </mx:Script>
      <mx:Label id="flexComponent1"/>
    </mx:Application>
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • C:forEach tag inside another c:forEach tag

    Hi,
    I've got en error when I tried to use <c:forEach> inside another <c:forEach> to display a vector of String arrays.
    The error message is:
    javax.servlet.ServletException: The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer.
    The concerned section of the javabean mybean.java is:
    //connect to database to get the resultset
    ResultSet rs = cst.getResultSet();
    if (rs != null) {
    myVector = new Vector();
    while (rs.next()) {
    String myArray[] = new String[10];
    myArray[0]=rs.getString(1);
    myArray[1]=rs.getString(2);
    myArray[9]=rs.getString(10);
    myVector.addElement(myArray);
    rs.close()
    The concerned jsp calling the bean is:
    <jsp:useBean id="theBean" scope="session" class="mybean" />
    <jsp:setProperty name="theBean" property="..." />
    <%
    Vector myVector=theBean.getResultFromDatabaseIntomyVector();
    pageContext.setAttribute("myVector",myVector);
    %>
    <table>
    <c:forEach var = 'vectorItem' items='${myVector}'>
    <tr>
    <c:forEach var = 'arrayItem' items='${vectorItem.value}'>
    <td><c out value='${arrayItem}'/></td>
    </c:forEach>
    </tr>
    </table>
    Can anyone show me what's the right jsp for displaying a vector of String arrays?
    Thanks in advance.
    Geraldine

    I think your problem is with the second forEach loop.
    The first for loop goes through the items in "myVector"
    Each item "vectorItem" should be of type String[]
    Accessing ${vectorItem.value} is what creates the error.
    JSTL converts this as
    vectorItem["value"] , can't turn the string "value" into an integer (to use as an array index) and thus throws an error.
    To fix: use ${vectorItem} rather than ${vectorItem.value}
    (nb you would use {vectorItem.value} if you were iterating over a Map, as the iterator exposes an object of type Map.Entry
    Also in your code, I only see one closing tag for a forEach.
    I think it should be like this (indented for readability)
    <table>
    <c:forEach var = 'vectorItem' items='${myVector}'>
    <tr>
      <c:forEach var = 'arrayItem' items='${vectorItem}'>
        <td><c out value='${arrayItem}'/></td>
      </c:forEach>
    </tr>
    </c:forEach>
    </table>Cheers,
    evnafets

  • How  to trace() a variable nested inside another clip that is created at run time by the user ???

    Hi again Now i have another problem
    i explain :  on my stage i have 24 instance MC Page created at runtime (when cliked the button execute 24 instance MC Page from the library). Each of those MC Page create an xml  with infos (not important), this variable_XML created is nested inside each MC Page.. From my stage i want to call each XML from each MC Page  for make 1 unic  big xml, then send it to the server.
    So from the main stage i created a button that call each xml of each MC Page (there is a definit number of Page only 24, no more, no less). So
    when the 24 instances of the MC Page are created I push there instance name inside an Array "Page_Array". Now in my function exportxml
    i use get ChildByName(Page_array[number]) for find them then i can apply my method to the according MCPage.. Until here no problem, trace(dispObject.name) work. but when i try to get my variable inside the MC Page : trace(dispObject.my_variableXML), it doesnt work...Why ??
    here is my function (only 1 page for this example ):
    function exportxml(evt:MouseEvent):void {
        dispObject=getChildByName(Page_Array[0]);
        trace(dispObject.name); //trace  Page1
         trace(dispObject.my_variableXML);// here it dont trace the variableXML
    normally if i trace(Page1.my_variableXML); , it should trace "my_varableXML"  no ??

    when i export my movies Im so worried  to see if it work that  i clicked the button that trigger the function exportxml before the actual my_variableXML is created , so is normal that the code above didnt work... so all is normal and it work... sorry i will think 10 time before posting next time. promess .

  • How to access a variable from inside another symbol

    So i did this tutorial, Leveraging Independent Symbol Timelines created by Eliane...it's rockin, btw.  ;-)
    All's well but now i have a symbol on the stage called mc-home.  inside of mc-home is a button called btn-go.
    On the stage in composition ready there's a variable sym.setVariable("current", "mc-home");
    This code works for a symbol that's on the stage but, how do i get this code to work on a button that's inside another symbol that's on the stage?
    var current = sym.getVariable("current");
    if (current != "") {
        sym.getSymbol(current).play("OUT");
    sym.getSymbol("mc-something").play("IN");
    sym.setVariable("current", "mc-something");

    sorry, i was kind of confused myself too, don't worry about it but thanks for your patience for reading it anyway

  • How to use one variable as a default value for another variable?

    Hi Experts,
    Is it possible to use one variable as a default value for another variable?
    For example:
    Variable 1 = current calendar year month
    Variable 2 = mandatory input ready variable for calendar year month
    I want to use variable 1 as default value for variable 2, but also have the ability to change the month if required.
    Thanks!
    Kathryn

    u can use replacement path variable
    in that case u can replace the values of 1 variable with the another variable...
    but  u cannot do this setting
    u cannot make variable 2 as mandatory
    u cannot enter value for variable 2
    because by default it will take the value of variable 1
    u have to make follow settings
    variable 2
    name , technical name
    processing by = replacement path
    infoobject = ocalmonth
    next tab
    replaced by another variable
    variable name
    offset start , offset lenght
    save and hit okey

  • How to use the value of a variable to set another variable

    Hello Experts,
    Is it possible to access the value of variable set by the user and set the default value of another variable using the user entered value for the first variable? Example:
    Date variable
    Week variable
    Month variable
    User enters one of those and the other two are automatically prefilled with the correct values?
    Thanks
    Rado

    Hi Rado,
    Gothrough following code
    Which reads year from user input and converts it to factory calendar week , following which you should able to convert user inputs to required parameters.
    DATA:  v_year1 TYPE i,
            v_int   TYPE i,
            v_week1 TYPE kweek,
            v_qurt  TYPE i,
            v_perd  TYPE /bi0/oifiscper,
            v_iweek TYPE i,
            v_periv TYPE periv VALUE 'Z4'.
    DATA : v_vweeks  TYPE /bi0/oicalweek,
            v_vperd   TYPE /bi0/oifiscper,
            v_vperiv  TYPE /bi0/oifiscvarnt VALUE 'Z4'.
    DATA : vit_weeks LIKE /bi0/scalweek OCCURS 0 WITH HEADER LINE.
    DATA : v_perd1   TYPE umc_y_fiscper,
            v_weeks   TYPE umc_ys_dimvals,
            v_pweeks  TYPE i.
    CASE i_vnam.
       WHEN 'WPIYWEEK'.                "Variable name of char. in Bex
    *Check for Step 2 (After user gives inputs on selection screen)
         CHECK i_step = c_after.                                "Step:2
         CLEAR :  v_year1,
                  v_week1,
                  v_iweek.
    *Read the value of variable which used has entered on sel. screen
         READ TABLE i_t_var_range INTO wa_var_range
                                     WITH KEY vnam = 'WPIFYEAR'.
         v_year1 = wa_var_range-low.
         CALL FUNCTION 'TIME_GET_LAST_WEEK'
           EXPORTING
             if_year     = v_year1
           IMPORTING
             ef_week     = v_week1
           EXCEPTIONS
             fatal_error = 1
             OTHERS      = 2.
         IF sy-subrc <> 0.
    *           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
    *Get the no. of week from YYYYWW format
         v_iweek = v_week1+4(2).
         l_s_range-low  = v_iweek.
         l_s_range-sign = c_include.
         l_s_range-opt  = c_equal.
         APPEND l_s_range TO e_t_range.  "This is the output structure in which u have to add the result
    Endcase.
    Hope that helps.
    Regards
    Mr Kapadia
    Assigning points is the way to say thanks in SDN.

  • Using a variable from another class

    hello friends, I have a class with the follow variable: dbcolTempMax, and the value of this variable I need in another class, how can do to use the value of the variable...thanks

    Both people above described the solution, but from the question I take it you are somewhat new to programming. Let me give you a code example which may help.
         public class ClassWithVariable {
              private int dbcolTempMax;
              public int getDbcolTempMax() {
                   return dbcolTempMax;
         public class SomeOtherClass {
              ClassWithVariable cwv = new ClassWithVariable();
              cwv.getDbcolTempMax(); // This gets the value of the variable
         }Now if the variable is static, you can provide a static "accessor" method to ge the variable. This will save you the trouble of constructing an object of the class.
    Cheers,
    Cypher

  • Using a variables value as the name of another variable

    Hi, i'm new to java and i've been trying to write a little program. I was wondering whether it is possible to use the value of a variable as the name of another variable.
    This is what i have so far: When i run my java program numerous Animal objects are created with names like ani01, ani02, ani03. These objects have functions like getName() etc. When i type in one of these codes into the command line it gets stored in a variable called 'input'. Everything's fine up to here.
    But i need a way to access the correct Animal from my input. instead of doing countless switch statements on the input.
    If i type "ani02" i want it to return the animals name by calling ani02.getName()...
    how do i do this? i'd appreciate any help. thanks.

    If you were doing this based on user input, then you
    wouldn't have to do a lot of typing. Mmm?I'm sorry i don't get your meaning... ? I am doing this based on user input am i not?
    All i want to do is access the correct Animal object depending on the user's input... so if they type in ani01 it would return 'Elephant' (or whatever) using ani01.getName().
    Maybe i'm going about this the wrong way or something?.. I have about 30 animals. they each have a name, continent, quantity. I have an Animal class that has functions like getName(), setName() etc. When the program starts, 30 objects are created
    Animal ani01 = new Animal("Elephant",3000,"India");
    Animal ani02 = new Animal("Panda",200,"China");etc...
    I want to be able to get information about any one of these animals by typing something at the command line...
    so i type in something (i just thought the name of the object would be the best thing to type in) and i get the info about elephants (or whatever) from the relevant object.
    how would you do this?

Maybe you are looking for

  • In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

  • HP Laserjet 1100 - print fails

    Hi I have an OLD HP Laserjet 1100 which I used to be able to print from fine on my old XP (SP2) machine. I have recently set the printer up on a new laptop running XP (SP3) using a parallel to USB converter. It's using the same drivers. However, now,

  • Using iPhoto after photo transfer

    As a novice to Mac, I have recently learned how to transfer photos into iPhoto from my mobile. However, once imported my photographs are smaller than normal screen size. Can they be edited to full screen size. I have tried increasing the slider to ma

  • I cannot set up a blue tooth connection between my apple ipod and phone

    I cannot set up a bluetooth connection between my apple ipod touch and an external speaker wirelessly. The speaker is a boombar and although I have been able to set  it up successfully between the speaker and my iphone, I have not been able to set it

  • Need explanation .pl file

    Hi, I have the .pl file it is not calling any where by the program,but it is transfering the oracle viewoutput file to another data_top. how is it possible. can any body explain me the below file how it is working. Thanks in advance. this is the code