Assigning value to variable within Range

The Problem:
Range of values permitted is 10 < x < 30. x starts at 20. Variable x increments by 5, on a button click, until it reaches 30, at which point it should decrement by 5, until it reaches 10, before moving up the range again... and so on.
I'm sure this is quite simple, but it's been bugging me for hours... the following simple increments by 5.
How would I include range constraint. please some help.
void jButton_mouseClicked(MouseEvent e) {
int r = aBall.radius();
aBall.rad = r + 5;
repaint();
}

You're right, perhaps, nasch_.
When I was starting out, I learned a lot from looking at code and then figuring out how to adapt it. Perhaps I have denied the OP this opportunity.
To learn more from the code I posted, OP, don't just copy and paste it. As nasch_ was pointing out, you absolutely must learn how to translate requirements in English (or language of your choice) into code. If-statements ar crucial elements. Look at the code and figure out how it matches your requirements. Think about what you have to do logically - When the size would be less than 10, you need to grow instead of shrink... etc. Write out (or at least think out) every scenario that your code has to react to. Size would be in range, size would be too large, size would be too small, ball is growing, ball is shrinking, etc. Make every possible combination and figure out how you must react.
When your logic is hammered out like that, in natural language, start converting to logic. You see that your code has to remember whether your Ball is growing or shrinking. Your Ball should know it's minimum and maximum size (which my code ignores, making it less flexible). Turn your scenarios into If-statements. Your first code could have way too many If-elses, but get it to work, and then refine it by combining and nesting statements.
Don't ever just copy and paste code. You won't learn how to do anything yourself. Learn from code you see. Take this opportunity to not just solve the immediate problem, but to realize that this is an area of your skills that needs improvement and follow through on improving it.
-- end soapbox

