Recieve value from another method

hello,
I have a method like this
public String loadUser(String x){    //Init in = new Init();    String abc = x;         currentUser = currentUser+abc;         System.out.println("Currentuser "+currentUser);        return currentUser;    }I have another method
public void prepareSession(Session session) {        //System.out.println("Reached   b value "+user);        super.prepareSession(session);}How can I recieve value of first method loadUser in my second method?
I do not want to add another parameter to prepareSession method because it is over riding.
How can I achieve this?
Thanks

The problem is:
public class AppModuleImpl extends ApplicationModuleImpl {
    String user = null;
    String bn;                            //This is empty and has nothing to do with
    String h = null;                           //        |
    String ops = null;                         //        |    
                                               //         |                   
    public String loadUser(String x){               //   |
    String bn = x;                                   // this. They are two different varaiables.
        System.out.println("Currentuser "+bn);
        return x;
    public void prepareSession(Session session) {
        super.prepareSession(session);
         String tg = loadUser(bn);
        AppModuleImpl appl =  new AppModuleImpl();
         System.out.println("currentUser ??? "+tg);
}That's why bn at the end is empty
BTW I didn't notice You put anything into bn
Message was edited by:
hellbinder

Similar Messages

  • How to pass value from one method to another method

    Hi all,
    I have created a funtion module and i am calling this function module inside a method and it is exporting some value in a table, now i have to pass table value to another method where i have do some thing based upon this values.
    I think there a marco available to move the values from one method to another method.
    Please help me in this issue.
    Regards
    Balaji E.

    Hi,
    Let me make certain assumptions!
    Method 1 - You export the table values
    Method 2 - The method where you need the table values
    Once you create a method from a function module which has tables as one of the export parameters then the code automatically puts in the macro code which looks like : SWC_SET_TABLE CONTAINER 'Table' TABLE.
    The 'Table' in the above code is the container element which is created by the workflow once you use this method and the TABLE (The table that gets filled in the function module) is the variable to code automatically created.
    Now you can use the other function module in the workflow as a background step and pass the values from the 'Table' container to this method using the binding. When you use this then the method automatically has the macro SWC_GET_TABLE CONTAINER 'Table' ITABLE. Here the 'Table' is the same container table you used in the binding and the ITABLE would be the variable you can use in the other function module.
    Hope this helps,
    Sudhi

  • The problem of return value from a method

    Hi everyone:
    I want return a value from following method. The basic idea is that I want use Num as a parameter to get a value from a field, therefore I can input this value into another database for the display purpose by using other classes. However I got error message when I compiled it.
    "method does not return a value"
    I know it is a problem, but how I can fix it? I need your help. Thanks in advance.
    Dawei
    Method:
    public int Read(int Num) {
    try{
    String qr1 = "select Record form Buffer where Record="+Num+"";
    ResultSet rs = statement.executeQuery(qr1);
    while (!rs.next()){
              int result=rs.getInt(1);
    return(result);
         catch (SQLException e){
                   System.err.println("Error in inserting into database " + e);
                        System.exit(1);
    return 1;

    "select Record form Buffer ...Hopefully "form" is actually "from" in your code.
    You have three points of exit from your routine, and only two return value statements.
    1 -Return inside the while loop has a value.
    2- Return inside the exception block (not sure that '1' would be a valid number)
    3- The very end of the method, just before the last '}' does not have a return statement.
    By the way, this question has nothing to do with JDBC, so another forum might be a better place to post it.

  • Get the value from another node.

    Hi, expert
    In the component BT131I_SLS , I create a enhanced attribute in the node: BT131I_SLS/Details BTADMINI
    Then i define the GET-V method to create a search help for the attribute.
    Now , i want to pass a BP number to the search help function to filter the data.
    We need to get the BP number as below:
    When create a order, we input the product id ,
    then there will be a popup window , we can choose  a vendor in the window.
    The vendor number is the value which we want to pass to the search help.
    How can i do that ?
    Thanks.
    Oliver.

    Hi , expert
    Can i use the 'get_related_entities' to get the value I need?
    I think maybe i can use the method to get the value from another view which is not in my component.
    Now I write codes in the GET-V method, as below:
    method GET_V_ZZZFLD000011.
      DATA:
        LS_MAP    TYPE IF_BSP_WD_VALUEHELP_F4DESCR=>GTYPE_PARAM_MAPPING,
        LT_INMAP  TYPE IF_BSP_WD_VALUEHELP_F4DESCR=>GTYPE_PARAM_MAPPING_TAB,
        LT_OUTMAP TYPE IF_BSP_WD_VALUEHELP_F4DESCR=>GTYPE_PARAM_MAPPING_TAB.
      DATA: LV_PARTNER_NO TYPE CRMT_PARTNER_NUMBER.
      data: lr_current TYPE REF TO if_bol_bo_property_access,
            lr_entity  TYPE REF TO cl_crm_bol_entity,
            lr_col     TYPE REF TO if_bol_bo_col,
            value      TYPE string.
      lr_entity ?= me->collection_wrapper->get_current( ).
      lr_col = lr_entity->get_related_entities( iv_relation_name = 'Relation_Name' ).
      lr_current = lr_col->get_current( ).
    * value =
      LS_MAP-CONTEXT_ATTR = 'EXT.ZZZFLD000011'.
      LS_MAP-F4_ATTR      = 'LGORT'.
      APPEND LS_MAP TO: LT_OUTMAP.
    *  LS_MAP-CONTEXT_ATTR = 'EXT.ZZZFLD000011'.
    *  LS_MAP-F4_ATTR      = 'LANGU'.
    *  APPEND LS_MAP TO LT_INMAP.
      IF SY-SUBRC  = 0.
      ENDIF.
      CREATE OBJECT RV_VALUEHELP_DESCRIPTOR
        TYPE
          CL_BSP_WD_VALUEHELP_F4DESCR
        EXPORTING
          IV_HELP_ID                  = 'ZHELP_ZSAKCDD'
    *      IV_HELP_ID_KIND             = IF_BSP_WD_VALUEHELP_F4DESCR=>HELP_ID_KIND_COMP
          IV_HELP_ID_KIND             = IF_BSP_WD_VALUEHELP_F4DESCR=>HELP_ID_KIND_NAME
          IV_INPUT_MAPPING            = LT_INMAP
          IV_OUTPUT_MAPPING           = LT_OUTMAP
          iv_trigger_submit           = abap_true
    *      IV_F4TITLE                  = ' '"#    EC NOTEXT
    endmethod.
    But i don't know the Relation_Name which i can get the vender's information.
    Another question : i want to trigger the code 'get_related_entities' when i click the search help,
                                   How can i do that ?
    Thanks.
    Oliver.
    Edited by: oliver.yang on Aug 7, 2009 5:56 AM

  • Creating Variable with Replacement Path to get value from ANOTHER Variable

    Hi all,
        Is anyone has created the Variable with Replacement Path to get the value from another User Entry Variable, PLEASE ? 
    First created the User Entry Variable (ZV_X) and it accepts the date range like '01/01/2009 - 01/31/2009'. Next created the Characteristic variable (ZV_Y) of Replacement Path for which source variable will be ZV_X and we should get the 'FROM Date' (01/01/2009) from the selection (ZV_X) into it (ZV_Y).
    While creating the Characteristic variable (ZV_Y) of Replacement Path, I didn't find my newly created ZV_X variable in the list of available variables under 'Variable' header in 'Replacement Path' tab and it is causing the error 'Source to replace variable ZV_Y is not defined'. How could I create the Characteristic variable of Replacement Path for my requirement, PLEASE ?
    The following is from help.sap..com:
    Replace with Characteristic Value
    Text and formula variables with the processing type Replacement Path can be replaced with a corresponding characteristic value. In the variable editor, on the General tab page, you specify under Reference Characteristic the characteristic that is to be referenced by the replacement. On the Replacement Path tab page, you can choose whether the variable is replaced with the From or the To Value and with the Key or the Name of the characteristic value. You can also specify the Offset Start and Offset Length for the output.
    Replace with Variable
    Characteristic value variables, hierarchy variables, text variables, and formula variables with the Replacement Path processing type can take their values from a different variable.
    The following prerequisites need to be fulfilled:
    Variable
    ●      The variable must not be input-ready
    ●      The variable must represent a single value
    Source Variable
    ●      The source variable must not be a hierarchy node variable
    ●      The source variable must be input-ready
    ●      The source variable must be available in the query
    ●      The source variable must represent a single value or an interval
    In the variable editor, on the Replacement Path tab page, you specify the source variable from which the value is to be determined. The value is either determined from the key, the external attribute of the key, the description, or the attribute value. You can specify an Offset Start and an Offset Length for the output here. The variable is replaced on the variable screen upon each data release.
    Thanks,
    Venkat.

    Hi Eve,
    It is possible to connect the 2 queries using a Replacement Path characteristic variable. You would need to create the variable on the char whose values you want to pass from Q1 to Q2. The variable will be of type replacement path and you will need to enter the name of Q1 from which it will get the values. Make sure that you include this char in the query definition of Q1 and Q2. In Q2 you will restrict the characteristic using this variable. DO not use this variable (replacement path) in Q1.
    In your query properties check if you have turned on the checkmark for Release for OLE DB for OLAP (3rd tab). If the check mark is there, then remove it.
    We are using the scenario in a couple of places, and it works very well.
    Hope this helps...

  • NEED HELP on returning values from a method

    Hello Java World,
    Does anyone know how to return more then 1 value from a method..
    ex.
    //the following returns one value
    //Person Class
    private String getname()
    return this.name;
    how can i get two values (ex. name and occupation of person)
    Thank you in advance.

    Create a Class which will hold the values you want and return that object. Or return a List, or return an array, or - taking your example with the person, why don't you return the whole person object?
    Thomas

  • Returning multiple values from a method

    I have to return a string and int array from a method (both are only of size 5 for a total of 10) What would be considered the best manner in which to do this ?
    Dr there's 10 points in it for you or whoever gives me the best idea ;-P

    hey here it is easy that you can return many things
    what ever you want from a single method man....
    you know the main thing what you have to do is.....
    Just create a VECTOR or LIST object, then add all the
    values what ever you want to return like string and
    int array like etc...
    Then make the method return type is VECTOR and after
    getting the Vector you can Iterate that and you can
    get all the values from that method what ever you
    want....
    jus try this,,,,,,,,,,
    Its really work......
    reply me..but it relies purely on trust that the returned collection would contain exactly the right number and type of arguments

  • SSRS Parameter value from another parameter

    Hello Everybody,
    I have a parameter that I need to get it value from another parameter.
    The first parameter @rdt is a date - 11/01/2012
    The second parameter @mm is the year and month = 2012
    I tried putting in a select inside the query but it did not work
    SET @mm =  (SELECT cast(year(@rdt) as char(4)) + cast(month(@rdt) as varchar(2)))
    Then I put it as a default value inside the parameter and it still did not work
    =cast(year(Parameters!rdt.Value) as char(4)) + cast(month(Parameters!rdt.Value) as varchar(2))
    Any ideas or suggestions ?
    Thanks in advance

    Hi Msj99,
    I have tested the expression provided by
    Visakh16 that it works fine , you will get the value as Integer type "YYYYMM", you can also use expression as below to get the string type of @mm (YYYYMM):
    =Year(Parameters!rdt.Value)&Month(Parameters!rdt.Value)
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • How to create a new row for a VO based on values from another VO?

    Hi, experts.
    in jdev 11.1.2.3,
    How to create a new row for VO1 based on values from another VO2 in the same page?
    and in my use case it's preferable to do this from the UI rather than from business logic layer(EO).
    Also I have read Frank Nimphius' following blog,but in his example the source VO and the destination VO are the same.
    How-to declaratively create new table rows based on existing row content (20-NOV-2008)
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
    I have tried:
    1.VO1(id,amount,remark1) and VO2(id,amount,remark2) are based on different EO,but render in same page,
    2.Drag and drop a Createwithparams button for VO1(id,amount,remark),
    3.add: Create insertinside Createwithparams->Nameddata(amount),
    4.set NDName:amount, NDValue:#{bindings.VO2.children.Amount}, NDtype:oracle.jbo.domain.Number.
    On running,when press button Createwithparams, cannot create a new row for VO1, and get error msg:
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: For input string: "Amount"
    java.lang.NumberFormatException: For input string: "Amount"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    Can anyone give some suggestions?
    Thanks in advance.
    bao
    Edited by: user6715237 on 2013-4-19 下午9:29

    Hi,CM,
    I'm really very appreciated for your quick reply! You know, today is Saturday, it's not a day for everyone at work.
    My principal requirement is as follows:
    1.select/check some rows from VO2, and for each selection create a new row with some attributes from VO2 as default values for VO1's corresponding attributes, and during this process the user may be cancel/uncheck or redo some of the selections.
    --so it's better to implement it in UI rather than in EO.
    2.it's better to implement this function with declarative way as in Frank Nimphius' blog.
    --little Jave/JS coding, the better. I only have experience in ORACLE FORMS, little experience in JAVA/JS.
    In order to get full information for the requirements of my use case, can take a check at:
    How to set default value for a VO query bind variable in a jspx page?
    (the end half of the thread: I have a more realworld requirement similar to the above requirement is:
    Manage bank transactions for clients. and give invoices to clients according to their transaction records. One invoice can contain one or many transactions records. and one transaction records can be split into many invoices.
    Regards
    bao
    Edited by: user6715237 on 2013-4-19 下午11:18
    JAVE->JAVA

  • Variable type Hierarchy, how to get the value from another similar variable

    Hi.
    We have created a variable, type hierarchy (using ORGEH hierarchy in HR based on 0ORGUNIT). Let's call this VAR1. We want to fill this with an User Exit, beacuse we want VAR1 to have the value from another variable, VAR2, which is also type hierarchy (and based on the same characteristic).
    However, when we program this user exit and use the VAR1 afterwards, it just behaves as if we have a single characteristic value and not a node value. As a result, we just get posts which do have the 'parent itself' as characteristic value, and none of the subnodes...  Any hints as to what we can do in our User exit to get the value passed over from VAR2 to VAR1 as a node value? Is there any spesific syntax to be used here that we are missing? ( The VAR1 and VAR2 are both defined as hierarchy variables, we have double checked...).

    Hi,
    are you on BI7.0? There you can create variables type replacement path and get the value out from a different variable without any coding.
    regards
    Cornelia

  • Field with a default value from another field

    I need to populate a field as the default value from another field that the user inputs. I've tried the scripting that I found from the below Topic in the Archived Forums, but I'm not able to make it work. I've tried numerous variations and still to no avail. I tried to make the scripting work in Acrobat 6 and then decided that maybe I needed to upgrade, so I'm now trying it in Acrobat 8 with no results. Can anyone help?
    Topic
    Acrobat 5 - field with default value of another field
    Ben PF - 03:31am Mar 23, 2007 Pacific
    How can I have a field date2 which has the default value of field date1, but which can be edited by the user if necessary without changing the value of date1.
    I've tried, but I just can't figure it out!
    Any help much appreciated.
    Ben
    | Back to Topic List | Bookmark | Subscribe
    To start a NEW discussion click on the Back to Topic List link and select Add Topic.
    If you are in an archive forum please go up to the main topic list (archives are read only).
    Messages
    2 messages. Displaying 1 through 2.
    First Previous Next Last Show All Messages
    Gene Dianoski - 5:22am Mar 23, 07 PST (#1 of 2)
    This, or some variation of this, should work:
    if(this.getField("date2").value == ""{
    this.getField("date2").value = this.getField("date1).value;
    | Bookmark back to top
    Ben PF - 6:49am Mar 23, 07 PST (#2 of 2)
    Thanks very much.
    I put it in at document level to start, but it didn't run the script automatically when date1 was first filled in, so I have put it in as a mouse exit action in date1 and it works a treat.
    Thanks for your help.
    Ben

    Okay forget what I posted above and lets start over. Go to your first field and under Properties -> Actions Tab -> Select Trigger -> On Blur Run A JavaScript.
    Put this:
    this.getField("myField2").value = event.target.value;
    Make sure that you replace ("myField2") with the actual name of your second field. I just tested this and it works for Acrobat version 6.
    I haven't been doing as much javascripting as I used to, so sometimes I too make some basic mistakes.

  • Call String from another method

    hey,
    Im pretty new to java and Im having problems with calling a String from another method
    I have two public voids, in one of them I have a String which I wanna use in another method.
    Thanks

    here is some of my code:
    public void getOrder() {
            try {
                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                Document doc = docBuilder.parse(new File("c:/orders.xml"));
                // normalize text representation
                doc.getDocumentElement().normalize();
                System.out.println("Root element of the doc is " + doc.getDocumentElement().getNodeName());
                // lees orders
                NodeList orderlijst = doc.getElementsByTagName("order_naam");
                System.out.println("totale aantal orders : " + orderlijst.getLength());
             //    Element orderitem = (Element) orderlijst.item(0);
    System.out.println("name=" + doc.getElementsByTagName("order_naam").item(0).getFirstChild().getNodeValue());
              String st =doc.getElementsByTagName("order_naam").item(0).getFirstChild().getNodeValue();
      public void createGUI () {
            this.removeAll();
            lbltest = new JLabel();
            lbltest.setBounds(20, 40, 150, 20);
            lbltest.setFont(new Font("Verdana", Font.BOLD, 12));
            this.add(lbltest);
        i want to use the String st in the jLabel in createGUI

  • Id from one table showing value from another

    I have an article id (rs_comments.id_com) but I would like it
    to take this data and collect the value from another table.
    I have joined the two tables with:
    SELECT * FROM blg_comment_com INNER JOIN blg_article ON
    idart_com=id_art
    WHERE valid_com=1
    ORDER BY date_com DESC
    rs_comments.idart_com needs to be equal to rs_comments.id_art
    displaying the value from rs_comments.title_art
    How would I go about doing this. There only seems to be an
    option in DW to do this with a dynamic list/menu but I just want to
    display the text without option to change it.
    Any help much appreciated.

    i was stupid. The answer was staring me in the face. No
    wonder no-one bothered to reply...

  • How to derive a variable value from another variable of a different IO?

    Hi Gurus,
    I am aware that using BEx variables and Customer Exit you are able to derive a variable value from another variable of the same infoobject (for example, Fiscal Year/Period (0FISCPER) and Calendar Day (0CALDAY)).
    However, is is possible, using the same approach to derive a variable value from another variable that is in a different InfoObject? (for example, Input Fiscal Year/Period (0FISCPER) but derive Output of Required Start Date (0REQSTDAT))?
    There are 2 BEx variables involved,
    1) A user entry variable that is restricted in 0FISCPER
    2) A customer exit variable that is restricted in ZREQSTDAT
    In CMOD under EXIT_SAPLRRS0_001, Include ZXRSRU01, the code (I assume, correct me if I'm wrong) should perform 3 functions in I_STEP = 2,
    1) After the pop up, capture user entry of Fiscal Year/Period
    2) Identify or convert Fiscal Year/Period to Calendar Day range (unsure on how to code this portion)
    3) Use the Calendar Day to lookup on matching Required Start Date and display all Required Start Date that matches. (unsure on how to code on this portion)
    Hope to hear your thoughts soon.
    Regards,
    Eric

    Hi Shanthi,
    I've made the necessary adjustments. The only difference in my code is,
    Instead of,
    If I_VNAM = 'ZREQSTDAT'
    I use,
    CASE I_VNAM.
    Instead of,
    PARAMETERS: ZFISCPER TYPE /BI0/OIFISCPER.
    ZYEAR = ZFISCPER(4).
    ZMM = ZFISCPER+4(3).
    I use ,
    This is the Customer Exit Variable in ZREQSTDAT
    WHEN 'ZRSD_CX'.
    The loop I use for the User Entry Variable in 0FISCPER-ZFYP_IN
      LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
          WHERE VNAM = 'ZFYP_IN'.
        IF SY-SUBRC = 0.
            CLEAR L_S_RANGE.
    ZYEAR = LOC_VAR_RANGE(4).
    ZMM = LOC_VAR_RANGE+4(3).
    The codes were checked with no errors.
    However, when I input the Fiscal Year/Periods and hit 'Execute'. The report went blank, not sure what is the cause. I've tried it several times. No error message appeared.
    Regards,
    Eric

  • How do you return more than one value from a method?

    say I have this:
    public static int myFunc(String inString)
         // I want to return two values from this method
    }yeah so how would i do that?

    If the two values are somehow related--like a person's name and his age--define a class that has those two values as member variables--for example, Person. But only if that class and the assocation of those two quantities makes sense as an entity in your program. Don't do it just to jam to quantities into one return.
    Or, if the two values are two of the same thing--person A's age and person B's age--then you can return an array or Collection.
    If it doesn't fit either of those two scenarios, then your method is trying to do too much unrelated stuff and you should break it into multiple methods. For example, calculating a Person's age based on his birthdate and today's date and calculating his Body Mass Index based on his height and weight. Those two quantities should NOT be returned together.

Maybe you are looking for

  • Acrobat form; how to set-up a drop down list that has catagories?

    Hi, We produce business directories. I am working on a display ad proof template where the user has a choice of 10 main categories where each main has 5 to 15 sub-categories. In my new Adobe Acrobat Pro 9 I understand how to create a drop down list,

  • G7 and Firewire ports?

    Is there a way to add a Firewire port or PCMCIA port on my HP Pavilion g7-1075dx?  Without resorting to USB - with the severe quality loss in conversion, that's not an option. If not, I'd be really really interested in knowing the reason why, when FW

  • File generation from Report 3.0

    Hi, I have Developer 2.1 and I tried to run a report from a Form (RunProduct). It works, but when (from the prewiewer) I generate a file (for example a HTML file) this file has no data in. That is it has all the headings (constant data)but no data ba

  • Publishing Features Q - Creative Cloud single edition

    Hi there. Just wondered if someone could clarify a these Q's on publishing features for a single folio app using the CC single edition. 1. The number of updates I can make to my app are unlimited? I've read somewhere on this forum there was a limit t

  • Is Muse CC 2014 a separate product from current Muse CC?

    I have a Creative Cloud single-app membership for Adobe Muse. When I started MUSE yesterday, it offerred me a new version upgrade ( to Muse CC 2014) which I accepted. However, this didn't remove my current Muse CC desktop application.So I now have tw