Help with passing values to methods

  GregorianCalendar baseTime = new GregorianCalendar();
  long baseSystemTime = System.currentTimeMillis();
  // After some iterations I want to update the
  // calendar to reflect the current time.
  // I do not want to go through instantiating a new calendar
  baseTime = updateTimestamp(baseTime,baseSystemTime);
  private static GregorianCalendar updateTimestamp(GregorianCalendar GC, long lastTime){
    // This gets the difference between the last time check and now.
    // It then adds that difference to the calendar and returns the updated
    // calendar.
    int msDifference =
      new Long(System.currentTimeMillis() - lastTime).intValue();
    GC.add(GregorianCalendar.MILLISECOND,msDifference);
    lastTime = new Long(System.currentTimeMillis()).longValue();
    return GC;
  }The problem is that the lastTime variable that it passed gets updated to the current MS value. But, the original baseSystemTime never changes.
I thought that if you pass something to a method and it gets altered in the method the original object is updated. Am I wrong?

So objects are passed by reference but primitives are
passed by value?Simply speaking: Yes.
Strictly speaking: No. Every parameter is passed by value because Object obj IS a reference. So when you do call(myObject), you are passing the value of the reference of the object (the adress of the object).

Similar Messages

  • Help With Passing Values to a Subquery

    Hello,
    I am new to the SQL programming language. I have a fairly simple query that reads as follows:
    SELECT Utility_Type,Instance_ID, WINS_Current_Amount/
    (SELECT AVG
      (CASE WHEN (Corrected_Usage_Standardized IS NULL AND Extrapolated_Usage IS NOT NULL) 
    THEN (WINS_Current_Amount/Extrapolated_Usage)
    WHEN (Corrected_Usage_Standardized IS NOT NULL AND Extrapolated_Usage IS NULL) 
    THEN (WINS_Current_Amount/Corrected_Usage_Standardized)
      END)
    FROM All_Utility_Data_Standardized_With_Extrapolated_Values
    WHERE WINS_Account_Number = '021202000'
     AND (Corrected_Usage_Standardized IS NOT NULL OR Extrapolated_Usage IS NOT NULL) 
     AND (('10-01-2013' <= WINS_Invoice_Date) AND (WINS_Invoice_Date <= '09-30-2014')))
    FROM All_Utility_Data_Standardized_With_Extrapolated_Values
    WHERE WINS_Account_Number = '021202000'
     AND (Corrected_Usage_Standardized IS NULL AND Extrapolated_Usage IS NULL) 
     AND (('10-01-2013' <= WINS_Invoice_Date) AND (WINS_Invoice_Date <= '09-30-2014'))
    All the data I am concerned with is coming from a single table with a long-winded name (All_Utility_Data_Standardized_With_Extrapolated_Values). Essentially, the subquery takes the average of the calculated unit cost and applies that unit cost to where values
    for the Current_Amount are not corrected or extrapolated. This query works great when I manually input the account number i.e. ('021202000'). But now I want to pass it 3,283 other accounts which I obtain from the following query using the same table:
    SELECT DISTINCT(WINS_Account_Number)
    FROM All_Utility_Data_Standardized_With_Extrapolated_Values
    WHERE Corrected_Usage_Standardized IS NULL 
        AND Extrapolated_Usage IS NULL 
        AND ((WINS_Invoice_Date > '10-01-2013') AND (WINS_Invoice_Date < '09-30-2014'))
    I tried to put this query in place of '021202000' but it says that Subquery returned more than 1 value which I understand why, but I'm not sure how to fix. All I want to do is one-by-one place a new account number in the bold statement in the first query
    and update a table using the calculated values. Each account may have any number of results (multiple averaged results), but I need to make sure the averaging only occurs using values specific to the account entered in bold. If that makes any sense. Anyways,
    any help would be much appreciated as I am just starting to learn SQL. Thanks.
    Kevin

    Hi Kevin, 
    To fix the subquery error you just need to change "=" to "IN".  
    However, the query will probably run a lot faster if you use an inner join instead, like so:
    SELECT Utility_Type,Instance_ID, WINS_Current_Amount/
    (SELECT AVG
      (CASE WHEN (Corrected_Usage_Standardized IS NULL AND Extrapolated_Usage IS NOT NULL) 
    THEN (WINS_Current_Amount/Extrapolated_Usage)
    WHEN (Corrected_Usage_Standardized IS NOT NULL AND Extrapolated_Usage IS NULL) 
    THEN (WINS_Current_Amount/Corrected_Usage_Standardized)
      END)
    FROM All_Utility_Data_Standardized_With_Extrapolated_Values
    INNER JOIN 
    SELECT DISTINCT(WINS_Account_Number)
    FROM All_Utility_Data_Standardized_With_Extrapolated_Values
    WHERE Corrected_Usage_Standardized IS NULL 
    AND Extrapolated_Usage IS NULL 
    AND ((WINS_Invoice_Date > '10-01-2013') AND (WINS_Invoice_Date < '09-30-2014'))
    ) Accts ON All_Utility_Data_Standardized_With_Extrapolated_Values.WINS_Account_Number = Accts.WINS_Account_Number
     AND (Corrected_Usage_Standardized IS NOT NULL OR Extrapolated_Usage IS NOT NULL) 
     AND (('10-01-2013' <= WINS_Invoice_Date) AND (WINS_Invoice_Date <= '09-30-2014')))
    FROM All_Utility_Data_Standardized_With_Extrapolated_Values
    INNER JOIN 
    SELECT DISTINCT(WINS_Account_Number)
    FROM All_Utility_Data_Standardized_With_Extrapolated_Values
    WHERE Corrected_Usage_Standardized IS NULL 
    AND Extrapolated_Usage IS NULL 
    AND ((WINS_Invoice_Date > '10-01-2013') AND (WINS_Invoice_Date < '09-30-2014'))
    ) Accts ON All_Utility_Data_Standardized_With_Extrapolated_Values.WINS_Account_Number = Accts.WINS_Account_Number
     AND (Corrected_Usage_Standardized IS NULL AND Extrapolated_Usage IS NULL) 
     AND (('10-01-2013' <= WINS_Invoice_Date) AND (WINS_Invoice_Date <= '09-30-2014'))
    Cheers
    Lucas
    LucasF

  • BDC - help with passing values

    Hi,
    The BDC code works fine when the value(3) or any value is hard coded. But it is not working if I use 'RMQAM-AKTIV(p_insty)' where p_insty is the parameter value entered at selection screen. Please let me know how to pass this value.
    perform screen using: 'SAPLQPLS' '0100'.
    perform field using: 'RMQAM-AKTIV(3)' w1_aktiv,
    'BDC_OKCODE' '=WEIT',
    'RMQAM-AKTIV(3)' 'X'.
    Regards,
    bindazme

    Use this code instead.
    data lv_field(30).
    concatenate 'RMQAM-AKTIV(' p_insty ')' into lv_field.
    perform screen using: 'SAPLQPLS' '0100'.
    perform field using: lv_field w1_aktiv,
    'BDC_OKCODE' '=WEIT',
    lv_field 'X'.
    Please mark points if the solution was useful.
    Regards,
    Manoj
    Message was edited by:
            Manoj V Kumar

  • Need help with NULL values in Crosstables

    Hello everybody,
    I need some help with NULL values and crosstables. My issue is the following:
    I have a query (BW - MDX-Query) that gives me turnover measures for each month. In Crystal Reports I choose crosstable to display this whereby I put all month in columns and all turnover-measures in rows. Each month that has a value (measures are not empty) is chown in the crosstables rows. So far so good. The problem occures when there are month that actually have no values (measures are empty). In that case these months are not chown in columns. But I need CR to display these columns and show the value 0. How can I do that?

    Hi Frank,
    Cross tab shows the data based on your column and these column fields are grouped and based on the group it will show your summaries. 
    If there is no data for any of your group it will not display that group.  In this case you will have to create a standard report which should look like cross tab and to get zero values you need to write formulas .
    Example if you want to display Moth wise sales :
    if Month() = 01 Then
    sum() else 0
    Now this formula will check if your month is Jan, then it will sum up the values else it will display zero value. 
    This is possible only through standard report not with Cross Tab.
    Thanks,
    Sastry

  • How to read the 'Input help with fixed values' of domain .

    How to read the 'Input help with fixed values' of domain .
    The domain has a Value range i want to read those values .
    Are these values stored in any table ?
    Plz help me i need it ver badly...
    Thanks in Advance...

    Hi Chandra Shekhar,
    To read the 'Input help with fixed values' of domain , you can use the function module : HR_P_GET_FIXED_VALUE_TEXT.
    iIf you enter the domain name, you will find the fixed values entered in the domain.
    These values are stored in a table DD07L(DD zero 7 L). Here the values are stored based on domain name.
    See if it works for you.
    Award points if its helpful.
    Regards,
    Bhanu

  • Dropdown - issue with passing values to context

    Hi,
    After facing issue in:
    Webdynpro + alv + dynamic dropdown
    Now I've encountered another problem. Dropdown is created in alv, however once user select value from the list it shows selected value in the cell, however value in context remains unchanged.
    Here is the way I implemented dropdown:
    1) I added new field to the structure which is shown in the alv FIELD1 of WDR_CONTEXT_ATTR_VALUE_LIST type.
    2) I initialize the column, where dropdown is supposed to be:
    - first column
    l_col_name = 'COL1'.
    lr_column = lr_model->if_salv_wd_column_settings~get_column( l_col_name ).
    DATA: lr_drdn_by_idx_col1 TYPE REF TO cl_salv_wd_uie_dropdown_by_idx.
    CREATE OBJECT lr_drdn_by_idx_col1 EXPORTING selected_key_fieldname = l_col_name.
    lr_drdn_by_idx_col1->set_valueset_fieldname( value = 'FIELD1' ).
    lr_drdn_by_idx_col1->set_read_only( value = abap_false ).
    lr_drdn_by_idx_col1->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
    lr_column->set_cell_editor( lr_drdn_by_idx_col1 ).
    3) I load the data,
    Piece of code loading data into structure with dropdown:
    DATA:  ls_valueset     TYPE wdr_context_attr_value,
                lt_itab         LIKE TABLE OF ls_line.
          ls_valueset-value = 'KG'.
          ls_valueset-text = 'KG'.
          APPEND ls_valueset TO lt_itab[].
          ls_valueset-value = 'ST'.
          ls_valueset-text = 'ST'.
          APPEND ls_valueset TO lt_itab[].
    zstructure is type of the row show in the alv
    Data:
         ls_po_result TYPE zstructure.
         lt_po_result TYPE table of zstructure.
         ls_po_result-FIELD1[] = lt_itab[].
         APPEND ls_po_result TO lt_po_result[].
    Everything works so far good. The thing is that once I changed value from e.g. ST to KG, value in Attribute COL1 is still ST.
    I would appreciate your help,
    kind regards,
    Adam

    Hi Nithya,
    it could another issue with the SP, I will inform you if it's the case.
    Passing values comes up with function when I load data into alv.
    structure_name - alv columns structure
    DATA: l_name1        TYPE t001w-name1,
              ls_po_result   TYPE structure_name
              lt_po_result   TYPE table of structure_name,
    load data from DB into l_itab
      LOOP l_itab  AT ASSIGNING item.
    this method return value_set to field1
        CALL METHOD fill_single_dd
          EXPORTING
            i_id     = item-id
          IMPORTING
            rt_dd_table = ls_po_result-field1[].
        APPEND ls_po_result TO lt_po_result[].
      ENDLOOP.
    binding to node ....

  • Having trouble passing values between methods

    So if this isnt the right spot for this.
    Anyhow any coments on where I went wrong or need to fix will be apriciated.
    So I got two methods that return a value (getHour() and getMinute(). The values that are returned I am tring to pass into showTime. However it doesn't seem to work as all I get is zero's.
    I've done a search around on the net and Im starting to thing my intellagnce is limited.
    import java.util.Scanner;
    public class First
    static int sH, sM;
        public static void main(String args[]){
            getHour();
            getMinute();
           showTime(sH,sM);
        static int getHour(){
            Scanner input = new Scanner(System.in);
            System.out.println("Please enter the hour: ");
            int setHour = input.nextInt();
            if(setHour <= 24){
                System.out.println("You entered " +setHour+ " for the hour.");
            }else{
                System.out.println("Please enter the hour number from 0 to 24");
                getHour();
         return sH;
         static int getMinute(){
            Scanner input = new Scanner(System.in);
            System.out.println("Please enter the minutes: ");
            int setMinute = input.nextInt();
            if(setMinute <= 60){
                System.out.println("You entered " +setMinute+ " for the minutes.");
            }else{
                System.out.println("Please enter the hour number from 0 to 60");
                getMinute();
            return sM;
        private static void showTime(int sH, int sM){
              System.out.println(+sH+":"+sM);
    }

    Hi,pls compare ur coding with the one i have posted below. In your code, the variables sH and sM are still in initialised state(value =0) and its not assigned with the values returned by getHour and getMinute methods. This is why the shoTime method returned zero. Hope i helped you.
    import java.util.Scanner;
    * @author Jaison KS-IT
    public class First {
    static int sH, sM;
    public static void main(String args[])
    getHour();
    getMinute();
    showTime(sH,sM);
    static int getHour(){
    Scanner input = new Scanner(System.in);
    System.out.println("Please enter the hour: ");
    int setHour = input.nextInt();
    if(setHour <= 24){
    System.out.println("You entered " setHour " for the hour.");
    sH = setHour;
    }else{
    System.out.println("Please enter the hour number from 0 to 24");
    getHour();
    return sH;
    static int getMinute(){
    Scanner input = new Scanner(System.in);
    System.out.println("Please enter the minutes: ");
    int setMinute = input.nextInt();
    if(setMinute <= 60){
    System.out.println("You entered " setMinute " for the minutes.");
    sM = setMinute;
    }else{
    System.out.println("Please enter the hour number from 0 to 60");
    getMinute();
    return sM;
    private static void showTime(int sH, int sM){
              System.out.println(+sH+":"+sM);
    }

  • Passing values between methods in the same class

    Hi,
    How to pass internal tables or values between methods in the same class.
    How to check if the internal method in another method is initial or not.
    How to see if the method has already been executed.
    Thanks.

    Just declare the internal table as an attribute in the class - that way every method in this class has access to it.
    Since any method has access to all class attributes you can easily check if the internal table is initial or not.
    I am not aware of any standard functionality if a method has already been executed or not, one way would be to declare a class attribute for each method and set it once the method has been executed. That way every method in that class would know which method has already been executed or not.
    Hope that helps,
    Michael

  • Default method - how to pass value to method container?

    Hello,
    I am dealing with a hyperlink in 'Objects and Attachements' section of the workitem.When i click on the link, the default method of the business object gets called automatically.
    My question is: How to pass values to the default method (i.e. method container) as i don't invoke the method in my workflow explicitly?  The method gets called when we click on the hyperlink.
    Regards,
    Monica.

    Hello Monica,
    a default method doesn't require parameters (and cannot make use of them), as they are designed to be called from various situation, such as the view from a workflow container, the display button within a workitem or the attachment list. So this is part of the system design.
    To make an object dependent of workitem values I usually follow two different design patterns:
    <b>1) Using a flowitem/workitem instance with a special default method</b>
    - Create a subobject from type WORKITEM (if I'm going to use values from the current workflow instance) or subobject from type WORKINGWI (if I'm going to use values from the current dialog workitem).
    - Do not make a general substitution for this new object type
    - If using a ZWORKITEM, create an instance of this object type before the dialog step and then pass this object to the dialog workitem
    - If using ZWORKINGWI, assign the object instance during the data flow to the step.
    - In the properties of the object choose (any one) default method
    - Within the coding you have the reference to the workitem/flowitem as object-key-... and you can further use functions/methods to read the workitem/flowitem container and do whatever has to be done
    <b>2) Retrieving values from the current workitem on-the-fly</b>
    Within the coding of the default method call the function module SWO_QUERY_REQUESTER that returns the instance/id of the current workitem-in-work (with is also set when using the hyperlink from a workitem). If the list is empty, there's no active workitem, otherwise use functions/methods to read the workitem container.
    --> edit: Solution is not release safe, is it aint working with SAP R/3 Enterprise and higher
    Best regards,
       Florin
    Message was edited by:
            Florin Wach

  • Hello i have little problem with pass values to pop up

    I want to pass values when user click on current row then show right click context menu to pop up.
    i need help following code. Because it doesn't pass current row values , it passes all values in database. i thought filter doesn't  work .
    First i added Bind Variables named VarEnqID and Criteria named GetbyIDCriteria on my view object .
    Second i created view object classes and object interfaces and view object classes method's code :
        public void setSearch1C(String input)
            ViewCriteria vc = getViewCriteria("GetByIDCriteria");
            vc.resetCriteria();
            setVarEnqID(input);
            //setVarEnqId2(input);
            applyViewCriteria(vc);
            executeQuery();
    Third i drag setSearch1C from data control to right click context menu and add attribute named Id to bindings then choose id into value.

    How is the context menu and the pop-up wired up?
    Have you set the pop-up to lazyUncached?
    Which value from the current row do you want to pass to the method?
    Which Jdev version do you use?
    Timo

  • RRI: BEX query to webadress(is SRM ITS base URL with passing value to it)

    Dear friends,
    I am doing RRI from query to webaddress,
    i have defined jump(report type: webaddress and reicver report as url) from shopping cart bex query(SRM ) to webaddres.
    here url is SRM ITS base link for monitoring shoppingcart(http://(hostname):(SRM port)/sap/bc/gui/sap/its/bbp_mon_sc?sap-client=200&sap-language=EN).
    jump is working from portal(from bex query ivew).
    but i want to pass value(shopping cart value) to above url and want to skip first screen.
    i have maintained assignment detail by assigning field name against shopping cart infoobject with type url parameter, but its not directly call reciver url with given input field.
    i tried the diffrent combination of url and field assignment as like below:
    1: web address url:http://(hostname):(SRM port)/sap/bc/gui/sap/its/bbp_mon_sc?sap-client=200&sap-language=EN
    assigned field: GS_HEADER-OBJECT_ID
    but when we call reciver url from portal bex ivew, only initial screen come with page url as below:
    http://(hostname):(SRM port)/sap/bc/gui/sap/its/bbp_mon_sc?sap-client=200&sap-language=EN?GS_HEADER-OBJECT_ID='selected number value'
    2: web address url:http://(hostname):(SRM port)/sap(cz1TSUQlM2FBTk9OJTNhc3JtZGV2X0lTRF8wMCUzYUdxdFNqdWdMS2xyTEFEelFTNFlWTnJXRjEzdy05UnhTWXl4TW03c3AtQVRU)/bc/gui/sap/its/bbp_mon_sc/~flNUQVRFPTgzMTcuMDAyLjAxLjAx====#jump_to_selected_sc
    assigned field: flNUQVRFPTgzMTcuMDAyLjAxLjAx
    but when we call reciver url from portal bex ivew, only initial screen come with page url as below:
    http://(hostname):(SRM port)/sap(cz1TSUQlM2FBTk9OJTNhc3JtZGV2X0lTRF8wMCUzYUdxdFNqdWdMS2xyTEFEelFTNFlWTnJXRjEzdy05UnhTWXl4TW03c3AtQVRU)/bc/gui/sap/its/bbp_mon_sc/~flNUQVRFPTgzMTcuMDAyLjAxLjAx====#jump_to_selected_sc?flNUQVRFPTgzMTcuMDAyLjAxLjAx='selected number value'
    I have seen the source code of that url(inital screen and after entring the value to that screen) too.
    how to call webadress(SRM ITS base shopping cart URL) with passing the one of field value of that url screen?
    Thanks and regards,
    Dushyant.

    Hi,
    i have replied wrong,
    i mean that
    when i am trying this,
    http://(hostname):(SRM port)/sap/bc/gui/sap/its/bbp_mon_sc?sap-client=200&sap-language=EN&GS_HEADER-OBJECT_ID='selected number value'
    with field assignment: shopping cart number = GS_HEADER-OBJECT_ID (for drill down on particular field, i.e. open the URL with this field value entred from sender query's field shopping cart number)
    result is coming: http://(hostname):(SRM port)/sap/bc/gui/sap/its/bbp_mon_sc?sap-client=200&sap-language=EN&GS_HEADER-OBJECT_ID='selected number value'&GS_HEADER-OBJECT_ID=10000456
    and when try this:
    http://(hostname):(SRM port)/sap/bc/gui/sap/its/bbp_mon_sc?sap-client=200&sap-language=EN
    with field assignment: shopping cart number = GS_HEADER-OBJECT_ID
    result is coming: http://(hostname):(SRM port)/sap/bc/gui/sap/its/bbp_mon_sc?sap-client=200&sap-language=EN&GS_HEADER-OBJECT_ID=10000456
    but not skiping the initial screen.
    Thanks.

  • Help with inserting values -- ORA-00984 error

    Hello!
    This time we have a problem with inserting values and we really can't find what's wrong!
    The table was created as such
    CREATE TABLE PASSAGER
    (NO_PERSONNE INTEGER,
    NO_PASSAGER INTEGER NOT NULL,
    NO_PASSEPORT INTEGER NOT NULL,
    NATIONALITE VARCHAR2(30) NOT NULL,
    LIEU_EMISSION VARCHAR2(30) NOT NULL,
    DATE_EMISSION DATE NOT NULL,
    NO_TEL INTEGER,
    NO_CC INTEGER,
    NO_VENTE INTEGER NOT NULL,
    CONSTRAINT PK_PASSAGER PRIMARY KEY (NO_PERSONNE),
    CONSTRAINT FK_PASSAGER_PERSONNE FOREIGN KEY (NO_PERSONNE) REFERENCES PERSONNE (NO_PERSONNE),
    CONSTRAINT FK_PASSAGER_VENTE FOREIGN KEY (NO_VENTE) REFERENCES VENTE (NO_VENTE));
    We created a sequence..
    CREATE SEQUENCE NOPASS_SEQ
    START WITH 1
    INCREMENT BY 1
    NOCACHE
    NOCYCLE;
    for inserting the values, we did...
    INSERT INTO PASSAGER VALUES (500,NOPASS_SEQ.NEXTVAL, WT456789,'CANADIENNE', 'CANADA', to_date('2007/10/12','YYYY/MM/DD'),5142348756,5157981500126734,1);
    but it won't work, it's our last table and all the other worked perfectly!
    Thanks a ton!

    In your table creation, you got third column as
    NO_PASSEPORT INTEGER NOT NULL,
    where as you are passing varchar values (see bold)
    INSERT INTO PASSAGER VALUES (500,NOPASS_SEQ.NEXTVAL, WT456789,+'CANADIENNE', 'CANADA', to_date('2007/10/12','YYYY/MM/DD'),5142348756,5157981500126734,1);
    Should be like this I suppose
    INSERT INTO PASSAGER VALUES (500,NOPASS_SEQ.NEXTVAL, *456789*,'CANADIENNE', 'CANADA', to_date('2007/10/12','YYYY/MM/DD'),5142348756,5157981500126734,1);

  • Help with passing integer value in A.S.S

    I get an NSinternal script error while trying to pass this value can anyone help?
    Also I wonder if it is possible to pass the value to a matrix
    on clicked theObject
    tell button "checkbox" of window 1
    if integer value = 1 then
    set button "checkbox2" of window 1 to integer value = 1
    else
    set integer value to 0
    end if
    end tell
    end clicked
    I also tried:
    if state of button "checkbox" of window1 is 1 then
    set the state of button "checkbox2" of window1 to 1
    end if
    Message was edited by: Doug Bassett

    I've been following this thread and trying to figure out how to make this work. I was getting inconsistent results or errors with most of the code that has been posted. But I finally got it working... at least on a Leopard machine (not sure if this could have changed between Tiger and Leopard so your mileage may vary).
    What I found was that a checkbox button that's located directly in a window seems to have a state that's equal to 0 when it's unchecked and 1 when it's checked. But a checkbox cell that's contained within a matrix seems to have a state that's set to either _off state_ or _on state_. Trying to set a cell's state to 0 or 1 simply wasn't working right for me. So I get the state of the "selectall" checkbox button (which is a 0/1) and transform it to either "off state" or "on state" before setting the states of the checkbox cells in the matrix.
    Here's my code:
    on clicked theObject
    set n to name of theObject
    if n = "selectall" then
    set s to state of theObject
    log "state: " & s
    if s = 0 then
    set newState to off state
    else
    set newState to on state
    end if
    repeat with i from 1 to count of cells of matrix "directories" of window "main"
    tell cell i of matrix "directories" of window "main"
    set state to newState
    end tell
    end repeat
    return
    end if
    if n = "logStatesBtn" then
    logStates()
    return
    end if
    end clicked
    on logStates()
    log "Logging states:"
    set s to state of button "selectall" of window "main"
    log "selectall checkbox: " & s
    repeat with i from 1 to count of cells of matrix "directories" of window "main"
    tell cell i of matrix "directories" of window "main"
    set s to state
    end tell
    log "Cell " & i & ": " & s
    end repeat
    end logStates
    Note the "logStates" handler is just something I connected up to a "logStatesBtn" button in my window that lets me spit out the states of all the checkboxes into the console log. This is how I actually discovered that the cells were set to "off state" or "on state".
    Steve

  • Passing value from method to Workflow

    Hi All,
    I am new to workflow. I am trying simple examples to understand the concepts of work flow.
    I have copied a std business object and I have a method in that. Now, I am trying to pass some value to this method from the work flow and get back some value after manipulation with in this method.
    In the program for the method,  I need to get 2 parameters as input and one parameter as outut. With in this method I am trying to write the code for adding this 2 nos. I have seen some Help docs and came to know I should use SWC_GET_ELEMENT_CONTAINER and SWC_SET_ELEMENT_CONTAINER for this. But, I am ot sure of the syntax.
    Can you help me with a sample program for this...
    Any help is highly appreciated.
    Thanks,
    Jai Shankar

    hi Jai Shankar,
    I give you the sample code of the method where i am finding number of agents
    BEGIN_METHOD ZLCPRNUMBEROFUSERS CHANGING CONTAINER.
    DATA:
          TEMAILID LIKE SOLI OCCURS 0,
          TAPPROVERS LIKE ZSAFAPPROVERS OCCURS 0,
          WAPPROVERS LIKE TABLE OF ZSAFAPPROVERS WITH HEADER LINE.
          DATA NUMBER LIKE VBAK-VBTYP.
          DATA emailid TYPE STRING.
          data userid type string.
    this is the coding where the value that you give the method container
      SWC_GET_TABLE CONTAINER 'TEmailId' TEMAILID.
      SWC_GET_TABLE CONTAINER 'TApprovers' TAPPROVERS.
      SWC_GET_ELEMENT CONTAINER 'NUMBER' NUMBER.
    here you can use your own coding like (select query or any other)
      CALL FUNCTION 'Z_LC_PR_NUMBER_OF_USERS'
        TABLES
          T_EMAIL_ID = TEMAILID
          T_APPROVERS = TAPPROVERS
        EXCEPTIONS
          OTHERS = 01.
      CASE SY-SUBRC.
        WHEN 0.            " OK
        WHEN OTHERS.       " to be implemented
      ENDCASE.
      SWC_SET_TABLE CONTAINER 'TEmailId' TEMAILID.
      SWC_SET_TABLE CONTAINER 'TApprovers' TAPPROVERS.
    READ TABLE TAPPROVERS INDEX NUMBER INTO WAPPROVERS.
    CALL FUNCTION 'Z_LC_GET_EMPLOYEE_INFO'
    EXPORTING
        USER_ID                   = WAPPROVERS-APPROVER_USRID
    IMPORTING
         EMP_EMAIL                 = emailid.
    here i am doing some manupulation in the function module and i am getting that value to the method container as below.
      SWC_SET_ELEMENT CONTAINER 'EMAILID' emailid.
      SWC_SET_ELEMENT CONTAINER 'USERID' WAPPROVERS-APPROVER_USRID.
    SWC_SET_TABLE CONTAINER 'EMAILID' emailid.
    SWC_SET_TABLE CONTAINER 'TApprovers' TAPPROVERS.
    END_METHOD.
    I think it is helpful for you,
    Regards,
    Balaji E.

  • Help with getting values from request. Very Strange!!

    Hello,
    My very strange problem is the following.
    I have created three dynamic list boxes. When the user select
    the first list box, the second becomes populated with stuff
    from a database. The third becomes populated when the second
    is selected. Now, I have used hidden values in order for
    me to get the selected value from the first listbox. The
    following code is my first listbox:
    <SELECT NAME="resources" onChange="document.hiddenform.hiddenObject.value = this.option [this.selectedIndex].value; document.hiddenform.submit();">
    <OPTION VALUE =""> Resource</OPTION>
    <OPTION VALUE ="soil"> Soil </OPTION>
    <OPTION VALUE ="water"> Water </OPTION>
    <OPTION VALUE ="air"> Air </OPTION>
    <OPTION VALUE ="plants"> Plants </OPTION>
    <OPTION VALUE ="animals"> Animals </OPTION>
    </SELECT>
    I use the getRequest method to get the value of hiddenObject.
    At this time I am able to get the value of hiddenObject to populate
    the second list box.
    But, when the user selects an item from the second list box
    and the second form is also submitted,
    I lose the value of hiddenObject. Why is this??
    The code to populate my second listbox is the following:
    <SELECT NAME ="res_categories" onChange="document.hiddenform2.hiddenObject2.value = this.options[this.selectedIndex].value; document.hiddenform2.submit(); ">
    <OPTION VALUE ="" SELECTED> Category</OPTION>
    Here I access a result set to populate the list box.
    Please help!!

    Form parameters are request-scoped, hence the request.getParameter("hiddenObject"); call after the submission of the second form returns a null value because the hiddenObject parameter does not exist within the second request.
    A solution would be to add a hiddenObject field to your second form and alter the onChange event for res_categories to read
    document.hiddenform2.hiddenObject.value=document.1stvisibleformname.resources.option[document.1stvisibleformname.resources.selectedIndex].value;
    document.hiddenform2.hiddenObject2.value = this.options[this.selectedIndex].value;
    document.hiddenform2.submit();You will then come across a similar problem with your third drop-down if indeed you need to resubmit the form...
    A far better approach would be to create a session scoped bean, and a servlet to handle these requests. Then when the servlet is called, it would set the value of the bean property, thus making it available for this request, and all subsequent requests within the current session. This approach would eliminate the need for the clunky javascript, making your application far more stable.

Maybe you are looking for

  • Slate 500 loses power when undocked

    I have a Slate 500 that loses power whenever it is removed from it's docking station.  This began occuring after I used to HP supplied recovery disks to restore the tablet to it's original WIndows 7 Pro setting.  I had installed WIndows 8 on the tabl

  • Contracts Price updation for every three months

    Hi Experts, we need to change multiple condition enties in contracts.All prices need to change and we need to update them to new level. Since the field NET PRICE is grey I have to open each individual item in the valid period and change price by pric

  • Copy FTP files according to modified date and time

    Hi all, I am creating an application where I need to copy the latest file created only from a remote FTP location. So for example, if my remote/ftp location contain some folders and some files, it would list only the file which was modified recently.

  • Huge number of files in Leopard according to VirusBarrier X4

    Loaded a demo copy of VirusBarrier X4 with the idea of buying it and when I ran the scan, it produced a file count of over 1,170,000 before I stopped it! Prior scan produced a count of over 600,000. Obviously VirusBarrier X4 doesn't know how to count

  • My macbook pro got insane @ 10.6.6

    Recently i update to 16.6.6 ,Since then my macbook pro(MA895) got insane, freezes frequently, Keyboard and Mouse not responding anymore, have to shutdown the laptop by holding down the power button. here is my macbook pro spec Model No : Apple MacBoo