Similar Messages

  • Assigning value to variable in ODI

    Hi
    TotalCount(datatype is numeric)--->Action is (Latest value)
    And i want to assign value it by using following query
    select count(*) from Investment_ato
    i am writing this in a refresh tab
    And i am using this variable in another variable(var_account)
    but value of TotalCount variable is not coming in var_account
    so plz suggest regards the same
    thanks

    You can set the refreshing mode in the variable var_account and in the refreshing tab put the query as: select #TotalCount from dual.
    Hope it helps!

  • Assigning value to variable of type time

    Hi,
    I want to assign value '8:00:00' to a time variable (w_time like sy-uzeit).
    How do i do this? Do i need to do any casting?
    w_time = '8:00:00' didnt work.
    I am trying to use this in a customer exit.
    Thanks,
    Arun KK

    Gotcha!
    Thanks!!

  • Assigning Value to Variable in Sapscript

    Hi,
    To initialized value of the variable when I tried to assign 0 to variable (like in the following statement) it comes up with error 'Command Expected'.
    &RF140-ZALBT&= '0'.
    Please let me know where and what I am doing wrong in assigning value to a variable?
    Regards,
    Shabbar

    Hi,
    Still its not working. The statement I am writing is
    /: &NET& = &RF140-WRSHB& - &RF140-MSATZ&
    but the system gives error on that.
    NET is the local variable declared with Define statement and both the others are defined in print program.
    Even I tried
    /: &RF140-ZALBT& = &RF140-WRSHB& - &RF140-MSATZ&
    but still the same error.
    Any comments?
    Regards,
    Shabbar

  • Assign values based on data range

    Hi
    I am trying to fix a query that I ahve been left with from a previous developer.
    The basis of it are that I have 2 views, one which is effectively a date calendar with users per date, and the 2nd being values assigned between a 2 date ranges.
    here is sample data
    create table #hours (
    Fee_earner_Code int not null
    ,startdate date not null
    ,enddate date not null
    ,hours decimal (17,2) not null
    insert into #hours values (1132,'2011-06-01','2020-01-01',6.00)
    insert into #hours values (1132,'2011-06-07','2011-06-01',4.00)
    insert into #hours values (1132,'2012-06-09','2011-06-07',12.00)
    insert into #hours values (2345,'2011-06-01','2020-01-01',3.00)
    insert into #hours values (2345,'2011-06-06','2011-06-01',9.00)
    insert into #hours values (2345,'2012-06-10','2011-06-06',5.00)
    create table #dates (Fee_earner_Code int not null
    ,Primary_date date not null
    insert into #dates values (1132,'2011-06-01')
    insert into #dates values (1132,'2011-06-02')
    insert into #dates values (1132,'2011-06-03')
    insert into #dates values (1132,'2011-06-04')
    insert into #dates values (1132,'2011-06-05')
    insert into #dates values (1132,'2011-06-06')
    insert into #dates values (1132,'2011-06-07')
    insert into #dates values (1132,'2011-06-08')
    insert into #dates values (1132,'2011-06-09')
    insert into #dates values (1132,'2011-06-10')
    insert into #dates values (1132,'2011-06-11')
    insert into #dates values (1132,'2011-06-12')
    insert into #dates values (2345,'2011-06-01')
    insert into #dates values (2345,'2011-06-02')
    insert into #dates values (2345,'2011-06-03')
    insert into #dates values (2345,'2011-06-04')
    insert into #dates values (2345,'2011-06-05')
    insert into #dates values (2345,'2011-06-06')
    insert into #dates values (2345,'2011-06-07')
    insert into #dates values (2345,'2011-06-08')
    insert into #dates values (2345,'2011-06-09')
    insert into #dates values (2345,'2011-06-10')
    insert into #dates values (2345,'2011-06-11')
    insert into #dates values (2345,'2011-06-12')
    for the table #hours the end date is alway the previous rows startdate unless it is the 1st row per fee_earner_Code then it is assigned '2020-01-01' (this date can be change as it is just another view)
    I would like to apply the #hours hours value to the appropriate date range in #dates per fee-earner-code
    my expected ouput would be
    1132,2011-06-01,6.00
    1132,2011-06-02,6.00
    1132,2011-06-03,6.00
    1132,2011-06-04,6.00
    1132,2011-06-05,6.00
    1132,2011-06-06,6.00
    1132,2011-06-07,4.00
    1132,2011-06-08,6.00
    1132,2011-06-09,12.00
    1132,2011-06-10,12.00
    1132,2011-06-11,12.00
    1132,2011-06-12,12.00
    2345,2011-06-01,3.00
    2345,2011-06-02,3.00
    2345,2011-06-03,3.00
    2345,2011-06-04,3.00
    2345,2011-06-05,3.00
    2345,2011-06-06,9.00
    2345,2011-06-07,9.00
    2345,2011-06-08,9.00
    2345,2011-06-09,9.00
    2345,2011-06-10,5.00
    2345,2011-06-11,5.00
    2345,2011-06-12,5.00
    Any help would be great

    With SQL Server 2012's Windows functions, this becomes easy. We can use it to fix the data in your hours table:
    DECLARE @hours TABLE (Fee_earner_Code int not null, startdate date not null, enddate date not null, hours decimal (17,2) not null)
    INSERT INTO @hours (Fee_earner_Code, startdate, enddate, hours) VALUES (1132,'2011-06-01','2020-01-01',6.00),(1132,'2011-06-07','2011-06-01',4.00),(1132,'2012-06-09','2011-06-07',12.00),(2345,'2011-06-01','2020-01-01',3.00),(2345,'2011-06-06','2011-06-01',9.00),(2345,'2012-06-10','2011-06-06',5.00)
    DECLARE @dates TABLE (Fee_earner_Code int not null, Primary_date date not null)
    INSERT INTO @dates (Fee_earner_Code, Primary_date) VALUES (1132,'2011-06-01'),(1132,'2011-06-02'),(1132,'2011-06-03'),(1132,'2011-06-04'),(1132,'2011-06-05'),(1132,'2011-06-06'),(1132,'2011-06-07'),(1132,'2011-06-08'),
    (1132,'2011-06-09'),(1132,'2011-06-10'),(1132,'2011-06-11'),(1132,'2011-06-12'),(2345,'2011-06-01'),(2345,'2011-06-02'),(2345,'2011-06-03'),(2345,'2011-06-04'),
    (2345,'2011-06-05'),(2345,'2011-06-06'),(2345,'2011-06-07'),(2345,'2011-06-08'),(2345,'2011-06-09'),(2345,'2011-06-10'),(2345,'2011-06-11'),(2345,'2011-06-12')
    ;WITH fixHours AS (
    SELECT *, DATEADD(DAY,-1,LEAD(startDate) OVER (PARTITION BY Fee_earner_code ORDER BY startDate)) AS realEndDate
    FROM @hours h
    SELECT h.Fee_earner_Code, d.Primary_date, h.hours
    FROM fixHours h
    LEFT OUTER JOIN @dates d
    ON d.Primary_date BETWEEN h.startDate AND realEndDate
    Without it, we need to do a self join to acheive the same end:
    DECLARE @hours TABLE (Fee_earner_Code int not null, startdate date not null, enddate date not null, hours decimal (17,2) not null)
    INSERT INTO @hours (Fee_earner_Code, startdate, enddate, hours) VALUES (1132,'2011-06-01','2020-01-01',6.00),(1132,'2011-06-07','2011-06-01',4.00),(1132,'2012-06-09','2011-06-07',12.00),(2345,'2011-06-01','2020-01-01',3.00),(2345,'2011-06-06','2011-06-01',9.00),(2345,'2012-06-10','2011-06-06',5.00)
    DECLARE @dates TABLE (Fee_earner_Code int not null, Primary_date date not null)
    INSERT INTO @dates (Fee_earner_Code, Primary_date) VALUES (1132,'2011-06-01'),(1132,'2011-06-02'),(1132,'2011-06-03'),(1132,'2011-06-04'),(1132,'2011-06-05'),(1132,'2011-06-06'),(1132,'2011-06-07'),(1132,'2011-06-08'),
    (1132,'2011-06-09'),(1132,'2011-06-10'),(1132,'2011-06-11'),(1132,'2011-06-12'),(2345,'2011-06-01'),(2345,'2011-06-02'),(2345,'2011-06-03'),(2345,'2011-06-04'),
    (2345,'2011-06-05'),(2345,'2011-06-06'),(2345,'2011-06-07'),(2345,'2011-06-08'),(2345,'2011-06-09'),(2345,'2011-06-10'),(2345,'2011-06-11'),(2345,'2011-06-12')
    ;WITH fixHours AS (
    SELECT h.*, DATEADD(DAY,-1,h1.startdate) as realEndDate
    FROM @hours h
    INNER JOIN @hours h1
    ON h.Fee_earner_Code = h1.Fee_earner_Code
    AND h1.startdate = (SELECT MIN(startDate) FROM @hours WHERE h1.Fee_earner_Code = Fee_earner_Code AND h.startdate < startDate)
    SELECT h.Fee_earner_Code, d.Primary_date, h.hours
    FROM fixHours h
    LEFT OUTER JOIN @dates d
    ON d.Primary_date BETWEEN h.startDate AND realEndDate

  • Catch-22: need to assign a local variable within an anonymous class

    static boolean showMessage(Window parent, String button0, String button1)
        throws HeadlessException {
              final Window w = new Window(parent);
              Panel p = new Panel(new GridBagLayout());
              final Button b[] = new Button[]{new Button(button0), (button1 != null) ? new Button(button1) : (Button)null};
              boolean rval[]; //tristate: null, true, false
              w.setSize(100, 50);
              w.setVisible(true);
              //add b[0
              gbc.fill = GridBagConstraints.HORIZONTAL;
              gbc.gridx = 0;
              gbc.gridy = 3;
              p.add(b[0], gbc);
              //add b[1]
              if (button1 != null) {
                   gbc.fill = GridBagConstraints.HORIZONTAL;
                   gbc.gridx = 1;
                   gbc.gridy = 3;
                   p.add(b[1], gbc);
              w.add(p);
              w.pack();
            w.setVisible(true);
            //actionListener for button 0
              b[0].addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                             if (e.getSource() == b[0]) {
                                  w.setVisible(false);
                                  rval = new boolean[1];
                                  rval[0] = true;
              //actionListener for button 1
              if (button1 != null) {
                   b[1].addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent e) {
                                  if (e.getSource() == b[1]) {
                                       w.setVisible(false);
                                       rval = new boolean[1];
                                       rval[0] = false;
            while (true) {
                 try {
                      if (rval[0] == true || rval[0] == false) //should trigger NullPointerException
                           return rval[0];
                 } catch (NullPointerException e) { }
         }catch-22 is at
    rval = new boolean[1];
    rval = false;javac whines: "local variable rval is accessed from within inner class; needs to be declared final"
    How do I assign to rval if it's declared final?
    Or at the very least, how do I get rid of this error (by all means, hack fixes are okay; this is not C/C++, I don't have to use sanity checks)?
    I'm trying to make a messagebox in java without using JOptionPane and I'm trying to encapsulate it in one method.
    And I'm far too lazy to make a JNI wrapper for GTK.

    dcminter wrote:
    How do I assign to rval if it's declared final?You don't and you can't. You're not allowed to assign to the local variable of the outer class for extremely good reasons, so forget about trying.
    Or at the very least, how do I get rid of this errorIf you don't want the side effect, then just use an inner class variable or a local variable.
    If you want the side effect then use a named class and provide it with a getter and setter.
    Finally, in this specific case because you're using an array object reference, you could probably just initialise the array object in the outer class. I.e.
    // Outer class
    final boolean[] rval = new boolean[1];
    // Anonymous Inner class
    rval[0] = true; // No need to intialize the array.
    I declared it as an array so that it would be a tristate boolean (null, true, false) such that accessing it before initialization from the actionPerformed would trigger a NullPointerException.
    Flowchart:
    is button pressed? <-> no
    |
    V
    Yes->set and return
    Is there a way to accomplish this without creating a tribool class?

  • Read XML in BPEL and assign values to variables

    Hello,
    I need to read an xml message in BPEL and assign variables created in BPEL the values of elements in XML message. Whats the best possible way to do this.

    When you say"*read an xml message*", is the xml coming as input message or you need to read from file ?
    If you want to read from file, you can make use of the below function.
    Returns the string value of an element defined by lookupXPath in a XML file (docURL) given its parent XPath (parentXPath), the key XPath (keyXPath) and the value of the key (key). Usage: oraext:lookup-xml(docURL as string, parentXPath as string, keyXPath as string, lookupXPath as string, key as string)
    Example: oraext:lookup-xml('file:/d:/country_data.xml', '/Countries/Country', 'Abbreviation', 'FullName', 'UK') returns the value of the element FullName child of /Countries/Country where Abbreviation = 'UK' in the file d:\country_data.xml
    Thanks,
    Vijay

  • Define and assign values to variables in calc manager

    Hi all,
    I have created a smartlist in data form for user to select the start month and end month.In BR,based on the smartlist ID,i need to assign the months to a variable,which i will later use it in the same BR.
    For Eg:In data form,from the smartlists,user has choosen "Jul" for start month and "Nov" for end month,hence the smartlist ID is 7 for start month and 11 for end month.Now in calc manager,i have created 2 variables as "DateFrom" and "DateTo" of type "member" for dimension "Period"
    Note: "Jan" to "Dec" are period dim level 0 members
    IF(start month==1)
    DateFrom="Jan";
    ELSEIF(startmonth==2)
    DateFrom="Feb";
    ELSEIF(start month==7)
    DateFrom="Jul";
    ELSE
    DateFrom="Dec";
    ENDIF;
    Similarly for end month as below:
    IF(end month==1)
    DateTo="Jan";
    ELSEIF(end month==11)
    DateTo="Nov";
    ELSE
    DateTo="Dec";
    ENDIF;
    Above method of assigning a value to a variable is not working and no values assigned to the 2 variables "DateFrom" and "DateTo"
    Kindly help me on any additional steps required to use variables in calc manager.
    Thanks!

    Cant you use the values from RTP directly? What is the logic you are trying to build?
    One of the ways to achieve this is to use Calc TP Index member, if you are not sure of this, create a workforce application and you will get the formula for calc TP index member in Essbase.
    Edited: I just checked other question from you, will revert on that in some time.
    Cheers..!!
    Rahul S.

  • Any way to assign value for  variable of type Class List String ?

    I'm puzzled why I can declare a variable:
    Class<List<String>> clazz;but I cannot assign a value to it as
    clazz = List<String>.class;The compiler also complains about
    Class<List<?>> clazz0 = List<?>.class;yet it has the nerve to warn about raw types when I give up and use
    Class<List> clazz0 = List.class;Even using a dummy instance does not work.
            List<String> dummy = new ArrayList<String>();
            Class<List<String>> clazz1 = dummy.getClass();I only care because I've declared a method like
    public String useless( Class<List<String>> unSetable){
      return  unSetable.getName();
    }And now there seems to be no way to call it.

    Hello chymes,
    there is no way to get an instance of Class<List<String>> without at least one unchecked warning. Otherwise you could get away with the following:
    List<Integer> ints = new ArrayList<Integer>();
    Class<List<String>> clazz = List<String>.class;
    List<String> strings = clazz.cast(ints);
    strings.add("No Good");
    int i = ints.get(0); // CCETherefore the only way to get it is via unchecked cast:
    Class<List<String>> clazz = (Class<List<String>>) (Object) List.class;With kind regards
    Ben

  • Assigning value to variable defined as LOCAL in standard program

    Hello Gurus,
    We have a Z function module which gets called via standrad SAP program. Now inside this Z FM we have to code such that it updates an internal table defined via LOCAL in program LQEEMF72 (Main program SAPLQEEM). Is this possible ?
    I tried following :
      DATA gt_qasptab TYPE qaspr OCCURS 0.
      FIELD-SYMBOLS: <qasptab>.
      ASSIGN ('(SAPLQEEM)QASPTAB[]') TO <qasptab>.
      gt_qasptab[] = <qasptab>.
    and at the end
    ASSIGN gt_qasptab[] TO <qasptab>.
    This does not work. How to update the table QASPTAB ?
    Please provide your suggestions ....
    Thanks in advance <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Dec 28, 2007 8:26 AM

    Hi tushar,
    I'm very sorry I can't reallly help you if you don't describe your process at all.
    The include you mentioned is not part of an SAP program but a FORMS include of a SAP function group.
    In this function group QEEM SAP provides lots of userexits:
    EXIT_SAPLQEEM_001 Customer Function for Calculating Formulas in Results Recording          
    EXIT_SAPLQEEM_002 Customer Function: Add. Fns for Importing Insp. Chars in Results Recording
    EXIT_SAPLQEEM_003 Customer Function: Add. Functions After Valuating Insp. Characteristics  
    EXIT_SAPLQEEM_004 Customer Function: Add. Functions After Valuating Partial Samples        
    EXIT_SAPLQEEM_006 Customer Function: Add. Functions After Closing Insp. Characteristics    
    EXIT_SAPLQEEM_007 Customer Exit: Additional Functions After Closing Partial Samples        
    EXIT_SAPLQEEM_011 Customer Function: Add. Functions Before Valuating Insp. Characteristics 
    EXIT_SAPLQEEM_012 Customer Function: Additional Functions Before Valuating Partial Samples 
    EXIT_SAPLQEEM_015 Customer Function: Add. Functions After Entering Individual Results      
    EXIT_SAPLQEEM_020 Customer Function: Additional Functions After Entering Inspector         
    EXIT_SAPLQEEM_021 Customer Function: Add. Functions for User Key +US1 (Char. Single Screen)
    EXIT_SAPLQEEM_022 Customer Function: Add. Functions for User Key +US2 (Char. Single Screen)
    EXIT_SAPLQEEM_023 Customer Function: Add. Functions for User Key +US3 (Char. Single Screen)
    EXIT_SAPLQEEM_024 Customer Function: Add. Functions for User Key +US4 (Char. Single Screen)
    EXIT_SAPLQEEM_025 Customer Function: Add. Functions for User Key +US1 as Pushbutton        
    EXIT_SAPLQEEM_026 Customer Function: Add. Functions for User Key +US2 as Pushbutton        
    EXIT_SAPLQEEM_027 Customer Function: Add. Functions for User Key +US3 as Pushbutton        
    EXIT_SAPLQEEM_028 Customer Function: Add. Functions for User Key +US4 as Pushbutton        
    EXIT_SAPLQEEM_029 Customer-Function for Subscreen Characteristic Overview                  
    EXIT_SAPLQEEM_030 Customer Function for Subscreen Characteristic Single Screen             
    EXIT_SAPLQEEM_031 Customer Function Creating Table with External Numbers                   
    EXIT_SAPLQEEM_032 Customer Function Characteristic Text in Logon Language                  
    Try one of them.
    Regards,
    Clemens

  • Assigning value to an item

    Is there a way to assign value to variable
    of data type ITEM? In other words, I need to
    assign value to an item, where I just know the
    it_id.
    In the following procedure p_item is unknown until runtime;
    and if it_id is not null then assign some value to the item.
    procedure update_item(p_item)
    is
    it_id item := find_item('block1.'||p_item);
    if not id_null(it_id) then
       it_id := 'some_value';  --doesn't work.
    end if;
    end;

    Do you mean you know the name of the item and you want to then assign a value?
    If so then use the COPY command which allows you to assign a value to a named variable
    e.g.
    COPY (12345, 'blocka.number_item1');
    To read the value in the same way use the NAME_IN function.
    There is plenty in the forms helps about this.
    Mark

  • # value in Variable Selection screen

    Hello,
              Can you please help with the below:
    How do we remove # (Not Assigned) value from Variable selection screen. When I select PLANT in one of the  report, I see # value. But there are no empty values in the cube. So, I am not sure as why I am getting this # value in Selection Screen.  The seeting in Web designer for READ MODE is "Posted Values" and  not  "Master data or Dimension Table".
    Thanks.

    have you checked what Bex properties are set in the Info Object for "Query Def. Filter Value S"
    Select Values from Info provider.
    that might solve your problem. But ensure you're not disturbing anything else by changing this property.
    Regards, Siva
    Message was edited by:
            Siva Bonam

  • Default value for variable are not within permitted value range (precalc)

    Hello BW community
    Issue:
    I have created a variable (Characteristic Value/ Manual input-default value) and use the precalculated value set (details-basic settings). In the further variable definition I could select the  precalculated value set in 'Default values', which I have defined beforehand in the broadcaster..
    The precalculated value set in the broadcaster settings is just based on a master data query on 0CUSTOMER.
    Error:
    The variable gets the error E991/R9E Errors: Default values for variable 'XXX' are not within permitted value range.
    The detail description of the error is: You defined default values for variable 'Sold-to party precalc value set for manuel input' that are not appropriate for the variable type; for example, a range is defined as a default value for a variable that only permits a single value.
    So please has someone had the same issue and found out how to solve it? It would be excelent to get good solution for this issue.
    Best regards and thanks
    Christian
    PS-1: System BW 701 / SAPKW70105
    PS-2 : there has been a SDN entry with the same topic but not resolved too.
    link: /thread/980839 [original link is broken]

    Hello,
    Thanks for your response.
    I should have mentioned that in my post. I tried this very first time. I thought that this is the place where you provide default value. But I got following exception at that time, so I thought, may be this is used for something else.
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    javax.faces.FacesException: javax.servlet.ServletException: OracleJSP error:
    oracle.jbo.NameClashException: JBO-25001: Object viewAllInd of type Control Binding Definition already exists.
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:415)Do I need handle something else when you put the default value?
    Thanks,
    Jai

  • Assigning value to array type variable in a loop

    Hi
    I have a scenario in which i am assigning value from a array type variable(x) to the invoke variable of a database adapter. The variable x is exact replica of the invoke variable.
    My copy operation in assign activity looks like this-
    <copy>
    <from variable="Var" part="InputParameters"
    query="/ns7:InputParameters"/>
    <to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
    part="InputParameters"
    query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
    </copy>
    It is inside a while loop activity.
    PS *()* are square brackets
    But it is erroring out at run time.
    Does anybody has an alternate idea to assign value to an array type?.
    i have seen that while extracting value from an array type variable it works fine
    A similar kind of operation is shown below.
    <copy>
    <from variable="Var" part="InputParameters"
    query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
    <to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
    part="InputParameters"
    query="/ns7:InputParameters"/>
    </copy>
    Thanks
    Ayush
    Edited by: Ayush fujitsu on Aug 14, 2009 4:36 AM

    Hi Ayush
    I suppose you are getting some error like "source node returns multiple elements".
    In second case there is no problem because you are assigning *InputParameters[bpws:getVariableData('iterator')]* (+suppose InputParameters[1]+) to target. Here it works fine because you are fetching oonly 1 value from source and assigning it to the target.
    Now in first case you are saying copy InputParameters to target[1] suppose. You know that source is an array which contains multiple index so which index field from the source will be assigned to the target.
    Try your process with only 1 source value it will work but when multiple values will be there it will fail. You have to merge both the cases and it will look like
    *<copy>*
    *<from variable="Var" part="InputParameters"*
    query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
    *<to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"*
    part="InputParameters"
    query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
    *</copy>*
    And the easiest way to do this is by the transform activity as said above.
    Regards
    Suryaveer
    Edited by: Suryaveer on Aug 15, 2009 11:19 PM

  • Can we assign value to a variable in PL/SQL Loop

    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????
    Thanks & Regards,
    Hari Babu
    Edited by: 1004977 on Jun 5, 2013 2:40 AM

    Hi,
    1004977 wrote:
    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????Yes; the example you posted does that.
    When the loop starts, the value 10 is assigned to v_num. You should see that value displayed by the put_line statement.
    After that, v_num is set to 10 - 1 = 9.
    Next, the EXIT condition is evaluated. At this point, v_num is 9, not 0, so the loop runs again. V_num is set to 10 again, and the loop continues forever (or, in some versions, until the dbms_output buffer is filled and an error occurs.)

Maybe you are looking for

  • ImageX and appending .wim files VERY WEIRD Discovery!

    I have a PC with two hard drives. I used ImageX to image each drive to a .wim file independently. The first image was of the C:\ drive The second image was of the D:\ drive. I then used the following command to append the 2nd hard disk WIM file to th

  • Transfering from iPod to iTunes ... is it possible?

    Recently my iTunes had a major problem where it would not open. Long story short, I had to reformat my hard drive, so I lost EVERYTHING. I couldn't save the music, because they thought the virus might be in my music files. So, the only place I have m

  • Best recommended mixing board with usb or lightning output to iMac or iPad for GarageBand?

    hi, set-up - 2010 iMac w/ intel core i7 processor @ 2.8 GHz, 16 GB RAM, latest mac os x 10.9 "maverick" update and the latest version updated of garage band; also, iPad third generation 64 GB wi-fi only with the latest version of iOS 7.0.3 and iOS Ga

  • Converting xml/xsl to pdf

    Hi, I am using apache's FOP 0.20.3, xerces 2.0.0.beta4 and xalan j.2.2.0 to convert xml/xsl file to pdf. The code is same as the one given in the org.apache.fop.apps.Driver class. <pre>      Driver driver = new Driver();      driver.setRenderer(Drive

  • MDM Custom attributes

    Hi gurus, I'm working with SRM-MDM Catalog 1.0 I'm facing this problem. I have imported some item with custom attributes (MDM Import Manager), i have mapped fields and values. In MDM Data Manager items are present but the custom atributes are not pre